Connecting to new, prod mysql8 db - connection timeout (Workbench connects perfectly)

Which db connection settings are not saved for your production target the server connect ones or the database manager?

Those are just save in .wappler/targets/xxx folder and used when you switch targets, so verify there.

Server connect shows the correct settings in the json file but the dB.json file in the correct target folder gets overwritten by the Docker host url.

I’ve even edited this as well as the server connect file manually. I just get a timeout.

I tried removing the dB connection from the target too. No luck. Then I test in workbench same credentials - connects instantly.

Where exactly do you get a timeout and what target is selected?

Target selected was production (with the remote dB).

I get a timeout little red icon on the dB connection in dB manager.

Note - I have a second remote dB that connects just fine on that target - it’s only the ‘dB’ that is having issues - I suspect something to do with it being the main dB/dB in the target settings?

@George I’m going to try again today, I’ve deleted the previous prod target attempt - and this time I’ll try and set up with the same docker machine, but this time choosing ‘None’ as the DB in target when setting up.

Noting, I’ve done this and I receive this error in the console prior to attempting to do anything, this happens right after creation of the target:

File /Applications/Wappler.app/Contents/Resources/app.nw/Shared/DMXzone/Databases/Connections/node/dmxDatabase.json does not exists!

I have gone to the ‘db’ in server connect and input the correct DB information (verified by Workbench connecting instantly). I then save.

Note:

I don’t see this anywhere. Please screenshot where this exists. I’ve checked settings for the DB / Databases in Server Connect - I have no checkbox option for this. (I’m on latest Wappler). In DB Manager - I am unable to view the Direct Database Connection as it presents the Wappler error "This is a default database connetion defined in Docker, to edit it use the project target settings.’

When I click on this, or whenever I try to refresh the DB connection in DB Manager I keep getting this error:

File /Applications/Wappler.app/Contents/Resources/app.nw/Shared/DMXzone/Databases/Connections/node/dmxDatabase.json does not exists!

So even on a new target, with ‘None’ selected when setting up the target I am getting the same error.

And now the error when I hover over the little red icon in the ‘db’ connection in DB Manager is: Invalid Target Configuration. Check your web server URL and your configuration to it.

For the target I’ve used a correctly setup Docker Machine created from within Wappler.

Can you advise what I need to do next to get this up and running? We essentially cannot go to prod with this issue…

Thanks @Teodor - can you advise how I open this Database Connection modal?

I don’t have the option to do so - unless I’m completely missing it.

I’m in Server Connect (Now workflows) - if I click on the folder, I have no options available other than the settings cog - which just opens the generic SC settings. Then at the bottom of the left panel I have Connection Options but that opens up the previous panel - nothing like what you are showing me there.

I’m on the latest version of Wappler and this is a NodeJS project.

For NodeJS the connection is automatically created under Database Manager, so this checkbox is not available there.

Got it.

So what else can I look at or provide to you? I’ve tried creating the target 3 times now, with various approaches. None will connect to MySql Remote as the default DB, whereas Workbench does just fine with the exact same credentials.

Guys,

I’ve just tried again.

This time:

  1. New Target with the previously created Docker Machine. Remote set.
  2. In DB Settings, I included all AWS RDS MySql settings - as per a successfull connection with Workbench.
  3. Confirm creation of target.
  4. I’m currently in ‘development’ target, so I now click on the newly created production target - and notice the color circle is red (which I believe is correct, as it won’t auto-deploy to prod anymore).
  5. So I go to ‘db’ in Server Connect - and the ‘host’ has been overwritten by ‘db’ instead of the AWS RDS endpoint.
  6. I leave this, and go to DB Manager - again I see this:

Screen Shot 2021-04-27 at 6.11.27 pm

  1. So, I go back to Server Connect and click on DB then Connection Settings and input the endpoint again.
  2. I then go back to DB Manager to view the tables, I refresh and I’m again left with the same red icon and connect ETIMEDOUT.

I’ve double checked my access policy in AWS for the DB, I’ve even created an entirely new security group with access policy and re-added the appropriate IPs.

I’ve tested connecting with Workbench again after the aforementioned access updates - Workbench connects instantly.

Still I get timeout in Wappler.

I’ve checked the Server Connect db connection, the json file looks correct.
Then when I go to the db.json file in the target folder - it’s reverted again back to the docker machines host ip and user as ‘root’ and passsword’ as the one provided by the machine creation.

I suspect the issue is to do with the default db creation and using a remote db, as creating a secondary remote db connection works seamlessly.

Guys, I don’t know what else I can provide you to solve this. Please advise.

Just make sure you:

  1. first select the remote target and make it active,
  2. then select the db connection in server connect and edit it.
  3. then edit the db connection in the database manager - and test it.

When saved you should be able to refresh and see your remote database schema.

@George

I’ve done what you have suggested, for each 4 attempts and I’ve written as much throughout this post ​- it’s not working. I don’t have the option to ‘test’ the connection in DB Manager as I have a node project, and as it’s the default connection it just alerts me to only edit this in the target settings.

I would prefer this to be a simple user-error on my behalf, because then it’s a quick fix - I’m providing as much information to the Wappler team as possible to help debug/overcome whatever I’ve not done.

Hi @mgaussie,
If you haven’t spotted it already, there is a separate set of connection settings in Database Manager

The ‘db’ connection is a Wappler managed one and is seemingly overwritten any time you save the project settings. If connecting to RDS, I would suggest creating a new connection entirely for that target.

I have connected fine with this and can use DB Manager with RDS

Thanks for this @bpj.

I have a secondary dB connection which is remote and like you connect to this fine.

I have two other, older projects and I use db for local, staged (remote) and prod (remote).

All work fine.

I appreciate what you are saying but the suggestion basically means I will not be able to use the default DB connection in any of my projects, as I’ll always use a remote dB for production.

The default dB then becomes redundant in Wappler.

Most who are genuinely looking to scale out a production app will likely use a remote /managed remote dB.

I do appreciate your willingness to reply @bpj

1 Like

Agreed.

I don’t think it’s a bug per se but it is definitely something that could be refined a little.

I don’t really follow why you feel it’s not a bug? (Please don’t take that the wrong way). It certainly could be user error but otherwise…

Old projects > I can use dB with remotes.
New project > I can’t.

I’m certain the default dB has not been designed in such a way that you can’t connect and maintain remote connections.

I can see why you would see it as a bug, but to me, for a scalable app, I’m always going to set the DB connection separately. Whether or not one considers it a bug is irrelevant, it needs looking at :kissing_heart:

@George

I finally managed to connect to the remote MySql8 db this morning, with the default db.

What I found out was that if I create a docker target and select ‘none’ for the db then whatever I try to do - the default db just won’t connect, I get the above mentioned file missing errors and other errors.

If I select a DB as the target and then try to change the settings or both db.json files, I continue to get timeout errors regardless of what I try. It just fails.

Working Order:

  1. Create the Docker Remote WITH a MySql DB chosen in the target. Doesn’t really mater what credentials go in there - but I input the expected remote credentials.
  2. Once the target has been created I then go back to the target and THEN change the databsae settings to ‘None’.
  3. I then go and change both db.json files to match the remote db credentials. Now it works.
  4. But then there is the issue of applying all the DB Manager changes, for example if the original Docker DB was created with dummy data. I had to use an external service (workbench) to recreate the DB schema so that the stored db changes would be able to be applied (as it needed to drop those tables).

So, clearly either some files are missing when setting up without a db in target settings on creation, and if you leave the target for the default db - you cannot connect to a remote db without then removing that.

I’d say from a UX perspective, this isn’t great, and especially for any new to using Wappler this may be quite an uncomfortable experience - especially requiring them to edit the db.json files manually.

Anyway, it’s working so over to you guys for review/improvements. Feel free to unlist.

1 Like

The “flexibility” feature to Define & then modify Database connections from different access points, obviously, needs some logic refinement as to how Wappler processes what you intend to do.

Since defining a Target is Step One then there ought to be, I think, a SEPARATE clearly defined Check box or slider Off/On that stores immediately "Do you want this Target Setting “My Master Killer App database remote” to be the DEFAULT MASTER for this “Debugged Remote Killer App” Project?

The variables are defined in a separately dedicated file “target_master_default” that is always read first before any connections get written with each save & deploy/upload.

A Master Connections file for the project folder should be safely stored outside of the current updatable files for Connections. And in Target you can call it up and Modify it at any time – but when you see it in Edit mode it ought to be a rock-solid confirmation that so far this is the Master connection configuration saved & used.

OR something like this :face_with_monocle: ?