Hello pgAdmin Support,

I would like to report what appears to be a Windows regression in
pgAdmin 4 version 9.18.

I reproduced the same issue on two different Windows PCs:
- pgAdmin 4 9.17 worked normally.
- After upgrading to pgAdmin 4 9.18, PostgreSQL connections began failing.

Environment
- OS: Windows 11 64-bit
- pgAdmin 4: 9.18
- Previous working version: 9.17
- Bundled psql: PostgreSQL 18.6
- Bundled Python: Python 3.13.14
- PostgreSQL server: PostgreSQL 18 on Ubuntu 24.04

Symptoms

1. When connecting to a PostgreSQL server from pgAdmin 4 9.18, pgAdmin reports:

exception: access violation writing 0x0000000000000000

The pgAdmin log shows the failure in the psycopg/libpq connection path:

psycopg -> pq_ctypes.py -> PQconnectPoll()

ending with:

OSError: exception: access violation writing 0x0000000000000000

I have attached the pgadmin4.log file.

2. The bundled psql.exe also fails when launched normally.

Command:

"C:\Users\<user>\AppData\Local\Programs\pgAdmin 4\runtime\psql.exe" --version

It produces no output and exits with:

-1073741515

Windows also reports that gssapi64.dll cannot be found.

3. However, the required GSSAPI/Kerberos DLL files are actually
present in the pgAdmin installation under:

C:\Users\<user>\AppData\Local\Programs\pgAdmin 4\python

Files confirmed present:
- comerr64.dll
- gssapi64.dll
- k5sprt64.dll
- krb5_64.dll

Other runtime libraries such as libpq.dll, libssl-3-x64.dll,
libcrypto-3-x64.dll, liblz4.dll, libzstd.dll, libiconv-2.dll, and
libintl-8.dll are also present in the pgAdmin installation.

Workaround / reproduction detail

If I manually add both the pgAdmin Python and runtime directories to
PATH in PowerShell:

$rt = "C:\Users\<user>\AppData\Local\Programs\pgAdmin 4\runtime"
$py = "C:\Users\<user>\AppData\Local\Programs\pgAdmin 4\python"
$env:Path = "$py;$rt;$env:Path"

then:

& "$rt\psql.exe" --version

works correctly and returns:

psql (PostgreSQL) 18.6

Using the same environment, the bundled psql.exe can also successfully
connect to the remote PostgreSQL server.

This indicates that the PostgreSQL server configuration, pg_hba.conf,
authentication, network connectivity, and credentials are working
correctly.

Because the same behavior occurred on a second PC immediately after
upgrading from 9.17 to 9.18, this looks like a pgAdmin 4 9.18 Windows
packaging/runtime DLL search-path regression, particularly around the
bundled GSSAPI/Kerberos libraries.

Could you please check whether pgAdmin 4 9.18 on Windows is missing
the required DLL search-path initialization for the bundled
Python/runtime directories?

Please let me know if you need any additional logs or diagnostics.

Best regards
2026-09-18 17:32:07,205: WARNING        werkzeug:       Werkzeug appears to be 
used in a production deployment. Consider switching to a production web server 
instead.
2026-09-18 17:32:45,269: ERROR  pgadmin:        exception: access violation 
writing 0x0000000000000000
Traceback (most recent call last):
  File "C:\Users\withk\AppData\Local\Programs\pgAdmin 
4\web\pgadmin\browser\server_groups\servers\__init__.py", line 1376, in create
    status, errmsg = conn.connect(
                     ~~~~~~~~~~~~^
        password=password,
        ^^^^^^^^^^^^^^^^^^
    ...<2 lines>...
        server_types=ServerType.types()
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "C:\Users\withk\AppData\Local\Programs\pgAdmin 
4\web\pgadmin\utils\driver\psycopg3\connection.py", line 380, in connect
    pg_conn = psycopg.Connection.connect(
        connection_string,
        cursor_factory=DictCursor,
        prepare_threshold=manager.prepare_threshold)
  File "C:\Users\withk\AppData\Local\Programs\pgAdmin 
4\python\Lib\site-packages\psycopg\connection.py", line 109, in connect
    rv = waiting.wait_conn(gen, interval=_WAIT_INTERVAL)
  File "C:\Users\withk\AppData\Local\Programs\pgAdmin 
4\python\Lib\site-packages\psycopg\waiting.py", line 118, in wait_conn
    fileno, s = gen.send(ready)
                ~~~~~~~~^^^^^^^
  File "C:\Users\withk\AppData\Local\Programs\pgAdmin 
4\python\Lib\site-packages\psycopg\_connection_base.py", line 441, in 
_connect_gen
    pgconn = yield from generators.connect(conninfo, timeout=timeout)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\withk\AppData\Local\Programs\pgAdmin 
4\python\Lib\site-packages\psycopg\generators.py", line 84, in _connect
    status = conn.connect_poll()
  File "C:\Users\withk\AppData\Local\Programs\pgAdmin 
4\python\Lib\site-packages\psycopg\pq\pq_ctypes.py", line 127, in connect_poll
    return self._call_int(impl.PQconnectPoll)
           ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\withk\AppData\Local\Programs\pgAdmin 
4\python\Lib\site-packages\psycopg\pq\pq_ctypes.py", line 814, in _call_int
    return func(self._pgconn_ptr)
OSError: exception: access violation writing 0x0000000000000000
2026-09-18 17:35:50,912: ERROR  pgadmin:        exception: access violation 
writing 0x0000000000000000
Traceback (most recent call last):
  File "C:\Users\withk\AppData\Local\Programs\pgAdmin 
4\web\pgadmin\browser\server_groups\servers\__init__.py", line 1376, in create
    status, errmsg = conn.connect(
                     ~~~~~~~~~~~~^
        password=password,
        ^^^^^^^^^^^^^^^^^^
    ...<2 lines>...
        server_types=ServerType.types()
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "C:\Users\withk\AppData\Local\Programs\pgAdmin 
4\web\pgadmin\utils\driver\psycopg3\connection.py", line 380, in connect
    pg_conn = psycopg.Connection.connect(
        connection_string,
        cursor_factory=DictCursor,
        prepare_threshold=manager.prepare_threshold)
  File "C:\Users\withk\AppData\Local\Programs\pgAdmin 
4\python\Lib\site-packages\psycopg\connection.py", line 109, in connect
    rv = waiting.wait_conn(gen, interval=_WAIT_INTERVAL)
  File "C:\Users\withk\AppData\Local\Programs\pgAdmin 
4\python\Lib\site-packages\psycopg\waiting.py", line 118, in wait_conn
    fileno, s = gen.send(ready)
                ~~~~~~~~^^^^^^^
  File "C:\Users\withk\AppData\Local\Programs\pgAdmin 
4\python\Lib\site-packages\psycopg\_connection_base.py", line 441, in 
_connect_gen
    pgconn = yield from generators.connect(conninfo, timeout=timeout)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\withk\AppData\Local\Programs\pgAdmin 
4\python\Lib\site-packages\psycopg\generators.py", line 84, in _connect
    status = conn.connect_poll()
  File "C:\Users\withk\AppData\Local\Programs\pgAdmin 
4\python\Lib\site-packages\psycopg\pq\pq_ctypes.py", line 127, in connect_poll
    return self._call_int(impl.PQconnectPoll)
           ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\withk\AppData\Local\Programs\pgAdmin 
4\python\Lib\site-packages\psycopg\pq\pq_ctypes.py", line 814, in _call_int
    return func(self._pgconn_ptr)
OSError: exception: access violation writing 0x0000000000000000

Reply via email to