Обсуждение: invalid connection option "passfile"

Поиск
Список
Период
Сортировка

invalid connection option "passfile"

От
hubbamubba
Дата:
Hi,

Amazon linux 2
Python 3.7
Pgadmin 8.4/8.3 in server_mode installed via pip
Apache with mod_wsgi
ldap authentication
psycopg==3.1.12
psycopg-binary==3.1.12


I'm having issues using passfile on a new pgadmin4 install.
I have the app running and I can login with ldap and an internal user.
I'm also able to run setup.py and run load-servers (It reports the correct number of servers added) and I can
verify in sqlite3 db.

I can see the new server tab in the gui but when I click the new servers tab,
I get a load of errors:

Tue Mar 12 19:15:39.851547 2024] [wsgi:error] [pid 9262] [remote 172.18.1.88:38112] psycopg.ProgrammingError: invalid connection option "passfile"
[
 File "/opt/pgadmin4/venv/lib/python3.7/site-packages/pgadmin4/pgadmin/utils/driver/psycopg3/server_manager.py", line 116, in update
    self.create_connection_string(self.db, self.user)
  File "/opt/pgadmin4/venv/lib/python3.7/site-packages/pgadmin4/pgadmin/utils/driver/psycopg3/server_manager.py", line 696, in create_connection_string
    self.display_connection_string = make_conninfo(**display_dsn_args)
  File "/opt/pgadmin4/venv/lib64/python3.7/site-packages/psycopg/conninfo.py", line 59, in make_conninfo
    _parse_conninfo(conninfo)
  File "/opt/pgadmin4/venv/lib64/python3.7/site-packages/psycopg/conninfo.py", line 98, in _parse_conninfo
    raise e.ProgrammingError(str(ex))
psycopg.ProgrammingError: invalid connection option "passfile"

I get the same error if I use the gui to add a new DB connection using the passfile option.

I can't tell if this error is a really an unsupported connection param or pgadmin can't find my pgpass file. I've moved the pspass file to multiple locations but no progress.

Here is a snippet from servers.json
{ "Servers": {
    "1": {
      "Name": "dev-product",
      "Group": "Servers",
      "Host": "xxx",
      "Port": 5432,
      "Shared": true,
      "SharedUsername": "yyy",
      "Username": "yyy",
      "MaintenanceDB": "postgres",
      "SSLMode": "disable",
      "PassFile": "../../pgpass"
    },

Any thoughts?
Thanks,
Tom

Sent with Proton Mail secure email.

Re: invalid connection option "passfile"

От
hubbamubba
Дата:
This is the exception from the pgadmin4 log file

2024-03-13 19:22:50,053: ERROR pgadmin: 'NoneType' object has no attribute 'version'
Traceback (most recent call last):
  File "/opt/pgadmin4/venv/lib64/python3.7/site-packages/flask/app.py", line 1823, in full_dispatch_request
    rv = self.dispatch_request()
  File "/opt/pgadmin4/venv/lib64/python3.7/site-packages/flask/app.py", line 1799, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
  File "/opt/pgadmin4/venv/lib64/python3.7/site-packages/flask/views.py", line 107, in view
    return current_app.ensure_sync(self.dispatch_request)(**kwargs)
  File "/opt/pgadmin4/venv/lib/python3.7/site-packages/pgadmin4/pgadmin/browser/utils.py", line 309, in dispatch_request
    return method(*args, **kwargs)
  File "/opt/pgadmin4/venv/lib/python3.7/site-packages/pgadmin4/pgadmin/browser/utils.py", line 344, in children
    children = self.get_children_nodes(*args, **kwargs)
  File "/opt/pgadmin4/venv/lib/python3.7/site-packages/pgadmin4/pgadmin/browser/utils.py", line 365, in get_children_nodes
    children.extend(module.get_nodes(*args, **kwargs))
  File "/opt/pgadmin4/venv/lib/python3.7/site-packages/pgadmin4/pgadmin/browser/server_groups/servers/__init__.py", line 279, in get_nodes
    version=manager.version,
AttributeError: 'NoneType' object has no attribute 'version'


Sent with Proton Mail secure email.

On Wednesday, March 13th, 2024 at 7:54 AM, hubbamubba <hubbamubba@proton.me> wrote:
Hi,

Amazon linux 2
Python 3.7
Pgadmin 8.4/8.3 in server_mode installed via pip
Apache with mod_wsgi
ldap authentication
psycopg==3.1.12
psycopg-binary==3.1.12


I'm having issues using passfile on a new pgadmin4 install.
I have the app running and I can login with ldap and an internal user.
I'm also able to run setup.py and run load-servers (It reports the correct number of servers added) and I can
verify in sqlite3 db.

I can see the new server tab in the gui but when I click the new servers tab,
I get a load of errors:

Tue Mar 12 19:15:39.851547 2024] [wsgi:error] [pid 9262] [remote 172.18.1.88:38112] psycopg.ProgrammingError: invalid connection option "passfile"
[
 File "/opt/pgadmin4/venv/lib/python3.7/site-packages/pgadmin4/pgadmin/utils/driver/psycopg3/server_manager.py", line 116, in update
    self.create_connection_string(self.db, self.user)
  File "/opt/pgadmin4/venv/lib/python3.7/site-packages/pgadmin4/pgadmin/utils/driver/psycopg3/server_manager.py", line 696, in create_connection_string
    self.display_connection_string = make_conninfo(**display_dsn_args)
  File "/opt/pgadmin4/venv/lib64/python3.7/site-packages/psycopg/conninfo.py", line 59, in make_conninfo
    _parse_conninfo(conninfo)
  File "/opt/pgadmin4/venv/lib64/python3.7/site-packages/psycopg/conninfo.py", line 98, in _parse_conninfo
    raise e.ProgrammingError(str(ex))
psycopg.ProgrammingError: invalid connection option "passfile"

I get the same error if I use the gui to add a new DB connection using the passfile option.

I can't tell if this error is a really an unsupported connection param or pgadmin can't find my pgpass file. I've moved the pspass file to multiple locations but no progress.

Here is a snippet from servers.json
{ "Servers": {
    "1": {
      "Name": "dev-product",
      "Group": "Servers",
      "Host": "xxx",
      "Port": 5432,
      "Shared": true,
      "SharedUsername": "yyy",
      "Username": "yyy",
      "MaintenanceDB": "postgres",
      "SSLMode": "disable",
      "PassFile": "../../pgpass"
    },

Any thoughts?
Thanks,
Tom

Sent with Proton Mail secure email.

Re: invalid connection option "passfile"

От
Akshay Joshi
Дата:
Hi

On Wed, Mar 13, 2024 at 9:26 PM hubbamubba <hubbamubba@proton.me> wrote:
Hi,

Amazon linux 2
Python 3.7
Pgadmin 8.4/8.3 in server_mode installed via pip
Apache with mod_wsgi
ldap authentication
psycopg==3.1.12
psycopg-binary==3.1.12


I'm having issues using passfile on a new pgadmin4 install.
I have the app running and I can login with ldap and an internal user.
I'm also able to run setup.py and run load-servers (It reports the correct number of servers added) and I can
verify in sqlite3 db.

I can see the new server tab in the gui but when I click the new servers tab,
I get a load of errors:

Tue Mar 12 19:15:39.851547 2024] [wsgi:error] [pid 9262] [remote 172.18.1.88:38112] psycopg.ProgrammingError: invalid connection option "passfile"
[
 File "/opt/pgadmin4/venv/lib/python3.7/site-packages/pgadmin4/pgadmin/utils/driver/psycopg3/server_manager.py", line 116, in update
    self.create_connection_string(self.db, self.user)
  File "/opt/pgadmin4/venv/lib/python3.7/site-packages/pgadmin4/pgadmin/utils/driver/psycopg3/server_manager.py", line 696, in create_connection_string
    self.display_connection_string = make_conninfo(**display_dsn_args)
  File "/opt/pgadmin4/venv/lib64/python3.7/site-packages/psycopg/conninfo.py", line 59, in make_conninfo
    _parse_conninfo(conninfo)
  File "/opt/pgadmin4/venv/lib64/python3.7/site-packages/psycopg/conninfo.py", line 98, in _parse_conninfo
    raise e.ProgrammingError(str(ex))
psycopg.ProgrammingError: invalid connection option "passfile"

I get the same error if I use the gui to add a new DB connection using the passfile option.

I can't tell if this error is a really an unsupported connection param or pgadmin can't find my pgpass file. I've moved the pspass file to multiple locations but no progress.

Here is a snippet from servers.json
{ "Servers": {
    "1": {
      "Name": "dev-product",
      "Group": "Servers",
      "Host": "xxx",
      "Port": 5432,
      "Shared": true,
      "SharedUsername": "yyy",
      "Username": "yyy",
      "MaintenanceDB": "postgres",
      "SSLMode": "disable",
      "PassFile": "../../pgpass"
    },

    Is your servers.json file outdated? According to the latest format, it should appear as follows:

{
"Servers": {
"1": {
"Name": "dev-product",
"Group": "Servers",
"Host": "xxx",
"Port": 5432,
"MaintenanceDB": "postgres",
"Username": "yyy",
                       "Shared": true,
                       "SharedUsername": "yyy",
"ConnectionParameters": {
"sslmode": "disable",
"connect_timeout": 10,
"passfile": "../../pgpass"
}
}
}
}

    Another potential issue could be that pgAdmin is unable to locate the pgpass file at the specified path.

Any thoughts?
Thanks,
Tom

Sent with Proton Mail secure email.

Re: invalid connection option "passfile"

От
Akshay Joshi
Дата:
Hi Hubbamubba



On Fri, Mar 15, 2024 at 11:01 PM hubbamubba <hubbamubba@proton.me> wrote:
This is the exception from the pgadmin4 log file

2024-03-13 19:22:50,053: ERROR pgadmin: 'NoneType' object has no attribute 'version'
Traceback (most recent call last):
  File "/opt/pgadmin4/venv/lib64/python3.7/site-packages/flask/app.py", line 1823, in full_dispatch_request
    rv = self.dispatch_request()
  File "/opt/pgadmin4/venv/lib64/python3.7/site-packages/flask/app.py", line 1799, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
  File "/opt/pgadmin4/venv/lib64/python3.7/site-packages/flask/views.py", line 107, in view
    return current_app.ensure_sync(self.dispatch_request)(**kwargs)
  File "/opt/pgadmin4/venv/lib/python3.7/site-packages/pgadmin4/pgadmin/browser/utils.py", line 309, in dispatch_request
    return method(*args, **kwargs)
  File "/opt/pgadmin4/venv/lib/python3.7/site-packages/pgadmin4/pgadmin/browser/utils.py", line 344, in children
    children = self.get_children_nodes(*args, **kwargs)
  File "/opt/pgadmin4/venv/lib/python3.7/site-packages/pgadmin4/pgadmin/browser/utils.py", line 365, in get_children_nodes
    children.extend(module.get_nodes(*args, **kwargs))
  File "/opt/pgadmin4/venv/lib/python3.7/site-packages/pgadmin4/pgadmin/browser/server_groups/servers/__init__.py", line 279, in get_nodes
    version=manager.version,
AttributeError: 'NoneType' object has no attribute 'version'

   Does this error occur after changing the servers.json file? Can you please provide the exact steps to reproduce? 


Sent with Proton Mail secure email.

On Wednesday, March 13th, 2024 at 7:54 AM, hubbamubba <hubbamubba@proton.me> wrote:
Hi,

Amazon linux 2
Python 3.7
Pgadmin 8.4/8.3 in server_mode installed via pip
Apache with mod_wsgi
ldap authentication
psycopg==3.1.12
psycopg-binary==3.1.12


I'm having issues using passfile on a new pgadmin4 install.
I have the app running and I can login with ldap and an internal user.
I'm also able to run setup.py and run load-servers (It reports the correct number of servers added) and I can
verify in sqlite3 db.

I can see the new server tab in the gui but when I click the new servers tab,
I get a load of errors:

Tue Mar 12 19:15:39.851547 2024] [wsgi:error] [pid 9262] [remote 172.18.1.88:38112] psycopg.ProgrammingError: invalid connection option "passfile"
[
 File "/opt/pgadmin4/venv/lib/python3.7/site-packages/pgadmin4/pgadmin/utils/driver/psycopg3/server_manager.py", line 116, in update
    self.create_connection_string(self.db, self.user)
  File "/opt/pgadmin4/venv/lib/python3.7/site-packages/pgadmin4/pgadmin/utils/driver/psycopg3/server_manager.py", line 696, in create_connection_string
    self.display_connection_string = make_conninfo(**display_dsn_args)
  File "/opt/pgadmin4/venv/lib64/python3.7/site-packages/psycopg/conninfo.py", line 59, in make_conninfo
    _parse_conninfo(conninfo)
  File "/opt/pgadmin4/venv/lib64/python3.7/site-packages/psycopg/conninfo.py", line 98, in _parse_conninfo
    raise e.ProgrammingError(str(ex))
psycopg.ProgrammingError: invalid connection option "passfile"

I get the same error if I use the gui to add a new DB connection using the passfile option.

I can't tell if this error is a really an unsupported connection param or pgadmin can't find my pgpass file. I've moved the pspass file to multiple locations but no progress.

Here is a snippet from servers.json
{ "Servers": {
    "1": {
      "Name": "dev-product",
      "Group": "Servers",
      "Host": "xxx",
      "Port": 5432,
      "Shared": true,
      "SharedUsername": "yyy",
      "Username": "yyy",
      "MaintenanceDB": "postgres",
      "SSLMode": "disable",
      "PassFile": "../../pgpass"
    },

Any thoughts?
Thanks,
Tom

Sent with Proton Mail secure email.

Re: invalid connection option "passfile"

От
hubbamubba
Дата:
My problem seems to be related to using mod_wsgi with apache.
I tried multiple version of mod_wsgi 4.x and 5.x but the problem remained.

The solution for me was to run pgadmin4 via gunicorn and a simple reverse proxy in apache.

Thanks for all the help!


Sent with Proton Mail secure email.

On Sunday, March 17th, 2024 at 10:40 PM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:
Hi Hubbamubba



On Fri, Mar 15, 2024 at 11:01 PM hubbamubba <hubbamubba@proton.me> wrote:
This is the exception from the pgadmin4 log file

2024-03-13 19:22:50,053: ERROR pgadmin: 'NoneType' object has no attribute 'version'
Traceback (most recent call last):
File "/opt/pgadmin4/venv/lib64/python3.7/site-packages/flask/app.py", line 1823, in full_dispatch_request
rv = self.dispatch_request()
File "/opt/pgadmin4/venv/lib64/python3.7/site-packages/flask/app.py", line 1799, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
File "/opt/pgadmin4/venv/lib64/python3.7/site-packages/flask/views.py", line 107, in view
return current_app.ensure_sync(self.dispatch_request)(**kwargs)
File "/opt/pgadmin4/venv/lib/python3.7/site-packages/pgadmin4/pgadmin/browser/utils.py", line 309, in dispatch_request
return method(*args, **kwargs)
File "/opt/pgadmin4/venv/lib/python3.7/site-packages/pgadmin4/pgadmin/browser/utils.py", line 344, in children
children = self.get_children_nodes(*args, **kwargs)
File "/opt/pgadmin4/venv/lib/python3.7/site-packages/pgadmin4/pgadmin/browser/utils.py", line 365, in get_children_nodes
children.extend(module.get_nodes(*args, **kwargs))
File "/opt/pgadmin4/venv/lib/python3.7/site-packages/pgadmin4/pgadmin/browser/server_groups/servers/__init__.py", line 279, in get_nodes
version=manager.version,
AttributeError: 'NoneType' object has no attribute 'version'

Does this error occur after changing the servers.json file? Can you please provide the exact steps to reproduce?


Sent with Proton Mail secure email.

On Wednesday, March 13th, 2024 at 7:54 AM, hubbamubba <hubbamubba@proton.me> wrote:
Hi,

Amazon linux 2
Python 3.7
Pgadmin 8.4/8.3 in server_mode installed via pip
Apache with mod_wsgi
ldap authentication
psycopg==3.1.12
psycopg-binary==3.1.12


I'm having issues using passfile on a new pgadmin4 install.
I have the app running and I can login with ldap and an internal user.
I'm also able to run setup.py and run load-servers (It reports the correct number of servers added) and I can
verify in sqlite3 db.

I can see the new server tab in the gui but when I click the new servers tab,
I get a load of errors:

Tue Mar 12 19:15:39.851547 2024] [wsgi:error] [pid 9262] [remote 172.18.1.88:38112] psycopg.ProgrammingError: invalid connection option "passfile"
[
File "/opt/pgadmin4/venv/lib/python3.7/site-packages/pgadmin4/pgadmin/utils/driver/psycopg3/server_manager.py", line 116, in update
self.create_connection_string(self.db, self.user)
File "/opt/pgadmin4/venv/lib/python3.7/site-packages/pgadmin4/pgadmin/utils/driver/psycopg3/server_manager.py", line 696, in create_connection_string
self.display_connection_string = make_conninfo(**display_dsn_args)
File "/opt/pgadmin4/venv/lib64/python3.7/site-packages/psycopg/conninfo.py", line 59, in make_conninfo
_parse_conninfo(conninfo)
File "/opt/pgadmin4/venv/lib64/python3.7/site-packages/psycopg/conninfo.py", line 98, in _parse_conninfo
raise e.ProgrammingError(str(ex))
psycopg.ProgrammingError: invalid connection option "passfile"

I get the same error if I use the gui to add a new DB connection using the passfile option.

I can't tell if this error is a really an unsupported connection param or pgadmin can't find my pgpass file. I've moved the pspass file to multiple locations but no progress.

Here is a snippet from servers.json
{ "Servers": {
"1": {
"Name": "dev-product",
"Group": "Servers",
"Host": "xxx",
"Port": 5432,
"Shared": true,
"SharedUsername": "yyy",
"Username": "yyy",
"MaintenanceDB": "postgres",
"SSLMode": "disable",
"PassFile": "../../pgpass"
},

Any thoughts?
Thanks,
Tom

Sent with Proton Mail secure email.