Bug or technical issue? Sudden error in my database/tables

Delete the database by clicking the shutdown button near the Deploy button, and then Deploy and run the migrations (Changes) again

If you still have a problem then somehow your migrations got messed up and you have to fix or re-create them. I once helped someone here on the forum with the same issue, hope you can find the topic

That didn’t work unfortunately… will try find your previous topic

If I just re add the old tables again will everything go back to normal?

This is the topic:

You could re-create the tables/columns starting from where the issue started to happen

Thanks… how do I avoid this from happening in future?

Hard to tell because we don’t know what caused your issue in first place, only thing we know is Wappler wasn’t totally in sync with your database and that caused issues when you made new migrations

Vote for the feature requests:


Thanks will do. This is not the first time this has happened to me and it’s made me quite anxious building on Wappler as it paralysis my app … hope they fix it

Okay I know what cause this problem, and I think it’s a huge bug. Here is what I am doing to replicate this issue:

On macbook 1:

I rebuilt the table objects again. No errors popping up. I commit and push the update to github.

On macbook 2:

I clone this project, and as soon as I open up the tables, the same error pops up on this device. I refresh the schema and all the tables disappeared.

So the problem is pulling and pushing from github- the tables are not synching.

Unless I a not doing this correctly?

You haven’t run migrations on your macbook 2, right? You have to run them first

I’ll ask the team to add some safety check regarding that

I thought I did…

My steps were as follows on Macbook 2:

  1. Open up Wappler and click on Clone project from github
  2. Project loads
  3. run migrations - error pops up migration failed.

Reason the migration failed is because the tables are not synching…

Oh, ok, I understood that now. Well, that might’ve happened because you had to re-create some of the migrations as they were erroneous in first place, so I wouldn’t consider this to be a valid replication of the suggested bug. If you confirm both computers are with the project exactly at the same (working) state and you try to to create a migration, do a Git clone, run migrations, and you still see that problem, then that’s ok to be considered a (possible) bug

Edit: Have you modified .gitignore? Maybe excluded “db” from Git? I had that once happen to me

Edit 2: Sorry, you can discard my reply, I missed the part where you said you cloned the project (instead of pulled the updates). The investigation of this issue would take time I don’t have at the moment

Correct - on Macbook 1 I had no tables and recreated a few to test. No errors. So I push to github and commit the changes.

MAcbook 2 - start a new project by cloning this github clone. Project opens, I right click under “Changes” the latest change and click on “Apply latest changes”. Error pops up saying migration failed because the table object “users” does not exist (which is what I created on Macbook 1). When I click refresh schema the tables all disappear.

So its almost like Wappler knows the tables should be there as they show them when the project loads, but as soon as you click Refresh schema they all disappear

Your migrations are already messed up (I guess). Easiest way to deal with this is to delete all migrations and re-create them again

Wappler is showing the tables as Macbook 1 saw (previously saved data in a separate file)

Macbook 2 sees an empty database because the first migration failed to run (looking for the users table)

There should exist a migration for creating the users table in first place, but it doesn’t, so I recommend you start from fresh

How do your changes look on MacBook one are they all green or is there some inactive orange ones listed.

Have you made any database backups while doing this?

Okay - big update. Thank you Apple! I deleted all the previous “Changes” and started from scratch. Now it is working. Something must have happened to one of my previous changes and mucked everything up.

@Sorry_Duh - you are on the money - from memory I had orange inactive ones. now its a green tick.

I will keep a look out for any corrupt “Changes” as these would cause the errors that probably alot of people are facing.

Few things from my experience what cause these are:

Deleting active migrations as you can then end up having a table etc that cant be created when the changes are next run.

If you have a migration active and backed up then you decide to roll back this change and delete the change the backup still looks for the change as it was active in the save so always make a new backup to override this.

Deleting migrations from inside the folder etc

There maybe more ways to have errors like these but this is a few I’ve noticed.

Thank you. If the box turns orange what does that mean? How do I fix that?

also-- I added a test table object but deleted it. Now when I fetch data it gives me the error saying column test does not exist. When I deleted the text object I committed the change.

Why does it not recognised that it’s deleted for good?

Green means the change is currently active so for example lets say I create a table, users and then save those edits this change should auto turn green on the development target.

If you was then to shutdown the docker container or look at a remote target to publish etc these changes would be orange meaning not active when you apply latest changes it activates all of these orange ones and creates the schema (activating them turning them green) why its a huge issue if a active change is deleted or corrupted as it cant carry on building the schema

Where do you get this error when running migrations on the second MacBook or viewing data in the manager etc?