Self-hosted app can't run query with a resource

On my self-hosted retool:
I have a REST API resource defined. Then I tried to create a query in my app using this REST resource. The query failed because

request to http://db-connector:3002/api/runQuery failed, reason: connect ECONNREFUSED 172.22.0.3:3002

This is my machine confirguration:

  • Mac OS Monterey v12.0.1 with M1 chip
  • Docker Desktop version 4.14.0
  • Docker Engine version 20.10.21
  • Docker Compose version v2.12.2

This is the error:

I already tried to restart the retool app, same issue always.
Looking into the logs of docker container, there are some things maybe helpful here.

Logs of db-ssh-connector-1

2023-01-27 12:34:13 Fri, 27 Jan 2023 20:34:13 GMT body-parser deprecated bodyParser: use individual json/urlencoded middlewares at ../snapshot/retool_development/backend/transpiled/dbconnector/app.js:null:null
2023-01-27 12:34:14 Fri, 27 Jan 2023 20:34:14 GMT body-parser deprecated undefined extended: provide extended option at ../snapshot/retool_development/node_modules/body-parser/index.js:105:29
2023-01-27 12:34:15 (node:15) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field module resolution of the package at /snapshot/retool_development/node_modules/@tryretool/common/package.json.
2023-01-27 12:34:15 Update this package.json to use a subpath pattern like "./*".
2023-01-27 12:34:15 (Use `retool_backend --trace-deprecation ...` to show where the warning was created)
2023-01-27 12:34:15 (node:15) Warning: Accessing non-existent property 'count' of module exports inside circular dependency
2023-01-27 12:34:15 (node:15) Warning: Accessing non-existent property 'findOne' of module exports inside circular dependency
2023-01-27 12:34:15 (node:15) Warning: Accessing non-existent property 'remove' of module exports inside circular dependency
2023-01-27 12:34:15 (node:15) Warning: Accessing non-existent property 'updateOne' of module exports inside circular dependency
2023-01-27 12:34:15 (node:15) [DEP0111] DeprecationWarning: Access to process.binding('http_parser') is deprecated.
2023-01-27 12:34:15 (node:15) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field module resolution of the package at /node_modules/@tryretool/workflowsBackend/package.json.
2023-01-27 12:34:15 Update this package.json to use a subpath pattern like "./*".
2023-01-27 12:34:15 (node:15) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field module resolution of the package at /node_modules/@tryretool/common/package.json.
2023-01-27 12:34:15 Update this package.json to use a subpath pattern like "./*".
2023-01-27 12:34:15 (node:15) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field module resolution of the package at /packages/common/package.json imported from /packages/common/build/workflows/utils.js.
2023-01-27 12:34:15 Update this package.json to use a subpath pattern like "./*".
2023-01-27 12:35:06 bash: line 1:    15 Killed                  ./retool_backend
2023-01-27 12:36:59 Fri, 27 Jan 2023 20:36:59 GMT body-parser deprecated bodyParser: use individual json/urlencoded middlewares at ../snapshot/retool_development/backend/transpiled/dbconnector/app.js:null:null
2023-01-27 12:36:59 Fri, 27 Jan 2023 20:36:59 GMT body-parser deprecated undefined extended: provide extended option at ../snapshot/retool_development/node_modules/body-parser/index.js:105:29
2023-01-27 12:32:04 {"message":"[process service types] DB_SSH_CONNECTOR","level":"info","timestamp":"2023-01-27T20:32:04.035Z"}
2023-01-27 12:32:43 [deprecated] do nothing.
2023-01-27 12:32:54 {"message":"[process service types] DB_SSH_CONNECTOR","level":"info","timestamp":"2023-01-27T20:32:54.301Z"}
2023-01-27 12:34:01 {"message":"Not configuring Sentry...","level":"info","timestamp":"2023-01-27T20:34:00.981Z"}
2023-01-27 12:34:01 {"message":"Not configuring StatsD...","level":"info","timestamp":"2023-01-27T20:34:01.050Z"}
2023-01-27 12:34:01 Setting http and https agent maxSockets to 25
2023-01-27 12:34:01 {"node_version":"v16.14.2","argv":["--max-http-header-size=80000"],"heap_size_limit_mib":5168,"level":"info","message":"Starting DBConnector","timestamp":"2023-01-27T20:34:01.179Z"}
2023-01-27 12:34:14 {"level":"info","durationMs":13564,"message":"dbconnector boot-up","timestamp":"2023-01-27T20:34:14.717Z"}
2023-01-27 12:34:14 {"source":"master","numCPUs":4,"numWorkers":1,"level":"info","message":"[Master] Starting workers","timestamp":"2023-01-27T20:34:14.751Z"}
2023-01-27 12:34:15 {"source":"master","pid":83,"level":"info","message":"Started worker","timestamp":"2023-01-27T20:34:15.093Z"}
2023-01-27 12:34:35 {"message":"[process service types] DB_SSH_CONNECTOR","level":"info","timestamp":"2023-01-27T20:34:35.032Z"}
2023-01-27 12:35:11 [deprecated] do nothing.
2023-01-27 12:35:25 {"message":"[process service types] DB_SSH_CONNECTOR","level":"info","timestamp":"2023-01-27T20:35:25.450Z"}
2023-01-27 12:36:54 {"message":"Not configuring Sentry...","level":"info","timestamp":"2023-01-27T20:36:54.650Z"}
2023-01-27 12:36:54 {"message":"Not configuring StatsD...","level":"info","timestamp":"2023-01-27T20:36:54.669Z"}
2023-01-27 12:36:54 Setting http and https agent maxSockets to 25

Notice there is a 2023-01-27 12:35:06 bash: line 1: 15 Killed ./retool_backend message.

I can provide other logs as well. But this is reliably reproducible.

Hey @mattsun! Thank you for providing all that, it's so helpful :sob:

  • What Retool version are you on?
  • Did this particular REST API resource ever work for you?
  • Do other queries work?

You could create a new query in an app of type RESTquery API, and try hitting a basic endpoint like https://restcountries.com/v3.1/name/canada.If that is still refused, I'd just try to restart db-connector.