In the Database Connection section, it says ‘connect ECONNREFUSED’.
I’m not sure if it’s related to a database issue I experienced at the start of developing my app (Issues deleting placeholder Docker tables) as @Apple said it could result in issues deploying to another target.
Any suggestions on what I should do to fix this issue?
My local Docker version is 20.10.14, build a224086 (via Wappler System Check). And the remote version is 19.03.12, build 48a66213fe (via Digital Ocean console).
I tried creating a new Digital Ocean remote target and am still getting the same DB build error.
I actually managed to deploy to AWS and the DB was built without error this time. Though none of the tables I previously created in the development target are showing in the Database Manager Tables folder. So I'm not sure if this is normal and need to 'seed' this remote target after deploying.
Looks like the tables wasn’t all made with Wappler or that some of your changes was corrupted / deleted etc you could also apply the changes one by one but this also may not work if the changes aren’t from the start e.g you have no change for creating the users table.
You may need to backup the dev database and then transfer that schema using the backup unless @George can recommend a better option for this
I won’t go into too much detail as this will send this topic off discussion
I have only used Wappler tools for developing my app. Unfortunately, I spent over a month in development before testing out the remote deployment today (naively expecting it to 'just work'), so I'd be more than disappointed if I have start from scratch again.
@George - I just deployed a test project to a remote Digital Ocean target (same Docker version number 19.03.12) and I didn't get a DB error this time, but the remote tables are empty like the AWS deploy.
Your database and its data are not transferred on deploy. On deploy you only upload your files.
To send the data to the remote database you need change the target to remote and apply the database changes through the database manager.
I just remembered that when I first started the project, I loaded the sample Docker data and am still using the users table now (hence why the users table creation step isn't in the change history). In the Targets Project Settings, I then toggled 'No Sample Data' to be on so a service restart doesn't add all those tables back in again.
So I though it could be an issue with not populating the sample data in my remote deploys, so I set the switch to 'Add sample data' to the new targets, but this didn't work either.
I tried deploying to both AWS and DO by toggling the 'No Sample Data' switch on and off, but am getting the same error below:
Can you please point me to some information on how to do this?
Or would it better for future deployments to recreate the database and tables again?
I currently only have 4 tables with a total of 26 fields. So if creating a new 'clean' database makes future deployments more streamlined, I'd be happy to do that.
So, you actually have to create a new migration file manually. I usually use Visual Studio Code, open the project folder and then go to:
.wappler/migrations/db
And then create a new file there, following a specific naming convention. The name of the migration starts with the date of the creation, and you should select this date before all others (as you want this migration to run before all the others)
Thank you very much @Apple for all those detailed instructions!
I actually managed to successfully deploy to the remote Digital Ocean target but got a database migration error message saying the password field was a duplicate. So it seems that the manual migration file I created was slightly mismatched in terms of fields in the original Docker sample data.
So I updated the manually created migration file to include all the fields from the original users table as well as the other placeholder tables (cars, images, countries) based on the details I noticed in the database change history files. I created new Docker machines to deploy these changes to, but now I’m getting the same ‘no such image’ error message (see screenshot below) each time when trying to deploy to these remote targets (both DO and AWS). So I’m not even getting to the DB creation and migration step at all. I reverted the migration file to the one that originally worked, but I’m still getting this ‘no such image’ error.
I’m not sure if there is some limit on the number of machines I can create and delete in a day, but I’ve been creating and deleting Docker machines each time a change doesn’t work properly. I don’t know if all the new Docker machines I’m creating is causing this error.
@Apple - I also managed to migrate the databases successfully without using the manual migration file. In the target’s settings, I toggled ‘No Sample Data’ to be off in order to replicate how I started working on the development target that had sample data.
Thank you all for your time, energy and patience helping me troubleshoot this!