Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query tool does not open when user is not defined #5575

Closed
jouve opened this issue Nov 25, 2022 · 2 comments
Closed

Query tool does not open when user is not defined #5575

jouve opened this issue Nov 25, 2022 · 2 comments
Assignees
Milestone

Comments

@jouve
Copy link
Contributor

jouve commented Nov 25, 2022

when opening the query tool, I see the following message:
{"success":0,"errormsg":"'NoneType' object has no attribute 'replace'","info":"","result":null,"data":null} instead of the query tool.

how to reproduce:

  • create a Server with only General>Name & Connection>Service (configuration in pg_service.conf)
  • connect to the database (OK)
  • open query tool

workaround: add a Username in Connection>Username, the query tool works again

logs:

2022-11-25 14:52:12,005: ERROR	pgadmin:	'NoneType' object has no attribute 'replace'
Traceback (most recent call last):
  File "/Applications/pgAdmin 4.app/Contents/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/flask/app.py", line 1517, in full_dispatch_request
    rv = self.dispatch_request()
  File "/Applications/pgAdmin 4.app/Contents/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/flask/app.py", line 1503, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
  File "/Applications/pgAdmin 4.app/Contents/Resources/web/pgadmin/tools/sqleditor/__init__.py", line 317, in panel
    params['user'] = underscore_escape(s.username)
  File "/Applications/pgAdmin 4.app/Contents/Resources/web/pgadmin/browser/utils.py", line 47, in underscore_escape
    text = text.replace(c, r)
AttributeError: 'NoneType' object has no attribute 'replace'
@yogeshmahajan-1903 yogeshmahajan-1903 added this to the 6.17 milestone Nov 28, 2022
@yogeshmahajan-1903 yogeshmahajan-1903 self-assigned this Nov 28, 2022
@yogeshmahajan-1903 yogeshmahajan-1903 moved this from 🆕 New to 🏗 In Progress in Current Sprint (183) Nov 28, 2022
akshay-joshi pushed a commit that referenced this issue Nov 28, 2022
@akshay-joshi akshay-joshi moved this from 🏗 In Progress to In Testing in Current Sprint (183) Nov 28, 2022
@nboisteault
Copy link

@jouve Many thanks for the bug issue and the workaround. I've spent many hours trying to understand this issue.

yogeshmahajan-1903 added a commit to yogeshmahajan-1903/pgadmin4 that referenced this issue Nov 30, 2022
yogeshmahajan-1903 added a commit to yogeshmahajan-1903/pgadmin4 that referenced this issue Nov 30, 2022
yogeshmahajan-1903 added a commit to yogeshmahajan-1903/pgadmin4 that referenced this issue Nov 30, 2022
akshay-joshi pushed a commit to akshay-joshi/pgadmin4 that referenced this issue Dec 1, 2022
akshay-joshi pushed a commit to akshay-joshi/pgadmin4 that referenced this issue Dec 1, 2022
akshay-joshi pushed a commit to akshay-joshi/pgadmin4 that referenced this issue Dec 1, 2022
akshay-joshi pushed a commit to akshay-joshi/pgadmin4 that referenced this issue Dec 1, 2022
@pravesh-sharma
Copy link
Contributor

This is tested on candidate build and is fixed.

@pravesh-sharma pravesh-sharma moved this from In Testing to ✅ Done in Current Sprint (183) Dec 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants