Production DB settings as managed db and local as docker db

======== TEMPLATE BUG FORM ========

Wappler Version : 4.7
Operating System : Mac
Server Model: NodeJS
Database Type: MySql8
Hosting Type: Docker (local) AWS/Docker Remote.

Expected behavior

What do you think should happen?

I’ve noticed issues with the DB connections not finding fields etc… so I started trying to debug this by looking at the connection files.

What I notices is the docker named target (local dev) databases>db.json file is displaying the production db connection settings. This is a pretty significant issue, no telling what issues this may cause in my prod db.

I checked the target db settings and can confirm that it’s displaying as the local docker DB.

So I re-save the target and recheck the file. The db.json file has now changed to the local settings. Great. I think it’s a bug in W4 - hopefully not too many major issues to find / fix in production.

I then click ‘deploy’ as I want to fully deploy the files and check the SC action to see if it works.

It fails.

I check the db.json file and after deploying it reverts back to prod db connection settings.

@Teodor - some help please.

Update - it’s not just a redeployment that causes the overwrite, literally any alternative action. If I go back to the file, it’s been overwritten again.

We didn’t have any changes in that area recently.

Do you use the same docker database on both targets? I recall that you got problems before when specifying remote database connection for your live target. Isn’t that still the case?

How are you editing the connections? And what type of connections are those.

Yes, I have had this issue previously - this was on a seperate project (newer). In the end I managed to resolve it by ordering the way that I saved / updated changes. I didn’t get any support / bug fix from the team at that point - hence the re-post, as this has put a full stop on development of this project.

My setup:

Development: Docker Local - using MySql8 Docker DB, just using the standard Docker DB settings that are created.
Staging: Docker on AWS. Docker DB.
Production: Docker on AWS. Remote Production MySql8 DB on AWS RDS.

My strong preference in nearly all cases is to simple use and follow the Wappler UI for implementing anything.

So, I set the targets up using the target modal. As the DB is the primary DB I cannot edit this anywhere other than in thee DB Target settings.

For Production I have the DB set as ‘None’ in Target so that the prod db doesn’t get overwritten.

When I open the db.json file in server connect - the settings appear correct. It’s when I look at the actual db.json file in the databases folder that get’s overwritten.

I would appreciate some urgent support around this @George.

So many bug reports and issues with Docker on these forums. Why is Docker even a thing? :beers:

So many reasons Brad, and this isn’t really helpful to the bug report. No offence meant.

2 Likes

In the current version you couldn’t edit the remote db settings when docker is selected.

We will allow that in the next beta, so you can have local docker db and remote managed db.

You will still have to enter for the remote the db credentials naturally as those are different, in the server connect connection and in the database manager.

Hi @George - firstly, I appreciate your reply here. Haven’t been able to touch the project so thank you for your help.

I don’t 100% follow.

So, right now, I cannot edit the DB settings - I get the alert telling me to edit in target settings.

So for Docker Local - I leave the Docker DB settings as they were created. Docker Staging (remote) - I leave Docker DB settings. Docker Prod (remote) - I have DB set to ‘none’ and then I configured the DB settings manually (previously, prior to Wappler update restricting this).

Can you advise specifically what I need to do to stop prod settings overwriting local?

The real settings are stored in .Wappler/target folders those are copied on target switch. So if you are experiencing overwrites they are probably wrong there

This is really frustrating.

Yes, I know that’s where the db files are - if you look at my original message, this is where i’m referencing as changing.

The overwrite is happening even without a target switch.

When does it happen than? What do you do exactly?
When changing project options make sure you are on local dev target as active target.

Yep, this is exactly how I do / have done it.

If I have the db.json file open from the docker local target, and then go and save the target settings - without switching targets it reverts the db.json file to the correct db connection (docker) settings. I can see the file change live.

Last night it did it without touching targets again. I’ll try to find the exact moment it does it.

If you have a hard time finding the exact moment start recording your screen for a while and then check the modified date of the file. Then you can go back in the video to the exact moment.

1 Like

I checked again the saving of project settings and database connections, but there are really no overwrites there. The database connections are saved to the target folder only and to the active target.

So there must be something else going on there if you have regular overwrites. Maybe you use git and you are reverting to older version or switching to different branch?

I don’t use git yet for any kind of version control - simply as a backup, and likely to migrate between computers in the near future.

So far, the changes are holding, thankfully - regardless of what I attempt (I’ve now tested changing targets, saving on a different target even, creating new server connects etc. and it’s holding well).

There is only one difference between now and what I experienced last night - there was a Docker update which I completed before shutting down. Do you think there could have been a previous issue with Docker that would have caused this - or is that not in the realm of possibility?

I want to make sure to debug this as much as possible for you guys, so please let me know your thoughts. If that’s not possible then I’ll just keep a close eye on that one specific file until it happens again (IF, and hopefully not).

Using git for backup is fine and also great - then you can see if some files were changed as well.

Docker update shouldn’t effect settings, but maybe it was running an older version?
By just doing a deploy - you make sure that the current files are deployed, so you will be up to date.

Well keep on trying to reproduce if you could, as I don’t see any issues currently with everything I tried as well.

1 Like

Improved in Wappler 4 beta 8

This topic was automatically closed after 45 hours. New replies are no longer allowed.