Deploy from local docker to Digital Ocean failure

I setup all of my tables in the local docker environment and ensured to have all database changes applied before attempting to deploy to a new cloud target setup in the Resource Manager.

It looks like Wappler used the base Wappler docker database instead of the database with all of the changes I made. I then tried to “Apply Latest Changes”, but I get “Database Migration Failed due to an error”.

image

If all of the steps I took to setup the local database were captured, then why am I getting this error?

Can you show your first migration/change? It should create the table users, which somehow might be missing

I am having issues deploying to Digital Ocean as well… perhaps its linked to the same problem?

That’s probably part of the problem since Wappler precreates the Users table in Docker. I deleted that table and created a new User, with no s, table.


Interesting detail, someone from the team should check if sample data comes with their own migrations (which should)

For now, you could re-create your Digital Ocean with sample data, and then run your migrations from there

@daves88 I think you might be experiencing a different issue (unfortunately, I can’t help because I don’t use Digital Ocean [or any other built-in Wappler deployment option])

Same thing is happening with AWS… the problem is I no matter what service I use, when I try add a new target it wont let me change the Docker Deploy Name because it gives an error saying “No running docker projects found”.

Any feedback would be greatly appreciated !

PS sorry for hijacking this thread… but it might step from the same underlying issue…

Hey @daves88, seems like you are having a different issue.

Ok, I think I found a workaround. By trying to individually apply each change in the remote instance, and deleting some of them that didn’t work from the Local instance I am able to build out the database in the remote instance.

It appears Wappler keeps all attempted changes (whether they were successful or not) when you Deploy from one instance to another. I’ve got to fined a way to remove all of the bad (i.e. orange colored ones that throw errors when trying to apply) changes from the local instance.

image

Welp, that ran into issues as well. :no_mouth:

Well yes failed changes are kept now. Available for inspection. Maybe we should offer a delete option. Otherwise they stay as pending indeed.

Then how can you push from local to remote with “Apply all changes”? Maybe it should be something like “Apply all successful changes”?

It also seems like changes aren’t applied in order. I ran into multiple issues trying to apply the changes.

Changes are applied in exact order as they have a date time stamp in the file name.

We just can’t see any difference between changes not applied due to errors or just not applied yet.

The database just keeps track on the last applied change and bringing it up to date means just apply all pending changes.

Ok. Personally I have no need to save unsuccessful changes. If the system chooses to keep them then it should be able to modify the unsuccessful change. Otherwise it seems unnecessary to keep them. It only leads to the type of issues I ran into and a poor user experience with Wappler.

1 Like

Good point - I think we should delete the failed changes and if the user really want to see them in the code editor just open them as unsaved file, so that user can do manually correction and save and apply them again

1 Like

I’m curios on the methodology here. I use datagrip to sync, which does a compare of the schema’s at the time of sync request rather than tracking the changes along the way. It just compares, and creates the necessary sql commands to being the target in line with the source.

Is there a reason that is not the chosen path for this process?

I believe migrations are a little better when they’re properly working. It gives you the option of rolling back if you need to for some reason, and also you could potentially perform mass data manipulation during the migration (and rollback) (though not implemented in Wappler)

Unfortunately, for some reason, some users have broken changes/migrations and then it has a domino effect of failures when they try to deploy somewhere else (or locally from scratch), and generally requires someone that understands what’s happening to fix those

@kfawcett are you using Git and could you revert the migrations you’ve deleted?

1 Like

Not at the moment. I didn’t think something as simple as setting up a few tables would become such an issue.

Ya, that’s a fair point. I haven’t had that need, but I may some day.

Yep, I’ve tried on a half dozen new projects to jump on board with the wappler db manager, but I hit these types of errors and have to cut bait.

Doing manual compare and synchronization is a tuff process if you have to do it each time you publish an update.

By just keep changes you have much more control of your publishing process as you just need to apply them and the changes can be version controlled.