GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — 'NoneType' object has no attribute 'strip' · Issue #7210 · pgadmin-org/pgadmin4

'NoneType' object has no attribute 'strip' #7210

New issue
Copy link
New issue
Copy link
Closed
Closed
'NoneType' object has no attribute 'strip'#7210
Copy link
Assignees
anilsahoo20
Labels
Bug
Milestone
8.5

Description

@rbrooklyn
rbrooklyn
opened on Feb 13, 2024
Issue body actions

Describe the bug

When doing anything to a table or a view (and possibly other objects) using the "properties" right click menu, such as adding a column, there is a high chance of an error message of "'NoneType' object has no attribute 'strip'"

To Reproduce

Steps to reproduce the behavior:

  1. Go to any table
  2. Right click on table name, go to "Properties..."
  3. Add a column, or make any other change
  4. See the error

Expected behavior

Error should not show. Window should close and the work be completed.

Error message

'NoneType' object has no attribute 'strip'
This appears in a red box at the bottom of the window.

Desktop (please complete the following information):

  • OS: Windows
  • Version: 8.3, however this has been an issue for years.
  • Mode: Desktop
  • Package type: MSI installer

Additional context

This is extremely difficult to track down what triggers this bug. Sometimes it works. Sometimes it does not work. I have no reason for when it works and when it doesn't work. If I go to the SQL tab in the properties window, it produces perfect SQL every time, so I can just copy and paste that and it works fine, but clicking "Save" just doesn't work sometimes.

Reacted by Rafi, Toby Dimmick and cobolbaby

Activity

Next
  1. rbrooklyn
    added
    Bug
    on Feb 13, 2024
  2. adityatoshniwal commented on Feb 14, 2024

    @adityatoshniwal
    adityatoshniwal
    on Feb 14, 2024
    Contributor
    More actions

    Hi @rbrooklyn,
    Can you please share the pgAdmin logs from File->Runtime->View logs?

  3. akshay-joshi
    added this to Not Refinedon Feb 14, 2024
  4. rbrooklyn commented on Feb 14, 2024

    @rbrooklyn
    rbrooklyn
    on Feb 14, 2024
    Author
    More actions

    I think this is the bit that you need. I've managed to trigger the bug just now and this is the latest entry. Lines before that are errors that I triggered by not formatting my query correctly.

    --------------[UI error]---------------
    AxiosError: Request failed with status code 500
    at http://127.0.0.1:51321/static/js/generated/vendor.others.js?ver=80300:109:2210814
    at XMLHttpRequest.d (http://127.0.0.1:51321/static/js/generated/vendor.others.js?ver=80300:109:2210959)
    at ke.request (http://127.0.0.1:51321/static/js/generated/vendor.others.js?ver=80300:109:2216487)
    ------------[UI End]----------------

    Also a screenshot I should have attached yesterday, in this case I was trying to grant a user update and insert access to a table:
    image

  5. rbrooklyn commented on Feb 16, 2024

    @rbrooklyn
    rbrooklyn
    on Feb 16, 2024
    Author
    More actions

    Full log below from this morning. I started pgadmin this morning and tried to give a group access to a table and it failed. This is literally the only operation done with pgadmin and I'm happy to share the full log in this case:

    pgAdmin Runtime Environment

    Python Path: "C:\Program Files\pgAdmin 4\python\python.exe"
    Runtime Config File: "C:\Users\RBrooklyn\AppData\Roaming\pgadmin\runtime_config.json"
    pgAdmin Config File: "C:\Program Files\pgAdmin 4\web\config.py"
    Webapp Path: "C:\Program Files\pgAdmin 4\web\pgAdmin4.py"
    pgAdmin Command: "C:\Program Files\pgAdmin 4\python\python.exe -s C:\Program Files\pgAdmin 4\web\pgAdmin4.py"
    Environment:

    • ALLUSERSPROFILE: C:\ProgramData
    • APPDATA: C:\Users\RBrooklyn\AppData\Roaming
    • CHROME_CRASHPAD_PIPE_NAME: \.\pipe\crashpad_12520_GOYQGZKPRFKOGSBK
    • CHROME_RESTART: NW.js|Whoa! NW.js has crashed. Relaunch now?|LEFT_TO_RIGHT
    • CommonProgramFiles: C:\Program Files\Common Files
    • CommonProgramFiles(x86): C:\Program Files (x86)\Common Files
    • CommonProgramW6432: C:\Program Files\Common Files
    • COMPUTERNAME: L219555
    • ComSpec: C:\Windows\system32\cmd.exe
    • DriverData: C:\Windows\System32\Drivers\DriverData
    • FPS_BROWSER_APP_PROFILE_STRING: Internet Explorer
    • FPS_BROWSER_USER_PROFILE_STRING: Default
    • HOMEDRIVE: C:
    • HOMEPATH: \Users\RBrooklyn
    • JAVA_HOME: C:\Program Files\Microsoft\jdk-17.0.5.8-hotspot\
    • LOCALAPPDATA: C:\Users\RBrooklyn\AppData\Local
    • LOGONSERVER: \L219555
    • NUMBER_OF_PROCESSORS: 8
    • OneDrive: C:\Users\RBrooklyn\OneDrive - Holland & Barrett
    • OneDriveCommercial: C:\Users\RBrooklyn\OneDrive - Holland & Barrett
    • OS: Windows_NT
    • Path: C:\Program Files\pgAdmin 4\runtime;C:\Program Files\Python311\Scripts;C:\Program Files\Python311;C:\Program Files\Microsoft\jdk-17.0.5.8-hotspot\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files\dotnet;C:\Program Files\Amazon\AWSCLIV2;C:\Program Files\nodejs;C:\Users\RBrooklyn\AppData\Local\Microsoft\WindowsApps;C:\Users\RBrooklyn\AppData\Local\Programs\Microsoft VS Code\bin;C:\Program Files\PostgreSQL\15\bin;C:\Users\RBrooklyn\AppData\Roaming\npm
    • PATHEXT: .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.PY;.PYW
    • PGADMIN_INT_KEY: cebc4e2e-04b1-49e2-9e8c-756ac0c13aea
    • PGADMIN_INT_PORT: 50596
    • PGADMIN_SERVER_MODE: OFF
    • PROCESSOR_ARCHITECTURE: AMD64
    • PROCESSOR_IDENTIFIER: Intel64 Family 6 Model 140 Stepping 1, GenuineIntel
    • PROCESSOR_LEVEL: 6
    • PROCESSOR_REVISION: 8c01
    • ProgramData: C:\ProgramData
    • ProgramFiles: C:\Program Files
    • ProgramFiles(x86): C:\Program Files (x86)
    • ProgramW6432: C:\Program Files
    • PSModulePath: C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules
    • PUBLIC: C:\Users\Public
    • SESSIONNAME: Console
    • SNOW_AGENT: C:\Program Files\Snow Software\Inventory\Agent\
    • SystemDrive: C:
    • SystemRoot: C:\Windows
    • TEMP: C:\Users\RBROOK~1\AppData\Local\Temp
    • TMP: C:\Users\RBROOK~1\AppData\Local\Temp
    • USERDNSDOMAIN: corp.hollandandbarrett.net
    • USERDOMAIN: CORP
    • USERDOMAIN_ROAMINGPROFILE: CORP
    • USERNAME: RBrooklyn
    • USERPROFILE: C:\Users\RBrooklyn
    • windir: C:\Windows
    • ZES_ENABLE_SYSMAN: 1

    Total spawn time to start the pgAdmin4 server: 0.018 Sec
    2024-02-16 09:20:57,196: WARNING werkzeug: Werkzeug appears to be used in a production deployment. Consider switching to a production web server instead.

    • Serving Flask app 'pgadmin'
    • Debug mode: off

    Total time taken to ping pgAdmin4 server: 21.527 Sec

    Total launch time of pgAdmin4: 22.006 Sec

    Application Server URL: http://127.0.0.1:50596/?key=cebc4e2e-04b1-49e2-9e8c-756ac0c13aea
    --------------[UI error]---------------
    AxiosError: Request failed with status code 500
    at http://127.0.0.1:50596/static/js/generated/vendor.others.js?ver=80300:109:2210814
    at XMLHttpRequest.d (http://127.0.0.1:50596/static/js/generated/vendor.others.js?ver=80300:109:2210959)
    at ke.request (http://127.0.0.1:50596/static/js/generated/vendor.others.js?ver=80300:109:2216487)
    ------------[UI End]----------------

  6. adityatoshniwal commented on Feb 19, 2024

    @adityatoshniwal
    adityatoshniwal
    on Feb 19, 2024
    Contributor
    More actions

    @rbrooklyn Still not reproducible. Can you share exact permissions screenshot? We can try same. Or even you can try.

  7. rbrooklyn commented on Feb 19, 2024

    @rbrooklyn
    rbrooklyn
    on Feb 19, 2024
    Author
    More actions

    It's not just permissions... It's anything using those windows. On these occasions it was permissions, but sometimes it's adding a column, or a constraint, or anything else.

    For example, when writing this comment, I added a column called "farts" to this table and got the error:
    image
    Yet as you can see, valid SQL is produced:
    image

    I can try 10 times and it works 10 times. I can try 10 times and it fails 10 times (although if it fails I do have to close and reopen to window to have any chance of success). Sometimes I can close the window, do the exact same changes and press "Save" and it will work again. Which is exactly what happened here when I closed the window, did the exact same action, but this time it worked:
    image

    It's incredibly difficult to reproduce and this bug is years old but I've never reported it as I've never found what triggers it. This has, however, happened over multiple machines.

    SELECT VERSION() returns:
    PostgreSQL 13.13 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 7.3.1 20180712 (Red Hat 7.3.1-12), 64-bit

  8. adityatoshniwal commented on Feb 20, 2024

    @adityatoshniwal
    adityatoshniwal
    on Feb 20, 2024
    Contributor
    More actions

    Hi @rbrooklyn,
    Does it occur only on this table? If yes, then you can share the DDL of this table.

  9. rtrad89 commented on Feb 21, 2024

    @rtrad89
    rtrad89
    on Feb 21, 2024
    More actions

    I am facing the same issue on Ubuntu with pgAdmin desktop 8.4.

  10. rbrooklyn commented on Feb 21, 2024

    @rbrooklyn
    rbrooklyn
    on Feb 21, 2024
    Author
    More actions

    Hi @rbrooklyn, Does it occur only on this table? If yes, then you can share the DDL of this table.

    No, it occurs everywhere.

    Is there a way of turning on extra debugging? The logs I've sent don't look very helpful.

  11. adityatoshniwal commented on Feb 23, 2024

    @adityatoshniwal
    adityatoshniwal
    on Feb 23, 2024
    Contributor
    More actions

    HI @rbrooklyn,
    Can you replace the file attached on path /pgadmin install dir/web/pgadmin/browser/server_groups/servers/
    databases/schemas/tables/init.py and then restart pgAdmin?
    init.py.zip
    Once you get the error share the logs.

  12. akshay-joshi
    assigned
    rbrooklyn
    on Mar 1, 2024
  13. jonathan-knight commented on Mar 1, 2024

    @jonathan-knight
    jonathan-knight
    on Mar 1, 2024
    More actions

    This has been a problem since around 7.2 or 7.3. Prior versions work fine.

    The only extra info I can give is that if I make the change to the columns and then hit the "SQL" tab I can see the SQL that's about to be done.

    If I hit save first and cause an error, the SQL tab only ever reports "Definition incomplete"

    I haven't spotted the pattern of when it happens and when it doesn't. It's most of the time, but not all of the time and never on new small tables, just the big awkward ones.

  14. rbrooklyn commented on Mar 5, 2024

    @rbrooklyn
    rbrooklyn
    on Mar 5, 2024
    Author
    More actions

    Hello,

    I've been unable to trigger this bug for the past week. I have loaded in the python code given and once I trigger it I will update this issue with the log.

    Just reassuring that I haven't forgotten about this. I'm keen to fix this.

    Reacted by Aditya Toshniwal
  15. rbrooklyn commented on Mar 8, 2024

    @rbrooklyn
    rbrooklyn
    on Mar 8, 2024
    Author
    More actions

    I've managed to trigger the issue this morning when changing permissions for a table.

    I have upgraded to 8.4 this morning before this was triggered, so please keep this in mind. In hindsight, that may have been a mistake, but I don't think the python file has been rewritten (or maybe it was still loaded somehow, I don't know) as there is more information this time.

    Log is below:

    2024-03-08 09:37:39,318: ERROR pgadmin: 'NoneType' object has no attribute 'strip'
    Traceback (most recent call last):
    File "C:\Program Files\pgAdmin 4\web\pgadmin\browser\server_groups\servers\databases\schemas\tables_init_.py", line 1074, in update
    lock_on_table = self.get_table_locks(did, res['rows'][0])
    File "C:\Program Files\pgAdmin 4\web\pgadmin\browser\server_groups\servers\databases\schemas\tables\utils.py", line 2058, in get_table_locks
    if row['relation'].strip('"') == data['name']:
    AttributeError: 'NoneType' object has no attribute 'strip'

    --------------[UI error]---------------
    AxiosError: Request failed with status code 500
    at http://127.0.0.1:51378/static/js/generated/vendor.others.js?ver=80400:109:2196728
    at XMLHttpRequest.f (http://127.0.0.1:51378/static/js/generated/vendor.others.js?ver=80400:109:2196873)
    at ke.request (http://127.0.0.1:51378/static/js/generated/vendor.others.js?ver=80400:109:2202401)
    ------------[UI End]----------------

  16. 9 remaining items

  17. pravesh-sharma
    moved this from 🆕 New to 🏗 In Progress in Current Sprint (213)on Mar 26, 2024
  18. pravesh-sharma
    added a commit that references this issue on Mar 26, 2024

    Fixed an issue where table properties were not updating from properti…

    5999fe0
  19. pravesh-sharma
    moved this from 🏗 In Progress to In Review in Current Sprint (213)on Mar 26, 2024
  20. gmolop commented on Mar 26, 2024

    @gmolop
    gmolop
    on Mar 26, 2024
    More actions

    +1 here.. same bug using gui (on v8.4 win)
    as workarround, I run the query manually...
    Ex. GRANT SELECT ON TABLE public.table_name TO user; and works

    I've managed to trigger the issue this morning when changing permissions for a table.

    I have upgraded to 8.4 this morning before this was triggered, so please keep this in mind. In hindsight, that may have been a mistake, but I don't think the python file has been rewritten (or maybe it was still loaded somehow, I don't know) as there is more information this time.

    Log is below:

    2024-03-08 09:37:39,318: ERROR pgadmin: 'NoneType' object has no attribute 'strip'
    Traceback (most recent call last):
    File "C:\Program Files\pgAdmin 4\web\pgadmin\browser\server_groups\servers\databases\schemas\tables__init__.py", line 1074, in update
    lock_on_table = self.get_table_locks(did, res['rows'][0])
    File "C:\Program Files\pgAdmin 4\web\pgadmin\browser\server_groups\servers\databases\schemas\tables\utils.py", line 2058, in get_table_locks
    if row['relation'].strip('"') == data['name']:
    AttributeError: 'NoneType' object has no attribute 'strip'
    --------------[UI error]---------------
    AxiosError: Request failed with status code 500
    at http://127.0.0.1:51378/static/js/generated/vendor.others.js?ver=80400:109:2196728
    at XMLHttpRequest.f (http://127.0.0.1:51378/static/js/generated/vendor.others.js?ver=80400:109:2196873)
    at ke.request (http://127.0.0.1:51378/static/js/generated/vendor.others.js?ver=80400:109:2202401)
    ------------[UI End]----------------

  21. akshay-joshi
    added a commit that references this issue on Mar 27, 2024

    Fixed an issue where table properties were not updating from properti…

    b742487
  22. akshay-joshi
    moved this from In Review to In Testing in Current Sprint (213)on Mar 27, 2024
  23. akshay-joshi
    unassigned
    pravesh-sharma
    on Mar 27, 2024
  24. akshay-joshi
    added this to the 8.5 milestone on Mar 27, 2024
  25. akshay-joshi
    added
    EDB Sprint 165
    and removed
    EDB Sprint 164
    on Mar 27, 2024
  26. anilsahoo20
    self-assigned this
    on Apr 2, 2024
  27. anilsahoo20 commented on Apr 3, 2024

    @anilsahoo20
    anilsahoo20
    on Apr 3, 2024
    Contributor
    More actions

    As per the errors in log, we have fixed this.

  28. anilsahoo20
    closed this as completedon Apr 3, 2024
  29. anilsahoo20
    moved this from In Testing to ✅ Done in Current Sprint (213)on Apr 3, 2024
  30. akshay-joshi
    removed this from Current Sprint (213)on Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @anilsahoo20
    anilsahoo20

Labels

Bug

Type

No type

Projects

No projects

    Milestone

    • 8.5

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.