1

I am working with two versions of pgAdmin4, v5.7 and v7.4. With v7.4 I don´t have any trouble with connecting to my local or remote servers, however with v5.7 I have encountered problem with logging. It worked week before, but it doesn´t work now. I can not figure it out why it logs error "(sqlite3.OperationalError) no such column: server.hostaddr".

 [SQL: SELECT server.id AS server_id, server.user_id AS server_user_id, server.servergroup_id AS server_servergroup_id, server.name AS server_name, server.host AS server_host, server.hostaddr AS server_hostaddr, server.port AS server_port, server.maintenance_db AS server_maintenance_db, server.username AS server_username, server.password AS server_password, server.save_password AS server_save_password, server.role AS server_role, server.ssl_mode AS server_ssl_mode, server.comment AS server_comment, server.discovery_id AS server_discovery_id, server.db_res AS server_db_res, server.passfile AS server_passfile, server.sslcert AS server_sslcert, server.sslkey AS server_sslkey, server.sslrootcert AS server_sslrootcert, server.sslcrl AS server_sslcrl, server.sslcompression AS server_sslcompression, server.bgcolor AS server_bgcolor, server.fgcolor AS server_fgcolor, server.service AS server_service, server.connect_timeout AS server_connect_timeout, server.use_ssh_tunnel AS server_use_ssh_tunnel, server.tunnel_host AS server_tunnel_host, server.tunnel_port AS server_tunnel_port, server.tunnel_username AS server_tunnel_username, server.tunnel_authentication AS server_tunnel_authentication, server.tunnel_identity_file AS server_tunnel_identity_file, server.tunnel_password AS server_tunnel_password, server.shared AS server_shared, server.kerberos_conn AS server_kerberos_conn, servergroup_1.id AS servergroup_1_id, servergroup_1.user_id AS servergroup_1_user_id, servergroup_1.name AS servergroup_1_name 
FROM server LEFT OUTER JOIN servergroup AS servergroup_1 ON servergroup_1.id = server.servergroup_id 
WHERE (server.user_id = ? OR server.shared = 1) AND server.servergroup_id = ?]
[parameters: (1, 1)]
(Background on this error at: http://sqlalche.me/e/13/e3q8)
Traceback (most recent call last):
  File "C:\~\python\lib\site-packages\sqlalchemy\engine\base.py", line 1276, in _execute_context
    self.dialect.do_execute(
  File "C:\~\python\lib\site-packages\sqlalchemy\engine\default.py", line 608, in do_execute
    cursor.execute(statement, parameters)
sqlite3.OperationalError: no such column: server.hostaddr

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\~\python\lib\site-packages\flask\app.py", line 1950, in full_dispatch_request
    rv = self.dispatch_request()
  File "C:\~\python\lib\site-packages\flask\app.py", line 1936, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "C:\~\python\lib\site-packages\flask\views.py", line 89, in view
    return self.dispatch_request(*args, **kwargs)
  File "C:\~\web\pgadmin\browser\utils.py", line 315, in dispatch_request
    return method(*args, **kwargs)
  File "C:\~\web\pgadmin\browser\utils.py", line 350, in children
    children = self.get_children_nodes(*args, **kwargs)
  File "C:\~\web\pgadmin\browser\utils.py", line 371, in get_children_nodes
    children.extend(module.get_nodes(*args, **kwargs))
  File "C:\~\web\pgadmin\browser\server_groups\servers\__init__.py", line 208, in get_nodes
    servers = self.get_servers(servers, hide_shared_server, gid)
  File "C:\~\web\pgadmin\browser\server_groups\servers\__init__.py", line 174, in get_servers
    for server in all_servers:
  File "C:\~\python\lib\site-packages\sqlalchemy\orm\query.py", line 3535, in __iter__
    return self._execute_and_instances(context)
  File "C:\~\python\lib\site-packages\sqlalchemy\orm\query.py", line 3560, in _execute_and_instances
    result = conn.execute(querycontext.statement, self._params)
  File "C:\~\python\lib\site-packages\sqlalchemy\engine\base.py", line 1011, in execute
    return meth(self, multiparams, params)
  File "C:\~\python\lib\site-packages\sqlalchemy\sql\elements.py", line 298, in _execute_on_connection
    return connection._execute_clauseelement(self, multiparams, params)
  File "C:\~\python\lib\site-packages\sqlalchemy\engine\base.py", line 1124, in _execute_clauseelement
    ret = self._execute_context(
  File "C:\~\python\lib\site-packages\sqlalchemy\engine\base.py", line 1316, in _execute_context
    self._handle_dbapi_exception(
  File "C:\~\python\lib\site-packages\sqlalchemy\engine\base.py", line 1510, in _handle_dbapi_exception
    util.raise_(
  File "C:\~\python\lib\site-packages\sqlalchemy\util\compat.py", line 182, in raise_
    raise exception
  File "C:\~\python\lib\site-packages\sqlalchemy\engine\base.py", line 1276, in _execute_context
    self.dialect.do_execute(
  File "C:\~\python\lib\site-packages\sqlalchemy\engine\default.py", line 608, in do_execute
    cursor.execute(statement, parameters)

The logs traces back to several py files, ex. app.py, utils.py etc.

I've tried to reinstall pgAdmin, but nothing works. Any suggestions on what I could try? Thank you!

Update: I´ve come to conclusion that the problem lies in the configuration file ~AppData\Roaming\pgadmin\pgadmin4.db. So I unninstalled and removed all postgresql tools, including data connecting with pgadmin in user´s AppData.

4
  • Is there a reason you are trying to use such an old version, known to have many bugs?
    – jjanes
    Nov 15 at 14:10
  • Unfortunately yes, one of our application runs on an old postgres db. In the near future db and a whole app will be updated, but for now we need it as it is.
    – odGnol
    Nov 15 at 14:17
  • I solved the problem and edited the original post.
    – odGnol
    Nov 15 at 16:25
  • Does it now work with both versions? I would have thought that any given pgadmin4.db format is only going to work with one of those pgadmin4 versions or the other, not with both.
    – jjanes
    Nov 15 at 17:31

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.