Amazon Redshift will no longer support the use of Python UDFs after June 30, 2026.
We will start enforcing it in phases. For more information on the details of Python end of life
and migration options, see the
blog post
Troubleshooting the Redshift extension for DuckDB
This topic helps you diagnose and resolve common errors when you install, load, attach, connect to, and query with the extension, and shows how to turn on logging for deeper diagnosis. The errors usually come from a missing install or load, a misconfigured attach, a network or credential problem, or a query limitation.
Each error from Redshift or the driver carries a SQLSTATE on a line of its own. A message that the statement couldn't run or couldn't return the result means the statement might have taken effect, so check its effects before you run it again.
Install and load
The following table lists common install and load errors, their causes, and fixes.
| Message | Cause | Fix |
|---|---|---|
|
The repository has no build for this DuckDB version or platform. |
Check that DuckDB is the supported version (Compatibility and updates), on a supported platform (Platform requirements). |
The |
The extension is not installed for this DuckDB version, or it is not loaded in this session. |
Run |
The driver needs |
The Linux host lacks the keyutils library. |
Install |
This build carries no driver for this platform. |
The build has no embedded driver for this platform. |
Use a supported platform and a published build. |
Attach
The following table lists common attach errors, their causes, and fixes.
| Message | Cause | Fix |
|---|---|---|
A Redshift handle cannot be named
|
An empty path without |
Add |
A required |
The attach names no credential source. |
Name one credential source ( |
Missing target. |
The attach gives With an earlier release of the extension, the attach names no workgroup, cluster, or endpoint, and that release doesn't attach Amazon Redshift Serverless with express configuration. |
To attach the express configuration, leave out
With an earlier release, take the latest release, as described in Compatibility and updates. |
Invalid ATTACH option. |
An option name the extension doesn't know. |
Remove it. |
Give the endpoint and its port as the path instead. |
A |
Leave |
The path is an ARN that names its target by ID, and finding it needs an AWS lookup that this extension doesn't make. |
A workgroup ARN by ID under |
Give the workgroup by its endpoint or by |
A Redshift handle cannot be read-only. |
|
Remove it. Use |
|
The secret has no keys, because the |
Create the secret again with credentials the |
Attach values
An attach checks the WORKGROUP, ACCOUNT_ID,
CLUSTER, DATABASE, and REGION values when it
opens the connection.
| Message | Cause | Fix |
|---|---|---|
The value is not an |
A misspelt or unsupported AWS Region. |
Use a lower-case |
The |
A bad workgroup name. |
Fix |
The |
An account ID that is not 12 digits. |
Fix |
The |
A bad cluster identifier. |
Fix |
Connect
The following table lists common connection errors, their causes, and fixes.
| Message | Cause | Fix |
|---|---|---|
The AWS credentials were refused or have expired. |
The secret's temporary credentials expired or are invalid. The extension does not refresh them. |
Recreate the secret to get new credentials, then retry. |
No usable AWS credentials were found through the AWS credential chain. |
The chain reached no usable credentials for this process. |
Make credentials reachable through environment variables,
the profile that |
The AWS identity is not allowed to connect to the target. |
Missing IAM permissions. |
For the required actions, see Authentication and IAM permissions. |
The Redshift workgroup (or cluster) was not found. |
A wrong workgroup, account, or AWS Region. For a cluster, a wrong cluster name or a paused cluster. |
Check |
The server's TLS certificate could not be verified. |
No usable CA bundle, or something intercepts TLS. |
Check |
The workgroup did not answer within the connect attempts. |
A Redshift Serverless workgroup is resuming, or it is not reachable from this network. A workgroup whose traffic the network drops, such as a private one, fails only after the resume wait. |
Retry, and check that the endpoint is reachable from this host. |
The Redshift workgroup's host name could not be resolved. |
A wrong endpoint, or this host can't resolve public names. |
Check the endpoint's spelling and the host's DNS resolution. |
The Redshift cluster did not answer. |
The cluster isn't reachable from this network. |
Check the cluster's public access, security group, and route. |
Each new connection waits about 12 seconds before it connects. |
The instance metadata service doesn't answer, so the driver's AWS SDK waits on its region lookup. |
Set |
The database was not found on the Redshift workgroup,
SQLSTATE |
A wrong |
Check |
|
|
Connect to |
No CA certificate bundle was found. |
The host has no readable CA bundle. |
Install the operating system's CA certificates, or set
|
No usable directory to install the Redshift ODBC driver in. |
Each directory the extension tried broke a rule, which the message names. |
Set |
Query
The following table lists common query errors, their causes, and fixes.
| Message | Cause | Fix |
|---|---|---|
The handle cannot be browsed as a catalog. |
A reference such as |
Use |
|
It was called inside a |
Run it in autocommit mode. |
The Redshift transaction is aborted. |
An earlier error in a Redshift transaction. |
Run |
The connection was lost, and the statement was not replayed. |
The network or the server dropped the session. |
Check whether a write took effect, then run again. |
A column has a type this extension does not support. |
An unsupported type. |
Cast the column in the Redshift SQL. See Data type mapping. |
A statement holding |
The driver rewrites each |
Write no |
The statement's result shape changed on the server after it was checked. |
Redshift gave a column another type when the statement ran than when it was checked, as it can for an expression over a system view. |
Cast the column in the Redshift SQL, such as
|
|
A handle was used in two calls in one statement. |
Stage one result in a DuckDB temporary table first, or attach a second handle. |
Logging
The extension writes debug lines and warnings through the DuckDB logger. Because an attach now opens a connection, turn on debug logging before you attach, so that the connect lines are captured. Keep it in memory so that the DuckDB CLI can query it, and read the log:
CALL enable_logging(level = 'debug', storage = 'memory'); LOAD redshift FROM aws.amazon.com; ATTACH '' AS rs (TYPE redshift, WORKGROUP 'my-workgroup', ACCOUNT_ID '111122223333', REGION 'us-east-1', CREDENTIAL_PROVIDER aws_default_chain); SELECT * FROM redshift_query('rs', 'SELECT 1'); SELECT log_level, message FROM duckdb_logs WHERE message ILIKE '%redshift%';
Run these after DISCONNECT; while connected, they go to Redshift.
DuckDB's own query log records each statement as written, including
any key in the SQL, so check the log before you share it.
Redshift records each connection's application name as
duckdb_redshift/,
which extension-version duckdb/duckdb-version platformSYS_CONNECTION_LOG records. Match it with LIKE
'duckdb_redshift/%'. Reading SYS_CONNECTION_LOG needs permission
to read the view, which a newly mapped IAM database user doesn't have. On Amazon Redshift Serverless with express configuration, reading
SYS_CONNECTION_LOG needs a role association for
sys:operator, sys:dba, or sys:superuser. For more information, see Data access and permissions.