ETLMCPData Conveyance Works
Log in Start free
Docs

PostgreSQL destination errors

What each PostgreSQL destination error from etlmcp means, whether the run is tried again by itself, and what to change on your server or table.

A PostgreSQL destination error tells you which side has to change: the address, the login, or the table. host not allowed means etlmcp would not connect to the host you gave, because it is private, malformed or does not resolve. could not connect: authentication failed means the server turned the login away, and could not connect: database does not exist means the database name is wrong. table {…}.{…} is missing columns: {…} and column name too long (max {…}): {…} mean the table and the rows do not fit together. None of these clears up by waiting, so etlmcp does not try them again: fix the setting and run the pipeline again.

The same messages appear in two places. The Test button on the destinations page shows the message instead of a success line, and a run that fails while delivering records the message as the run's error.

Errors at a glance

Message What it means Tried again by itself
host not allowed The host is private, malformed or cannot be looked up No
could not connect: authentication failed The server refused the user or the password No
could not connect: database does not exist No database by that name on that server No
could not connect: {…} Any other connection failure, with the server's or driver's first line Yes
table {…}.{…} was not created by etlmcp; choose a new table name The table exists and has no _etlmcp_pipeline_id column No
table {…}.{…} is missing columns: {…} The existing table lacks columns the rows carry No
column name too long (max {…}): {…} A column name is longer than PostgreSQL keeps No
column name {…} is reserved Your rows carry a column named _etlmcp_pipeline_id No
rows contain an invalid date value A date value is not a date No
the database did not answer in time The whole test or load ran past etlmcp's time limit Yes
database error: {…} The server refused a statement; the text is its own first line For dropped connections and statement time limits

A run that is tried again gets 3 attempts in all, as the retries page describes.

host not allowed

Before every connection, etlmcp looks the host up and checks each address it gets back. The message appears when any of those addresses is not on the public internet, such as a private network range, loopback, link-local or shared carrier space. It also appears when:

  • the hostname does not resolve, often a typo or a record that has not spread yet;
  • the field holds more than a bare name or address, such as db.example.com:5432, a user@ part, a slash or a space;
  • the address is a numeric shorthand such as a single decimal number or a hex form, which resolvers read in different ways; of the numeric IPv4 forms, only an ordinary four-part dotted address passes.

Put the port in the Port field, not after the host. A server that only has a private address, such as one inside a cloud network, needs a public address or a public endpoint before etlmcp can reach it. If your firewall admits connections by address, the destinations page shows the address etlmcp connects from, when the server has one set.

Login and database errors

etlmcp reads the SQLSTATE code PostgreSQL sends with a failed connection. PostgreSQL's error code appendix lists 28P01 as invalid_password and 28000 as invalid_authorization_specification; either one becomes could not connect: authentication failed. Code 3D000, invalid_catalog_name, becomes could not connect: database does not exist. When the driver gives no code, which is common for connection failures, etlmcp reads the server's text for the same two cases.

For a login failure, check the user name and type the password again. If you changed the host, the port or the user, you have to enter the password again anyway. For a missing database, compare the Database field, letter for letter, with the database names on the server, and check that the host is the server you meant.

Every other connection failure, such as a refused port, a server that is down or a server that will not accept an encrypted connection, comes through as could not connect: {…} followed by the first line of what the driver reported, with your password removed. etlmcp treats these as failures that can pass and tries the run again.

Table errors

etlmcp only writes to a table that carries its own _etlmcp_pipeline_id column. If the name you gave already belongs to a table someone else made, you get table {…}.{…} was not created by etlmcp; choose a new table name. Enter a new table name and let etlmcp create it.

On a table it did create, etlmcp adds new extra. columns as platforms send them. It also tries to add the columns your transform rules make and an id column; when it may not, it leaves those columns out of the load instead of failing. For any other column it does not alter the table, so table {…}.{…} is missing columns: {…} names the columns the rows have and the table lacks, listing the first few and counting the rest. A column dropped by hand is one way to get there. The same message names extra. columns when the login may not alter the table, for example because it does not own it. To fix it, add the named columns yourself (date for the date, double precision for metrics, text for the rest), grant the login ownership, or switch to a new table name.

PostgreSQL's lexical structure chapter says a standard build keeps at most 63 bytes of a name and cuts longer ones short. etlmcp checks names against that default. etlmcp shortens a long extra. name for you by keeping its start and adding a short hash, the same one on every run. When etlmcp creates the table, any other column longer than that stops the load with column name too long (max {…}): {…}, followed by the start of the name. On a table that already exists, a column your rules make with a name that long is left out of the load instead. Give the rule's output column a shorter name; see also the transform errors page. A rule that creates a column called _etlmcp_pipeline_id fails with column name _etlmcp_pipeline_id is reserved and needs another name.

rows contain an invalid date value means a row's date could not be read as a date, for example after a rule rewrote it. When testing an existing etlmcp table, table {…}.{…} has none of the expected columns means the table shares no column with the sample row the test writes.

Timeouts and statement errors

etlmcp limits how long a whole test or load may take. When that limit runs out you see the database did not answer in time, and the run is tried again. etlmcp also limits how long it waits to connect and how long each statement may run: a slow connection shows as could not connect: {…}, and a statement cut off by the server shows as database error: {…}, and both are tried again.

database error: {…} carries the first line of PostgreSQL's own message for a refused statement, with secrets removed. A dropped connection in the middle of a load is tried again; a refusal such as a missing permission is not. The setup page lists what the login needs.

Related

Sources

  1. Appendix A. PostgreSQL Error Codes — www.postgresql.org, checked
  2. 4.1. Lexical Structure — www.postgresql.org, checked