Skip to content

Reference

Troubleshooting

Common errors from plan and load, what they mean, and the fix for each.

Most problems show up in sqlload plan, under Errors, with the fix. These are the common ones.

Message Fix
error: environment variable PGPASSWORD is not set Set the variable a ${ENV:NAME} in sqlload.toml names.
load_method is required: how should data get into Snowflake? Add a load_method to the Snowflake connection. See Snowflake.
n_free: numeric without a precision has no fixed scale; pin a type such as "decimal(38,10)" or "text" Pin the column in columns, such as columns = { n_free = "decimal(38,18)" }.
columns "total" is not a column of the source table (names are case-sensitive); did you mean "email"? Fix the name, or move the entry to the right table.
total has type numeric(12,2), which cannot be read as int Pin a type the column can be read as: usually the same or wider.
public.events (kind = "postgres"): no write_strategy is set on the table or its source, and SQLLoad doesn't choose one Add the line the error shows. See Write strategies.
write_strategy = "merge" needs a unique_key: the key columns, such as unique_key = ["id"], or unique_key = "{primary_key}" ... Set unique_key as the message shows.
items (kind = "odbc"): unique_key = "{primary_key}", but the source reports no primary key for the table. ... Name the key columns. If the error adds that INFORMATION_SCHEMA lists a key, see MariaDB Connector/ODBC 3.1.
cannot connect to Postgres at ... under [sources.NAME] The source’s server is unreachable. Commands that don’t select it still run.
Python source shop uses connection wh, which target dev loads into Give the Python source its own connection.
Python table orders is declared twice (...); table names are unique across the project Rename one, or pass name= to the decorator.
Message Fix
write_strategy = "replace" reloads the whole table, so it takes no cursor_column Remove cursor_column, or choose merge, delete_insert or append.
lookback re-inserts the window on every run with append; use delete_insert (no key needed) or merge Change the strategy, or drop lookback.
write_strategy = "append" cannot follow the date cursor visit_day: ... Use delete_insert or merge. See append.
append_cursor_inclusive = true reads from the maximum order_id itself, so every run appends the rows at that value again ... A warning. Leave append_cursor_inclusive unset.
merge needs a table format to update rows in place; a files target takes append, replace or delete_insert Use one of those on a files target.
... was rewritten in place since it was loaded ...; load it again with --reload, or use delete_insert on a partition cursor A source file changed after append loaded it. Do as the message says.
--reload rebuilds ... confirm it in a terminal, or add --yes Add --yes when running without a terminal.
the function returned 24 rows outside the window it was asked for, ... A Python table’s function returned rows its window doesn’t hold; the message names the fix. See Rows outside the window.
Message Fix
an ODBC fetch may hold 954 MiB, more than the 176 MiB a fetch gets of each table's 703 MiB share of the memory budget; ... A warning. Lower max_batch_memory on the source, or raise memory_limit. See Memory.
the 600 MiB memory budget leaves the tables 11.7 MiB after DuckDB's 488 MiB, under the 64 MiB one table loads in; raise memory_limit to at least 653MiB Raise memory_limit, or pass --memory-limit. See Memory budget.
attachments: the rows of one k value hold 300 MiB of values over 85 KiB, which a delete_insert replaces in one commit, ...; raise memory_limit to at least 23.5GiB Raise memory_limit as named, or choose a finer replace_key. See Large rows in DuckDB.
documents: its last row group would hold 366 MiB of strings, ... Raise memory_limit as named. See Large rows in DuckDB.
raw.attachments stopped: the load held 1 GiB of its 1.1 GiB memory budget (91%); ... The watchdog stopped the table at 90% of the budget. Raise memory_limit, or lower batch_size or concurrency.
stopped: the run held 1.1 GiB of its 1.1 GiB memory budget (96%), and from 95% it stops as no table held large values to stop; ... The watchdog stopped the run (exit 1, not retryable). Raise memory_limit, or lower concurrency.
column body holds a value of 9000 bytes, longer than max_text_size = 8000; ... Raise or remove max_text_size on the ODBC source. See Value sizes.

See TLS.

Message Fix
[sources.app] reads legacy-db.example.com:5432 in plain text: ... A warning: the server has no TLS, so sslmode = "prefer" fell back. Enable TLS and set sslmode = "verify-full", or accept it with sslmode = "disable".
error performing TLS handshake: invalid peer certificate: UnknownIssuer Set sslrootcert to the CA that signed the server’s certificate.
invalid peer certificate: certificate not valid for name "..." Connect with a host name the certificate lists.
error performing TLS handshake: server does not support TLS sslmode requires TLS, which the server lacks. Enable it on the server, or lower sslmode.
sslcert and sslkey must be set together Set both, or neither.
Message Fix
Postgres query failed: permission denied for database postgres (SQLSTATE 42501) The user can’t create the publication. Create it as the tables’ owner and set publication. See Requirements.
tags: kind = "postgres_cdc" streams text[] values as the source wrote them ...; pin it with columns = { tags = "text" }, or exclude it Pin array and json columns to text. See Postgres changes.
slot sqlload_app is gone ... or slot sqlload_app lost WAL it had not confirmed ... Run sqlload load --resnapshot. See The slot and WAL.
column tier of app__customers was added with a default ... or ... now loads column region, which the table already had at its snapshot ... Run sqlload load --resnapshot. See Schema changes.
publication app_changes does not publish "public"."refunds"; add them with ALTER PUBLICATION ... Add the table to the publication, as the tables’ owner. See Adding tables.
rows captured before slot sqlload_app was recreated are still in app__refunds ... Run sqlload load --resnapshot, or drop the destination table and run sqlload apply. See Adding tables.
a files target takes kind = "postgres_cdc" only with cdc_mode = "changelog" ... Set cdc_mode = "changelog". See Into Parquet files.
a postgres_cdc table is copied again with --resnapshot, not --reload Use --resnapshot for captured tables, and --exclude the source to reload the rest. See Reloading.
[sources.app] batch_interval must be at least 1s ... Set batch_interval to 1s or more.
load --follow follows one postgres_cdc source and nothing else; ... Load the other tables without --follow, or --exclude them.
load --follow did not start: it follows only when every selected source and table plans ... Fix the errors listed above it, or leave those tables out. See Keep streaming.
source app does not follow while app__orders is blocked: its tables share one slot ... Select the whole source, not some of its tables.
following stopped: planning again after ... found errors ... A table stopped planning, such as one that lost its primary key. Fix or exclude it, and load again; no unwritten change was confirmed.
  • It doesn’t match include, or matches exclude.
  • It has a column matching skip_tables_with_columns; plan lists it under Skipped.
  • It appeared after the source’s first load, and new_tables = "skip". Name it exactly in include.

Warnings in plan name routes much slower than usual, such as copy_to_internal_stage, hmac-masked files or load_method = { type = "insert" }. Files into Snowflake load fastest from an external stage over their bucket. See Load methods. On an ODBC source, the fetch line says when a table is read value by value, which is slower; see Memory.

Finding a source that uses too much memory

Section titled “Finding a source that uses too much memory”

Every load reports its peak memory. To find the table behind it on Linux, --memory-per-table loads one table at a time and gives each one’s peak:

$ sqlload load --memory-per-table
…
loaded raw.customers 500 rows 0.0s peak memory 79.8 MiB
loaded raw.orders 2,000,000 rows 8.5s peak memory 245 MiB
…

Each figure includes what the process already held, so compare tables within one run. On macOS and Windows, load each table on its own (sqlload load TABLE). Then:

  • Lower concurrency, or pass --concurrency.
  • Set a smaller batch_size on a cursor table.
  • On an ODBC source, lower max_batch_memory, or lower long_column_threshold so wide columns of short values are read value by value (slower).

A cursor table without an ordered read commits once for the whole read. Set batch_size (such as "1d") with cursor_start so it commits window by window. ClickHouse publishes a delete_insert, append or merge once per run (a merge also every 10 million rows): split a long first load into runs with --end-cursor. See Batches.

sqlload load --reload --yes TABLE rebuilds it from the whole source. Dropping the destination table also works, except on a state="logged" table, whose position stays in the run log. A postgres_cdc table starts over with sqlload load --resnapshot; see Re-snapshot.

--log-format json writes structured logs to standard error. sqlload plan --json prints the plan as one JSON document.