Digital Ocean Managed Database connection error

Hi all,

Just trying to put my very old project to a new target with brand new servers (hetzner+digitalocean managed database). Everything created in the Resource Manager without any issue, created the database, restored all the data and I can reach the database from phpmyadmin from the same server as the web nodes (also removed any ip restrictions for testing, so this is not the issue). The web part seems ok, deployment was successful and seems to be working as the initial routing redirect works, but got a connection timeout error from the sql server. I am on 6.8 Beta channel, acient old nodejs project (created when nodejs initially got supported in wappler) if that matters.

Currently on the prod site:

The only error message I can see is on the database manager:

Also this in the console:

(someone suggested to reinstall wappler, tried that, nothing changed)

Target settings:

SC Database connection details:

Bit lost now after trying to get it work for like 6 hours. Tried pretty much everything I found on the forum, so could anyone please give me an idea or point me to the right direction?

Many thanks!
Gabor

Hi Gabor,

For the ETIMEDOUT error, it seems the mysql2 node package is missing. Wappler started using mysql2 package for both local and remote server deployments in one of the 6.8.0 updates.

Try installing/updating node packages in the project bottom status bar. If that doesn't install mysql2, then check whether "mysql2": "^3.6.5" package is available in the package.json file.

The v6.8.0 has been out of beta for some time now. I believe it's safe to disable the beta channel option as all the updates have been released in the stable channel.

Thanks for trying to help!
All packages are updated and seems to be having the mysql2 package if you meant the packege.json in the root of the project folder:

I've been having the same problem recently on a brand new project (dmxDatabase.json does not exist). It would connect to the db fine on the original target (with any local or remote server configuration) but if I add a new target it refuses to connect to the db, despite selecting it from the resource manager with all the same settings everywhere.

Assuming you've switched targets and checked the db is correctly configured under globals, the only thing that worked for me was to create a new database connection with a different name e.g. db2 and then delete the original one.

Depending on how big your project is, that could be fairly painful as you'd need to update all your server actions. You might get away with adding a new db connection (e.g. db2), deleting the original one (db) and then renaming the new one to db but I'm not sure.

Good luck with it

Hi Paul,

I have about 150 server actions, so try to avoid this path :slight_smile: Will do if I won't have a better option, but I really hope there is.. based on the error on the direct database page and console it is trying to get the connection details from the wrong place but I have no idea where from?

I can try though from a test page with a new connection...

Under globals it all looks ok, but the direct database connection gives the errors shown above.

G

Ok so I created a new connection under globals with the same connection details, it finally gave me the option to open the settings under direct database connections and it gives a Timedout error as well:

I have been getting the same error dmxDatabase.json does not exist in the projects where remote database is being used in the project settings.

But I don't think this error is causing the ETIMEDOUT error.

Yeah - for me it was a new project and after it kept refusing to work on a new target no matter what I did, I figured it was a bug and wasn't worth the headache as I hadn't started anything so nothing to unpick. I'm 100% sure all my settings were correct and identical between targets. Just some would suddenly give that dmxDatabase.json does not exist error and I couldn't find anything online about fixing it.

Sorry I can't be more help

1 Like

Have you tried turning off SSL, just in Database Connection from the DB manager? When you click test connection, I guess it times out?

Yes, tried that, same result :frowning:

Ok, I still have no clue what is the issue but managed to get it work by skipping the resource manager and on the target I set the database type to custom and add exactly the same details there (anyone in the future using DO managed DB, do not forget the SSL cert, resource manager should download it to the cert folder or download manually from DO and put it in the cert folder).

Gabor