NEED HELP!: Can't query DO managed database, data does show up in database manager

Hi there Wapplers,

NEED HELP! Project is nearing deadline…

I’m stuck with an issue regarding Managed Database by DigitalOcean. Any help is greatly appreciated!

The problem
I can’t query any data! The database is a Digital Ocean Managed database running MySQL with a legacy user for the authentication issues (mentioned in some other thread). The project is running on the staging target, which is a DO droplet created by Wappler.

I get this ETIMEDOUT status 500 error with these details:


{
  "status": "500",
  "code": "ETIMEDOUT",
  "message": "connect ETIMEDOUT",
  "stack": "Error: connect ETIMEDOUT\n    at Connection._handleConnectTimeout (/opt/node_app/node_modules/mysql/lib/Connection.js:409:13)\n    at Object.onceWrapper (events.js:420:28)\n    at Socket.emit (events.js:314:20)\n    at Socket._onTimeout (net.js:483:8)\n    at listOnTimeout (internal/timers.js:554:17)\n    at processTimers (internal/timers.js:497:7)\n    --------------------\n    at Protocol._enqueue (/opt/node_app/node_modules/mysql/lib/protocol/Protocol.js:144:48)\n    at Protocol.handshake (/opt/node_app/node_modules/mysql/lib/protocol/Protocol.js:51:23)\n    at Connection.connect (/opt/node_app/node_modules/mysql/lib/Connection.js:116:18)\n    at /opt/node_app/node_modules/knex/lib/dialects/mysql/index.js:68:18\n    at new Promise (<anonymous>)\n    at Client_MySQL.acquireRawConnection (/opt/node_app/node_modules/knex/lib/dialects/mysql/index.js:63:12)\n    at create (/opt/node_app/node_modules/knex/lib/client.js:290:39)"
}

When I try to connect to this same managed database from a php project I get a different error on querying the database:

{
  "code": 0,
  "file": "/var/www/html/dmxConnectLib/lib/db/Connection.php",
  "line": 40,
  "message": "Class '\\lib\\db\\server\\mysql2' not found",
  "trace": "#0 /var/www/html/dmxConnectLib/lib/db/Connection.php(24): lib\\db\\Connection->__construct(Object(lib\\App), Object(stdClass), 'remote_db_DO')\n#1 /var/www/html/dmxConnectLib/modules/dbconnector.php(26): lib\\db\\Connection::get(Object(lib\\App), 'remote_db_DO')\n#2 /var/www/html/dmxConnectLib/lib/App.php(195): modules\\dbconnector->select(Object(stdClass), 'query')\n#3 /var/www/html/dmxConnectLib/lib/App.php(127): lib\\App->execSteps(Object(stdClass))\n#4 /var/www/html/dmxConnectLib/lib/App.php(116): lib\\App->exec(Object(stdClass), false)\n#5 /var/www/html/dmxConnectLib/lib/App.php(94): lib\\App->exec(Object(stdClass))\n#6 /var/www/html/dmxConnect/api/strapi/get_houder.php(8): lib\\App->define(Object(stdClass))\n#7 {main}"
}

I already fixed the first connectivity issues thanks to these threads:



What does work
I can Fetch Data from the Wappler database manager just fine:

This database is also connected to an instance of Strapi, running on a different droplet on Digital Ocean. Strapi works perfectly and is able to do queries just fine. Also accessing the Strapi api from Wappler is working fine.

Furthermore I have added Wapplers droplets ip to the access list of the managed database, as well as my home ip-address, as strapi’s droplets ip-address.

What I think is weird is that I CAN access the data, just not through a query that I can actually use on the front-end.

Any help is GREATLY appreciated, since I am nearing a deadline with this project, rather soon.

@karh is your setup with the managed db still working?

bg

Jelle

Community Page
Last updated: