Api_1 can not establish connection to postgres DB

Hi! I'm trying to install the latest version of retool (Self-Hosted) on an ubuntu machine.
When following the steps in Deploy Self-hosted Retool with Docker Compose, I get the following error printed to the console from the api_1 container:

Failing checking database migrations
api_1                | /node_modules/sequelize/lib/dialects/postgres/connection-manager.js:143
api_1                |                 reject(new sequelizeErrors.ConnectionError(err));
api_1                |                        ^
api_1                | 
api_1                | ConnectionError [SequelizeConnectionError]: password authentication failed for user "retool_internal_user"
api_1                |     at Client._connectionCallback (/node_modules/sequelize/lib/dialects/postgres/connection-manager.js:143:24)
api_1                |     at Client._handleErrorWhileConnecting (/node_modules/pg/lib/client.js:305:19)
api_1                |     at Client._handleErrorMessage (/node_modules/pg/lib/client.js:325:19)
api_1                |     at Connection.emit (node:events:514:28)
api_1                |     at /node_modules/pg/lib/connection.js:114:12
api_1                |     at Parser.parse (/node_modules/pg-protocol/dist/parser.js:40:17)
api_1                |     at Socket.<anonymous> (/node_modules/pg-protocol/dist/index.js:11:42)
api_1                |     at Socket.emit (node:events:514:28)
api_1                |     at addChunk (node:internal/streams/readable:324:12)
api_1                |     at readableAddChunk (node:internal/streams/readable:297:9) {
api_1                |   parent: error: password authentication failed for user "retool_internal_user"
api_1                |       at Parser.parseErrorMessage (/node_modules/pg-protocol/dist/parser.js:287:98)
api_1                |       at Parser.handlePacket (/node_modules/pg-protocol/dist/parser.js:126:29)
api_1                |       at Parser.parse (/node_modules/pg-protocol/dist/parser.js:39:38)
api_1                |       at Socket.<anonymous> (/node_modules/pg-protocol/dist/index.js:11:42)
api_1                |       at Socket.emit (node:events:514:28)
api_1                |       at addChunk (node:internal/streams/readable:324:12)
api_1                |       at readableAddChunk (node:internal/streams/readable:297:9)
api_1                |       at Readable.push (node:internal/streams/readable:234:10)
api_1                |       at TCP.onStreamRead (node:internal/stream_base_commons:190:23) {
api_1                |     length: 116,
api_1                |     severity: 'FATAL',
api_1                |     code: '28P01',
api_1                |     detail: undefined,
api_1                |     hint: undefined,
api_1                |     position: undefined,
api_1                |     internalPosition: undefined,
api_1                |     internalQuery: undefined,
api_1                |     where: undefined,
api_1                |     schema: undefined,
api_1                |     table: undefined,
api_1                |     column: undefined,
api_1                |     dataType: undefined,
api_1                |     constraint: undefined,
api_1                |     file: 'auth.c',
api_1                |     line: '337',
api_1                |     routine: 'auth_failed'
api_1                |   }

We need this running for a demo tomorrow. Can someone help?

Hey, @mb21. Did you run the ./install script again to install the newer version, or did you update the instance? If you ran the install script, you are likely running into the same issues as described in this topic.

Thank you @joeBumbaca .
I've removed all docker volumes and confirmed that the system is in a fresh state, before starting a second attempt.

This time, the jobs-runner_1 exited with the following error message:

root@srvubuntu-docker:/docker/retool-onpremise-master# docker logs retool-onpremise-master_jobs-runner_1
wait-for-it.sh: waiting 15 seconds for postgres:5432
wait-for-it.sh: postgres:5432 is available after 5 seconds
not untarring the bundle
sed: can't read ./dist/mobile/*.js: No such file or directory
{"level":"info","message":"[process service types] JOBS_RUNNER","timestamp":"2023-12-01T10:36:55.822Z"}
Failing checking database migrations

---------------------------
-     EXITING RETOOL      -
---------------------------

Error running database migrations: SequelizeUniqueConstraintError: Validation error

What can I do to fix this error?
I'm (trying to) run the :latest retool version.
On my local Mac, the deployment went smoothly with the same version. I'm using the same license key locally. Could this have caused the issue?

Hey @mb21, if you are using a self service key (ie: starts with SSOP) then it's possible as those keys are not intended to be used in multiple deployments.

Though this error
Error running database migrations: SequelizeUniqueConstraintError: Validation error doesn't appear to be key related. Were there any more logs for that error? There is usually a bit more of a description from Sequelize as to what failed.

@joeBumbaca thanks for your reply. You can mark the issue as resolved.

The database had issues starting up, which caused this second issue.
A docker-compose up solved it.

The initial issue had been caused by deprecated data in the mounted volumes from an earlier installation attempt. Deleting the data in all mounted volumes solved the issue.

Have a good day!

1 Like