Self-hosted Error AWS>Fargate>Cloudformation>RetoolECSservice

Hi! Trying to follow instructions here

I followed the advice on creating a separate RDS and editing the fargate.yaml
Specifically added in both RetoolTask and RetoolJobsRunnerTask the following:
- Name: POSTGRES_PORT
Value: "5432"
- Name: POSTGRES_HOST
Value: "..us-.rds.amazonaws.com"
- Name: POSTGRES_DB
Value: "db-retool"
- Name: POSTGRES_USER
Value: ""
- Name: POSTGRES_PASSWORD
Value: "
_"

now I get this error as it tries to go through creating the stack:
CREATE_FAILED for the RetoolECSService with description: "resource handleer returned message: "Exceeded attempts to wait".

Upon digging deeper, the error comes from the EC2's Service's Tasks that keep trying to run and failing. They seem to be not being able to find the db-retool RDS database(?). Everything is in same VPC (there's only one) and subnets.

What should I try/do next?

The log of the tasks below:

April 30, 2025 at 18:37 (UTC+3:00)

Node.js v18.20.4

retool

April 30, 2025 at 18:37 (UTC+3:00)

/retool_backend/node_modules/.pnpm/sequelize@6.31.0_patch_hash=dk6qy5gyzbjysuc4vxu23jnkrm_mysql2@2.3.3_oracledb@5.3.0_snowflake-_geltwdb3fqjepyd2eep3x2qxtu/node_modules/sequelize/lib/dialects/postgres/connection-manager.js:146

retool

April 30, 2025 at 18:37 (UTC+3:00)

reject(new sequelizeErrors.ConnectionError(err));

retool

April 30, 2025 at 18:37 (UTC+3:00)

^

retool

April 30, 2025 at 18:37 (UTC+3:00)

ConnectionError [SequelizeConnectionError]: database "db-retool" does not exist

retool

April 30, 2025 at 18:37 (UTC+3:00)

at Client._connectionCallback (/retool_backend/node_modules/.pnpm/sequelize@6.31.0_patch_hash=dk6qy5gyzbjysuc4vxu23jnkrm_mysql2@2.3.3_oracledb@5.3.0_snowflake-_geltwdb3fqjepyd2eep3x2qxtu/node_modules/sequelize/lib/dialects/postgres/connection-manager.js:146:24)

retool

April 30, 2025 at 18:37 (UTC+3:00)

at Client._handleErrorWhileConnecting (/retool_backend/node_modules/.pnpm/pg@8.11.3_patch_hash=5z2kru6wp55sob2v2ec4ejgszq/node_modules/pg/lib/client.js:364:19)

retool

April 30, 2025 at 18:37 (UTC+3:00)

at Client._handleErrorMessage (/retool_backend/node_modules/.pnpm/pg@8.11.3_patch_hash=5z2kru6wp55sob2v2ec4ejgszq/node_modules/pg/lib/client.js:384:19)

retool

April 30, 2025 at 18:37 (UTC+3:00)

at Connection.emit (node:events:517:28)

retool

April 30, 2025 at 18:37 (UTC+3:00)

at Connection.emit (node:domain:489:12)

retool

April 30, 2025 at 18:37 (UTC+3:00)

at /retool_backend/node_modules/.pnpm/pg@8.11.3_patch_hash=5z2kru6wp55sob2v2ec4ejgszq/node_modules/pg/lib/connection.js:117:12

retool

April 30, 2025 at 18:37 (UTC+3:00)

at Parser.parse (/retool_backend/node_modules/.pnpm/pg-protocol@1.6.0_patch_hash=bc532sl7pnvzzwfziu2qpbx674/node_modules/pg-protocol/dist/parser.js:40:17)

retool

April 30, 2025 at 18:37 (UTC+3:00)

at TLSSocket. (/retool_backend/node_modules/.pnpm/pg-protocol@1.6.0_patch_hash=bc532sl7pnvzzwfziu2qpbx674/node_modules/pg-protocol/dist/index.js:11:42)

retool

April 30, 2025 at 18:37 (UTC+3:00)

at TLSSocket.emit (node:events:517:28)

retool

April 30, 2025 at 18:37 (UTC+3:00)

at TLSSocket.emit (node:domain:489:12) {

retool

April 30, 2025 at 18:37 (UTC+3:00)

parent: error: database "db-retool" does not exist

retool

April 30, 2025 at 18:37 (UTC+3:00)

at Parser.parseErrorMessage (/retool_backend/node_modules/.pnpm/pg-protocol@1.6.0_patch_hash=bc532sl7pnvzzwfziu2qpbx674/node_modules/pg-protocol/dist/parser.js:294:98)

retool

April 30, 2025 at 18:37 (UTC+3:00)

at Parser.handlePacket (/retool_backend/node_modules/.pnpm/pg-protocol@1.6.0_patch_hash=bc532sl7pnvzzwfziu2qpbx674/node_modules/pg-protocol/dist/parser.js:126:29)

retool

April 30, 2025 at 18:37 (UTC+3:00)

at Parser.parse (/retool_backend/node_modules/.pnpm/pg-protocol@1.6.0_patch_hash=bc532sl7pnvzzwfziu2qpbx674/node_modules/pg-protocol/dist/parser.js:39:38)

retool

April 30, 2025 at 18:37 (UTC+3:00)

at TLSSocket. (/retool_backend/node_modules/.pnpm/pg-protocol@1.6.0_patch_hash=bc532sl7pnvzzwfziu2qpbx674/node_modules/pg-protocol/dist/index.js:11:42)

retool

April 30, 2025 at 18:37 (UTC+3:00)

at TLSSocket.emit (node:events:517:28)

retool

April 30, 2025 at 18:37 (UTC+3:00)

at TLSSocket.emit (node:domain:489:12)

retool

April 30, 2025 at 18:37 (UTC+3:00)

at addChunk (node:internal/streams/readable:368:12)

retool

April 30, 2025 at 18:37 (UTC+3:00)

at readableAddChunk (node:internal/streams/readable:341:9)

retool

April 30, 2025 at 18:37 (UTC+3:00)

at Readable.push (node:internal/streams/readable:278:10)

retool

April 30, 2025 at 18:37 (UTC+3:00)

at TLSWrap.onStreamRead (node:internal/stream_base_commons:190:23) {

retool

April 30, 2025 at 18:37 (UTC+3:00)

length: 95,

retool

April 30, 2025 at 18:37 (UTC+3:00)

severity: 'FATAL',

retool

April 30, 2025 at 18:37 (UTC+3:00)

code: '3D000',

retool

April 30, 2025 at 18:37 (UTC+3:00)

detail: undefined,

retool

April 30, 2025 at 18:37 (UTC+3:00)

hint: undefined,

retool

April 30, 2025 at 18:37 (UTC+3:00)

position: undefined,

retool

April 30, 2025 at 18:37 (UTC+3:00)

internalPosition: undefined,

retool

April 30, 2025 at 18:37 (UTC+3:00)

internalQuery: undefined,

retool

April 30, 2025 at 18:37 (UTC+3:00)

where: undefined,

retool

April 30, 2025 at 18:37 (UTC+3:00)

schema: undefined,

retool

April 30, 2025 at 18:37 (UTC+3:00)

table: undefined,

retool

April 30, 2025 at 18:37 (UTC+3:00)

column: undefined,

retool

April 30, 2025 at 18:37 (UTC+3:00)

dataType: undefined,

retool

April 30, 2025 at 18:37 (UTC+3:00)

constraint: undefined,

retool

April 30, 2025 at 18:37 (UTC+3:00)

file: 'postinit.c',

retool

April 30, 2025 at 18:37 (UTC+3:00)

line: '1090',

retool

April 30, 2025 at 18:37 (UTC+3:00)

routine: 'InitPostgres'

retool

April 30, 2025 at 18:37 (UTC+3:00)

},

retool

April 30, 2025 at 18:37 (UTC+3:00)

original: error: database "db-retool" does not exist

retool

April 30, 2025 at 18:37 (UTC+3:00)

at Parser.parseErrorMessage (/retool_backend/node_modules/.pnpm/pg-protocol@1.6.0_patch_hash=bc532sl7pnvzzwfziu2qpbx674/node_modules/pg-protocol/dist/parser.js:294:98)

retool

April 30, 2025 at 18:37 (UTC+3:00)

at Parser.handlePacket (/retool_backend/node_modules/.pnpm/pg-protocol@1.6.0_patch_hash=bc532sl7pnvzzwfziu2qpbx674/node_modules/pg-protocol/dist/parser.js:126:29)

retool

April 30, 2025 at 18:37 (UTC+3:00)

at Parser.parse (/retool_backend/node_modules/.pnpm/pg-protocol@1.6.0_patch_hash=bc532sl7pnvzzwfziu2qpbx674/node_modules/pg-protocol/dist/parser.js:39:38)

retool

April 30, 2025 at 18:37 (UTC+3:00)

at TLSSocket. (/retool_backend/node_modules/.pnpm/pg-protocol@1.6.0_patch_hash=bc532sl7pnvzzwfziu2qpbx674/node_modules/pg-protocol/dist/index.js:11:42)

retool

April 30, 2025 at 18:37 (UTC+3:00)

at TLSSocket.emit (node:events:517:28)

retool

April 30, 2025 at 18:37 (UTC+3:00)

at TLSSocket.emit (node:domain:489:12)

retool

April 30, 2025 at 18:37 (UTC+3:00)

at addChunk (node:internal/streams/readable:368:12)

retool

April 30, 2025 at 18:37 (UTC+3:00)

at readableAddChunk (node:internal/streams/readable:341:9)

retool

April 30, 2025 at 18:37 (UTC+3:00)

at Readable.push (node:internal/streams/readable:278:10)

retool

April 30, 2025 at 18:37 (UTC+3:00)

at TLSWrap.onStreamRead (node:internal/stream_base_commons:190:23) {

retool

April 30, 2025 at 18:37 (UTC+3:00)

length: 95,

retool

April 30, 2025 at 18:37 (UTC+3:00)

severity: 'FATAL',

retool

April 30, 2025 at 18:37 (UTC+3:00)

code: '3D000',

retool

April 30, 2025 at 18:37 (UTC+3:00)

detail: undefined,

retool

April 30, 2025 at 18:37 (UTC+3:00)

hint: undefined,

retool

April 30, 2025 at 18:37 (UTC+3:00)

position: undefined,

retool

April 30, 2025 at 18:37 (UTC+3:00)

internalPosition: undefined,

retool

April 30, 2025 at 18:37 (UTC+3:00)

internalQuery: undefined,

retool

April 30, 2025 at 18:37 (UTC+3:00)

where: undefined,

retool

April 30, 2025 at 18:37 (UTC+3:00)

schema: undefined,

retool

April 30, 2025 at 18:37 (UTC+3:00)

table: undefined,

retool

April 30, 2025 at 18:37 (UTC+3:00)

column: undefined,

retool

April 30, 2025 at 18:37 (UTC+3:00)

dataType: undefined,

retool

April 30, 2025 at 18:37 (UTC+3:00)

constraint: undefined,

retool

April 30, 2025 at 18:37 (UTC+3:00)

file: 'postinit.c',

retool

April 30, 2025 at 18:37 (UTC+3:00)

line: '1090',

retool

April 30, 2025 at 18:37 (UTC+3:00)

routine: 'InitPostgres'

retool

April 30, 2025 at 18:37 (UTC+3:00)

}

retool

April 30, 2025 at 18:37 (UTC+3:00)

}

retool

April 30, 2025 at 18:37 (UTC+3:00)

Failing checking database migrations

retool

April 30, 2025 at 18:37 (UTC+3:00)

{"timestamp":"2025-04-30T08:37:35.186-07:00","@version":"1.0.0","message":"No active profile set, falling back to 1 default profile: "default"","logger_name":"com.retool.dbconnector.DbConnectorApplication","pid":"main","level":"INFO","level_value":20000}

retool

April 30, 2025 at 18:37 (UTC+3:00)

{"timestamp":"2025-04-30T08:37:35.184-07:00","@version":"1.0.0","message":"Starting DbConnectorApplication v3.148.8-SNAPSHOT using Java 17.0.13 with PID 31 (/retool_backend/java_dbconnector/libs/dbconnector.jar started by retool_user in /retool_backend)","logger_name":"com.retool.dbconnector.DbConnectorApplication","pid":"main","level":"INFO","level_value":20000}

retool

April 30, 2025 at 18:37 (UTC+3:00)

{"timestamp":"2025-04-30T08:37:34.888-07:00","@version":"1.0.0","message":"HV000001: Hibernate Validator null","logger_name":"org.hibernate.validator.internal.util.Version","pid":"background-preinit","level":"INFO","level_value":20000}

retool

April 30, 2025 at 18:37 (UTC+3:00)

(node:32) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.

retool

April 30, 2025 at 18:37 (UTC+3:00)

(Use node --trace-deprecation ... to show where the warning was created)

retool

April 30, 2025 at 18:37 (UTC+3:00)

{"level":"info","message":"[process service types] MAIN_BACKEND, DB_CONNECTOR, DB_SSH_CONNECTOR","timestamp":"2025-04-30T15:37:33.670Z"}

retool

April 30, 2025 at 18:37 (UTC+3:00)

Warning: POSTGRES_SSL_REJECT_UNAUTHORIZED is currently set to 'false'. This will default to 'true' in a future version of Retool, which may break connections to databases with self-signed SSL/TLS certificates. To prepare for this change, either explicitly set POSTGRES_SSL_REJECT_UNAUTHORIZED=false or configure a custom certificate chain by setting POSTGRES_CUSTOM_SSL_CERT_PATH & POSTGRES_CUSTOM_SSL_CA_FILE_NAME (and optionally POSTGRES_CUSTOM_SSL_CERT_FILE_NAME & POSTGRES_CUSTOM_SSL_KEY_FILE_NAME) — see Environment variables reference | Retool Docs.

retool

April 30, 2025 at 18:37 (UTC+3:00)

{"level":"info","message":"Not configuring StatsD...","timestamp":"2025-04-30T15:37:30.963Z"}

retool

April 30, 2025 at 18:37 (UTC+3:00)

Standard Commons Logging discovery in action with spring-jcl: please remove commons-logging.jar from classpath in order to avoid potential conflicts

retool

April 30, 2025 at 18:37 (UTC+3:00)

Java dbconnector started on port 3007 with pid 31

retool

April 30, 2025 at 18:37 (UTC+3:00)

sed: can't read ./dist/**/*.html: No such file or directory

retool

April 30, 2025 at 18:37 (UTC+3:00)

sed: can't read ./dist/*.js: No such file or directory

retool

Following up, would you be able to update the fargate.yaml and the Deploy Self-hosted Retool on AWS Fargate and ECS with CloudFormation | Retool Docs instructions please?

e.g. the current fargate.yaml does not work unless you update the RDS engine in the yaml to higher than what it is now.

Also, would you be able to provide the template (and before that, test it yourself that it works) on using an external database? It literally refuses to work despite following all your advice to the letter.

Thank you!!! :slight_smile:

1 Like

Thanks for following up here, @Ori! I can definitely work on getting those templates updated and verifying the necessary environment variables for configuring an external database.