Question

Connection time out error when trying to connect Node App on app platform to a managed database?

Hey, so I’m using digital ocean for the first time and I’m working to deploy a node app on app platform and connecting to a mySQL database.

I’m having issues connecting the app to the managed database. I get this error

[2022-04-19 16:15:25] Error: connect ETIMEDOUT [2022-04-19 16:15:25] at PoolConnection._handleTimeoutError (/workspace/node_modules/mysql2/lib/connection.js:189:17) [2022-04-19 16:15:25] at listOnTimeout (internal/timers.js:554:17) [2022-04-19 16:15:25] at processTimers (internal/timers.js:497:7) { [2022-04-19 16:15:25] errorno: ‘ETIMEDOUT’, [2022-04-19 16:15:25] code: ‘ETIMEDOUT’, [2022-04-19 16:15:25] syscall: ‘connect’, [2022-04-19 16:15:25] fatal: true [2022-04-19 16:15:25] } [2022-04-19 16:15:25] Done in 13.29s.

I’ve seen that in this question: https://www.digitalocean.com/community/questions/error-connect-etimedout-10-108-0-2-xxxxx

This could be caused by the fact that a port is not opened. How can I open this on app platform?

Subscribe
Share

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hello,

Have you defined your database details as environment variables as described here:

https://docs.digitalocean.com/products/app-platform/how-to/use-environment-variables/#databases

Best,

Bobby

Eyy Efe,

Have you check out Trusted sources? (click on your app and click on the Settings tab) You could have restricted access to database cluster.

Let me know if that helps - Sergio Turpín