Skip to contentSkip to navigationSkip to topbar
Page tools
Useful for sharing or LLM
Accelerate development with AI

On this page
Looking for more inspiration?Visit the

Warehouse Errors


This page lists common errors you might encounter when syncing data to your Segment warehouse, along with their causes and how to resolve them.


ERROR: Schema "XXX" does not exist. (SQLSTATE 3F000)

error-schema-xxx-does-not-exist-sqlstate-3f000 page anchor

This is a permissioning issue. To learn how to set up proper permissions, see the Postgres and Redshift guides.


ERROR: Cannot execute query because system is in resize mode (SQLSTATE 57014)

error-cannot-execute-query-because-system-is-in-resize-mode-sqlstate-57014 page anchor

This error occurs when your cluster is resizing. The warehouse continues on its scheduled run interval. Once the resize completes, Segment loads all data from the failed run.


ERROR: 1040 (SQLSTATE XX000)

error-1040-sqlstate-xx000 page anchor

This is a Redshift 500 - an internal server error. This is usually caused by having too many tables or too many columns. See Column limits for the maximum columns per table. If you're seeing this error, contact the Segment Support team(link takes you to an external page).


read tcp XXX.XX.XX.XXXX:XXXX-XXX.XX.XX.XXXX:XXXX: read: connection timed out

read-tcp-xxxxxxxxxxxxxxx-xxxxxxxxxxxxxxx-read-connection-timed-out page anchor

This is a networking error that typically arises when Redshift doesn't close properly close the connection or gets rebooted.

If you see this error on consecutive syncs, contact the Segment Support team(link takes you to an external page).


pq: role "XXX" is not permitted to log in

pq-role-xxx-is-not-permitted-to-log-in page anchor

This is a permissioning issue. To learn how to set up proper permissions, see the Postgres and Redshift guides.


pq: password authentication failed for user "XXX";

pq-password-authentication-failed-for-user-xxx page anchor

This is a credential issue. To fix your credentials, head over to Warehouse > Settings > Connection.


dial tcp: lookup XXX-hostname on 10.50.0.2:53: no such host

dial-tcp-lookup-xxx-hostname-on-10500253-no-such-host page anchor

This is a credential issue. To fix your credentials, head over to Warehouse > Settings > Connection.


dial tcp XX.XXX.XXX.XXX:XXXX: getsockopt: connection timed out / refused

dial-tcp-xxxxxxxxxxxxxxx-getsockopt-connection-timed-out--refused page anchor

This is a networking error. The connection times out because Redshift doesn't close properly or gets rebooted.

If you see this error on consecutive syncs, contact the Segment Support team(link takes you to an external page).


ERROR: syntax error at or near "ENCODE"; (SQLSTATE 42601)

error-syntax-error-at-or-near-encode-sqlstate-42601 page anchor

This occurs when a Postgres database is incorrectly connected as Redshift. To resolve this, delete the warehouse and reconnect, using the Postgres set up option.


Error during deduping step for collectionXXX: EOF

error-during-deduping-step-for-collectionxxx-eof page anchor

This error is generally a network error when Redshift closes the connection. If the problem persists on multiple runs, contact the Segment Support team(link takes you to an external page).


ERROR: permission denied for relation update (SQLSTATE 42501)

error-permission-denied-for-relation-update-sqlstate-42501 page anchor

This is a permissioning issue. To learn how to set up proper permissions, see the Postgres and Redshift guides.


This error is generally a network error when Redshift closes the connection. If the problem persists on multiple runs, contact the Segment Support team(link takes you to an external page).


ERROR: failed to create table: 002318 (42601): SQL compilation error: invalid column definition name "XXX" (ANSI reserved)

error-failed-to-create-table-002318-42601-sql-compilation-error-invalid-column-definition-name-xxx-ansi-reserved page anchor

This error indicates that a column that is attempting to sync has the same title as a reserved keyword in Snowflake. More information regarding Snowflake's reserved keywords can be found in Snowflake's docs(link takes you to an external page).


Most warehouses limit the number of columns that a table can have or that a single load can write. Segment creates a column for each property in a collection, so a collection with many unique or dynamically generated property names can exceed the limit. When a collection exceeds the limit, Segment can't load data into it and the sync reports an error for that collection.

WarehouseColumn limit
Redshift1,600 per table
Postgres1,600 per table
BigQuery10,000 per table
Snowflake4,096 per load. See Snowflake below for more information.
DatabricksNo published limit
Azure Synapse Analytics1,024 per table

Properties you disable with Selective Sync aren't loaded, so disabling unused properties reduces the number of columns in the collection.

Snowflake

snowflake page anchor

Snowflake doesn't have a hard limit on the number of columns in a table, but it does limit the number of columns a single load can write. Segment loads data with Snowflake's COPY INTO command, which can write at most 4,096 columns in a single query. Segment loads every enabled column in a collection on each sync, whether or not the events in that sync include it, so the number of enabled columns in the collection is what counts. When a collection has more than 4,096 enabled columns, the sync fails with this error:

SQL compilation error: column '$4097' does not exist

Snowflake can also reject new columns with this error:

Operation failed because soft limit on objects of type 'Column' per table was exceeded.

To resolve either error, reduce the number of columns in the collection. See Reduce the number of columns.

Reduce the number of columns

reduce-the-number-of-columns page anchor

To bring a collection under its limit:

  • Find properties with dynamically generated names, such as IDs or timestamps used as property keys, and send those values as property values instead.
  • Disable properties you don't need in the warehouse with Selective Sync.

If you still see the error after reducing the columns, contact the Segment Support team(link takes you to an external page).