Skip to main content

ArpePGSQL — Troubleshooting

Common failures and their fixes, grouped by where they show up: connecting, TLS/certificates, authenticating, the licence gate, and querying/ingesting. For the option details referenced here, see Connection.


Connection​

Connect hangs, then fails after ~30 s. The login budget (login_timeout, default 30 s) elapsed. With a connect error such as "Connection timed out", the host/port is unreachable: a firewall, a wrong port, or the server not listening. Verify with nc -vz <host> 5432. With login timed out after N s, the TCP connect succeeded but the server, or a pooler in front of it, did not finish the login in time: it stalled on the TLS handshake or on authentication, for example waiting on an LDAP/RADIUS backend. Lower login_timeout to fail faster while diagnosing.

A query hangs indefinitely and never times out. socket_timeout defaults to 0 (no per-I/O timeout). Set adbc.arpepgsql.socket_timeout to a bound in seconds to abort a stalled recv/send. query_timeout bounds how long a single statement may run: the server cancels it and the call fails with ADBC_STATUS_TIMEOUT. See Connection → Query timeout.

"Connection string: conflicting ports". A port written in Server / Host and a Port key must agree. Keep one of them, or make them equal.

"the database system is starting up" / "too many connections". These come straight from PostgreSQL. Wait for recovery to finish, or raise max_connections / use a pooler. Not a driver issue.

Wrong database or "database does not exist". A connection sees exactly one database (no cross-catalog). Set adbc.arpepgsql.database (or the URI path segment) to the right one; SET search_path selects the schema within it.

"Option '…' is too long (max … bytes)" / "Connection string: '…' value is too long". A server, database, username or password longer than 255 bytes, or an ssl_root_cert path longer than 1023 bytes, is rejected (the same applies to PGUSER, PGPASSWORD and PGSSLROOTCERT). Check the value for a stray paste.

An option value fails with INVALID_ARGUMENT. adbc.connection.autocommit and adbc.ingest.temporary take only true / false / 1 / 0, and the integer options (buffer_size, batch_size, max_batch_size, arpepgsql.bulk_batch_size) reject trailing text such as 10abc; buffer_size must also be positive. The boolean options (encrypt, trust_server_cert, require_password_encryption, the arpepgsql.bulk_* hints) take only true / yes / 1 or false / no / 0, in any case.

"Cannot release the connection: N statement(s) still open; release them first". A connection cannot be released while one of its statements is still open (INVALID_STATE). Release the statements first; the connection stays usable meanwhile.

Driver warnings go to stderr, not to the application's log. That is the default. Set arpeio.adbc.collect_warnings=true (and arpeio.adbc.warnings_to_stderr=false to silence stderr), then read arpeio.adbc.warnings on the database and on each connection. See Connection → Warnings.


TLS / certificates​

"unable to get local issuer certificate" with verify-full and no ssl_root_cert. The system CA store has no root for the server's chain. The driver reads the operating system's store (Linux: the distribution CA bundle; Windows: the ROOT certificate store; see Authentication → TLS). Set ssl_root_cert to the root CA, or on Linux point SSL_CERT_FILE at a bundle that holds it. A server signed by a private CA always needs ssl_root_cert.

"sslmode=verify-ca needs a root certificate to verify the server". verify-ca refuses to connect when it finds no root certificate: none in ssl_root_cert, PGSSLROOTCERT or ~/.postgresql/root.crt. As in libpq, the driver refuses rather than trust any certificate a public CA signed (verify-ca checks no host name). Set ssl_root_cert to the PEM root CA that signed the server certificate, or use verify-full, which checks the host name and falls back to the system CA store.

"Conflicting TLS settings: ...". encrypt / trust_server_cert and an explicit sslmode that ask for different things (for example Encrypt=yes with SslMode=disable) are rejected. Keep only sslmode, or make the keys agree. See Connection → Conflicting TLS settings.

"certificate verify failed" / hostname mismatch. With sslmode=verify-ca/verify-full the server certificate chain (and, for verify-full, the hostname) is verified. Point ssl_root_cert at the PEM root CA that signed the server certificate, or fix the certificate. Do not drop to sslmode=require in production to hide a bad certificate — require encrypts but verifies nothing.

sslmode=require fails certificate verification. require verifies the chain when a root certificate is set (ssl_root_cert or the PGSSLROOTCERT environment variable), as libpq does. Point the root certificate at the CA that signed the server's certificate, or remove the setting if you rely on require without verification. See Authentication → TLS.

Connection silently went plaintext. The default sslmode=prefer falls back to plaintext when the server declines TLS, and that reply is unauthenticated (read before TLS). Over an untrusted network use sslmode=verify-full and/or channel_binding=require. See Connection → TLS & sslmode.

channel_binding=require fails. Channel binding needs a TLS channel — it is unavailable under sslmode=disable and when GSS transport encryption is active. Enable TLS (sslmode=require+), or drop channel_binding to prefer.

"channel_binding=require, but the server requested authentication method …" / "… authenticated the client without channel binding". channel_binding=require accepts only a SCRAM-SHA-256-PLUS login. The pg_hba.conf line matching your connection uses another method (password, md5, gss, sspi or trust). Switch that line to scram-sha-256 (with the role's password stored as SCRAM), or set channel_binding to prefer.

Windows: "DLL not found" / the driver does not load. The released arpepgsql_adbc_driver-win-x64.dll is self-contained — it needs no separate OpenSSL or Visual C++ runtime DLLs. A load failure usually means the driver manager cannot find the driver: check that it was installed (see the install guide) or load it by its full path.


Authentication​

"password authentication failed for user '…'". SCRAM/MD5/cleartext credentials are wrong, or pg_hba.conf does not permit this user/host/method. Confirm with psql first, and check the pg_hba.conf line that matches your client address. When no password option is given, the driver takes it from PGPASSWORD, then from the password file (PGPASSFILE or ~/.pgpass): a stale entry there is a common cause, and on Linux a ~/.pgpass that is readable by group or others is ignored (chmod 0600 ~/.pgpass). In Python, a refused login or an unknown database on the first execute() is raised as ProgrammingError with its SQLSTATE (28P01, 3D000).

"no pg_hba.conf entry for host … , SSL off". The server requires TLS (hostssl) for your address. Set sslmode=require (or verify-full).

Kerberos on Linux: "needs MIT Kerberos, which was not found". A Kerberos login (or gssencmode attempt) needs MIT Kerberos and this host has none: install krb5-libs (RHEL, Rocky, Fedora) or libgssapi-krb5-2 (Debian, Ubuntu). Password logins do not need it, and gssencmode=prefer connects without GSS encryption.

Kerberos on Linux: GSSAPI errors ("Cannot find KDC", "Server not found in Kerberos database"). The SPN did not match or you have no valid ticket. The driver targets postgres/<server> (service name overridable with krbsrvname, full SPN with krb5.spn). Check that you have a ticket (klist), point at the right credential cache or keytab with krb5.ccache / krb5.keytab, and check that the SPN is registered. Details in Authentication.

"gssencmode=require and sslmode=… are mutually exclusive". GSS transport encryption skips TLS, so it cannot be combined with sslmode=require / verify-ca / verify-full. Use one or the other.

"server requires GSS/SSPI authentication; set auth_mode=integrated". The pg_hba.conf line matching your connection uses gss or sspi. Set adbc.arpepgsql.auth_type=integrated (on Linux this needs a Kerberos ticket), or ask for a password-based pg_hba.conf entry for your role.

Windows integrated auth: "integrated auth init: InitializeSecurityContext: SSPI 0x…". Windows could not obtain a ticket for the server. The driver targets the SPN POSTGRES/<server>, built from the server value as given: connect by the fully qualified host name under which the SPN is registered (not an IP address or alias), check the registration with setspn -Q POSTGRES/<host>, and override the target with krbsrvname (service part) or krb5.spn (whole SPN) if it is registered differently. Details in Authentication.

Windows integrated auth: "server did not provide mutual authentication". Mutual auth is always enforced — the driver refuses a login in which the server was not authenticated. It typically means Kerberos was not used; fix the SPN as above. A related error, "server sent AuthenticationOk before the GSS exchange completed", means the server skipped the end of the exchange: treat it as a real security signal, not a driver bug.

Windows integrated auth: "Negotiate fell back to NTLM ... require_kerberos is set". require_kerberos=true refuses any Windows login that is not Kerberos, and Negotiate used NTLM: usually no SPN is registered for the server, no KDC is reachable, or the server was named by IP address, by an alias, or as localhost. Register POSTGRES/<server FQDN> for the PostgreSQL service account (setspn -S) and connect by that name, or set krbsrvname / krb5.spn to the registered SPN. Without require_kerberos the same login is accepted over NTLM. Details in Authentication → NTLM.

Windows integrated auth: the login is rejected for the role. The server checks that your Windows identity may use the requested username. Align the role name with the account (for example include_realm=0 in pg_hba.conf) or add a pg_ident.conf map.

auth_type=ActiveDirectory… / a certificate auth mode is rejected. ArpePGSQL supports only sql and integrated/sspi; Entra ID and certificate authentication are not supported.


Licence​

Connection fails with an ARROW_LIC_* error. No valid Arpeio licence was found. The gate is always enforced — there is no off switch. Supply a licence via arpeio.adbc.license_file (a .lic path), arpeio.adbc.license (the blob inline), the ARPEIO_ADBC_LICENCE[_FILE] environment variable, or an arpeio_adbc.lic file next to the driver library. The installer's --license flag places the file for you. Full detail — including how to read the current licence state with arpeio.adbc.license.status — is in Licensing.


Query & ingest​

"a result set is still open on this connection; read it to the end or release it first". A connection refuses a new command while a result set from an earlier one is still being read (INVALID_STATE). Read the first result to the end (fetch_arrow_table(), or iterate the reader), or close its cursor or reader, before running the next statement, commit() or a metadata call.

"current transaction is aborted, commands ignored until end of transaction block" (SQLSTATE 25P02). With autocommit off, a statement failed earlier in the transaction, and PostgreSQL refuses everything after it. Call rollback(), then retry. The driver keeps the session after a SQL error, as PostgreSQL clients do, so the transaction stays open until you end it.

commit() fails with "the transaction was rolled back, not committed" (SQLSTATE 25P02). A statement failed earlier in the transaction, or a result stream released before its end had its query cancelled. PostgreSQL answers a COMMIT there with a silent ROLLBACK; the driver reports it as INVALID_STATE. Run the transaction again. See Connection → One command at a time.

A statement fails with ADBC_STATUS_TIMEOUT or ADBC_STATUS_CANCELLED and SQLSTATE 57014. The server stopped it: because it ran longer than query_timeout (or a statement_timeout set on the server, database or role), or because it was cancelled. The connection stays usable; inside a transaction, roll back first. How the two are told apart is described in Connection → Query timeout.

Ingested rows disappear when the connection closes. adbc_ingest with autocommit off joins the connection's open transaction: call commit() to keep the rows, as for any other statement. A rollback() undoes the ingest.

adbc_ingest(mode="create") fails "already exists". The target table exists; use append, replace, or create_append. An ingest statement with no adbc.ingest.mode at all also means create: set adbc.ingest.mode.append to append. Python's adbc_ingest() always sends a mode.

adbc_ingest(mode="append") fails "Arrow … values cannot be written to the existing … column" (SQLSTATE 42804). The pair of Arrow type and column type has no conversion (an int32 into a date, an int64 into a timestamp, text into money, …), so the column is refused before anything is written. Cast the Arrow column to the table's type first (for example pyarrow.compute.cast), or alter the table. Numbers between the integer, float, decimal and boolean types, numbers into text, and text into any other type are converted for you. See Data types → Type conversions on append.

Ingest into an existing column fails with INVALID_ARGUMENT naming the column and row. The column's type would change that value: a fraction into bigint, more significant digits than double precision (15) or real (6) shows, a number out of the column's range, text that is not a number into numeric. The driver rounds nothing. Round or cast the value at the source, or load into a wider column type.

Ingest fails "invalid input syntax for type …" with a COPY context such as (COPY t, line 2, column v: "abc"). A string column went into a non-text column (integer, date, a range, …) and the server's input function refused that value, as it would in an INSERT. The context names the line and column: fix the value at the source. See Data types → Text into any column type.

Ingested values into a numeric(p,s) column come back rounded, or the ingest fails "numeric field overflow". The server rounds every value it receives to the column's scale (half away from zero), as for an INSERT: 1.555 into numeric(18,2) is stored as 1.56. A value with more integer digits than p - s overflows. Widen the column, or use an unconstrained numeric, to keep every digit.

Ingest or executemany fails "malformed Arrow array: the data buffer is NULL but the offsets are not all 0". The producer exported a string or binary column that declares value bytes but has no data buffer to hold them. That is a bug in the producer; a column that holds only NULLs and empty values loads without a data buffer.

Ingest into a date column fails "row N: timestamp has a time of day, which the date column would drop". A timestamp without time zone goes into a date column when every value is exactly midnight. The value at that row is not (for example an Oracle DATE holding 13:45): truncate it at the source or load into a timestamp column. That ingest call stores nothing, but in a parallel copy (one ingest per partition and connection) partitions that finished cleanly have committed: truncate the target before retrying.

Ingest into a date column fails "row N: value cannot be converted to the target PostgreSQL type (date)". The value is a whole day but outside PostgreSQL's date range (4714-11-24 BC .. 5874897-12-31).

Ingest fails "Arrow timestamp with time zone values cannot be written to the existing date column". Which calendar day an instant falls on depends on the time zone, so the driver will not pick one: convert to a timestamp without time zone (or a date32) in the zone you want before ingesting.

"an array with a lower bound other than 1 cannot be read as an Arrow list" / "an array value has a different number of dimensions". Arrow lists store neither a lower bound nor a per-value depth. Cast the column to text in the query, or for the lower bound set adbc.arpepgsql.array_lower_bound=ignore. See Data types → Arrays.

A text-path read fails naming DateStyle, or "client_encoding was changed to ...". The text row path reads ISO dates and UTF-8 only. RESET DateStyle (or SET DateStyle = ISO) to read dates again. A changed client_encoding closes the connection; the next statement reconnects in UTF8. See Data types → Text row path.

A read fails on an infinity / -infinity date or timestamp, naming the column and temporal_infinity. Arrow dates and timestamps cannot hold PostgreSQL's infinite values. Set adbc.arpepgsql.temporal_infinity=extreme to read them as the largest and smallest Arrow values (and write those back as infinity / -infinity on ingest), or map them in the query, for example NULLIF(valid_to, 'infinity'). See Data types → Infinite dates and timestamps.

"query returned more than one result set". On the text row path (see copy_format) a query text must hold a single statement. Run the statements one at a time.

A geospatial column reads as opaque bytes I can't parse. That is geospatial=binary (raw EWKB, no extension metadata). Use the default geoarrow.wkb mode for interoperable output (ISO WKB plus GeoArrow metadata). See Data types → Geospatial.

Geometries read without their SRID. The default geoarrow.wkb mode returns ISO WKB, which has no SRID; the SRID goes in the field's crs metadata, and only a typmod-constrained column has one. Cast in the query (geom::geometry(Geometry, 2154)), select ST_SRID(geom), or read with geospatial=wkb (EWKB, SRID in each value). See Data types → Geospatial.

"COPY stream ended without its end-of-data trailer: the result is truncated" / "result ended without its CommandComplete". A result stream that a server or proxy ends early is an error instead of a short result. PostgreSQL itself always completes the stream, so look at what sits between the driver and the server.

Getting the server's full error (detail, hint, table, constraint, position). A server error carries every field PostgreSQL sent, as ADBC 1.1 error details under the libpq names (PG_DIAG_MESSAGE_DETAIL, PG_DIAG_MESSAGE_HINT, PG_DIAG_STATEMENT_POSITION, PG_DIAG_SCHEMA_NAME, PG_DIAG_TABLE_NAME, PG_DIAG_CONSTRAINT_NAME, PG_DIAG_SQLSTATE, ...), the keys the upstream PostgreSQL ADBC driver uses. In Python they are on the exception:

Python
try:
cur.execute("INSERT INTO t VALUES (1)")
except adbc_driver_manager.dbapi.Error as e:
details = {k.decode(): v.decode() for k, v in e.details}
print(e.sqlstate, details.get("PG_DIAG_CONSTRAINT_NAME"),
details.get("PG_DIAG_MESSAGE_DETAIL"))

An error raised while reading a result (fetch_arrow_table(), a batch reader) has them too, and in Python it is raised as the matching DB-API exception (DataError for a division by zero, for example) with .sqlstate and .details. From C, set error.vendor_code = ADBC_ERROR_VENDOR_CODE_PRIVATE_DATA before the call and read them with AdbcErrorGetDetailCount / AdbcErrorGetDetail; AdbcErrorFromArrayStream returns the error behind a failed stream.

Cancelling a long query. AdbcConnectionCancel / AdbcStatementCancel ask the server to cancel the running query, as libpq does. If it does not take effect, the server may already have finished producing rows. A cancelled call returns ADBC_STATUS_CANCELLED with SQLSTATE 57014, and a cancelled or timed-out query is never run a second time.


See also​