Deploy - DATABASE LOCAL X REMOTE

To me this looks like a DB User issue (admin as a User name may well be reserved). Have you tried creating the User for the database in your providers database configuration area? ie create the User there rather than in Wappler, then try to connect using the newly created User?

We can’t tell this until we see the exact error message which I requested.

1 Like

This is the error, remembering that it only appears when I deploy to hetzner, in the local target it does not give an error!

Well this means that your live database connection is wrong or the db server is unreachable from your live web server.

Switch to the live target and then edit your server connect database connection, see what are the settings there and make sure they are correct.

To what database are you connecting from your live target? Is it all docker or is it a separate database?

I'm using a database created in Resource Manager, as in the image below!

I configured the local DB manually as in the image below.

And I configured the DB in the production target as in the image below. I already changed the user 'admin' for another one even so it didn't work!

I've done several tests of all doing exactly the same way only 1 worked without problems

Are you going to deploy multiple projects on the same server, all using the same central database?

Normally it is better to have a single server with single project and database on it. Much easier to setup.

I always use a database and a single server per project, I just don't like to upload the DB in Docker I prefer to do the configuration the way I showed, I think it's more practical even to have external access to the DB in case I need it! Do you have any ideas of the error or any suggestions of the tests I can make?

Try creating the user for the database using your hosts database manager... Do not call the User 'admin'. Then try using this new User to connect to the database. And check you can connect to the database using something like Workbench etc... Just to concur that it's not just Wappler having issues connecting, then at least you can narrow it down.

1 Like

Adding to Cheese's reply, check if there's a firewall blocking access to the database on the remote server.

3 Likes

hello good afternoon, I have already checked and there is no active firewall on the server, I created the db and user using DBeaver as suggested and it also didn't work! loca continues to work and when I get an error, any suggestions?

old apps I have keep working with the exact same configuration I'm trying, new apps are all giving error!

I assume you mean you created the User and password within your hosts control panel? And then tried to connect with these credentials using DBeaver?

If so this implies it is not a Wappler issue you are experiencing, but a configuration error somewhere or other... At least it clears that up and you now know where the problem is occurring. There can only be a few reasons for this.

  1. Wrong host address.
  2. Wrong port (have you tried 3306?).
  3. Wrong password or User.
  4. User is not assigned to the database (some hosts require you to add the Users to the database).
  5. Requires SSL configuration using a certificate.

Once you can connect using DBeaver or Workbench etc, then you can be certain Wappler will connect with zero issues...

I think you got it wrong!

Create the database and user in DBeaver - it was useful!

Deploy with wappler - it really failed!

Hanging around the local app The database - it worked!

Running the remote app the database - gives an error!

I did the whole process from the beginning with a new server.

In DBeaver I can successfully access the database!

I'm not adverse to that fact hahaha... Only trying to help narrow it down.

Remote and local are two entirely separate entities and one may not use the same configuration as the other. Ignore what is happening locally it is irrelevant in this case (as it works). Explain, do you have one local database and another remote? I watched your videos but your pace, the speed, makes them very difficult to observe exactly what the problem is (and have watched them multiple times now).

1 Like

You have setup a remote database, on your host, with a User and a password, and this User has permission to access the database? And you can connect to this database with DBeaver?

I also see this error:

Yes, the database is the same for local and remote, and I can access it through DBeaver! I configured the database and added the user as usual! What I find strangest is that I've always done the same configuration without any major problems, and for the past few days I've been getting this error. I've even done a clean install but it didn't solve it, some students had the same problem!!

Have you setup the database in the Wappler Database Manager? If not please do so and try again..

image

If that fails then consider creating a proper Bug Report rather than continuing in this thread. Bug Reports are tracked by the Team. This is not a Bug Report topic, it is a request for help, the two are different.

1 Like

Hello @julfonnf ,

I have had the same issue before, but due to work load I found difficult to submit proper bug report. However in my case, I for some reason was experiencing corrupted databases/*.json file. I also should confirm that I have overwritten default ports while creating a database, and not using default suggested 5432 or 9906 ports. Anyway, my local development was able to connect to the database without any issue, however, once pushed to remote, It wasnt able to make a connection and always fail.

I have discovered, that for some reason, even though my development and production targets in wappler would retain the same port in UI, inside of the *.json file, production port was set to a default port! Please refer to the following files


And check whether your production database port is the same as in development target!
I am unsure why wappler UI displays different port than the .json configuration :man_shrugging: But it's worth a check, this has fixed my issue :slight_smile:

1 Like

Also happened to me some time ago, but I'm trying to find the topic and I can't, remember @Apple said something about it there..

1 Like

Ah! Reinstall Wappler, it seems extension updates sometimes cause Wappler files to be broken (due to a broken update)

3 Likes

It seems like there was a bug in auto creating the database connections for targets using the new mysql2 driver. Those were not auto created and had to be entered manually.

it will be fixed in the next Wappler 7 beta.

Just to clarify the workflow, when using a single database service in the same server with multiple projects, then:

  • the server connect database connection should have as host the database service name (as it runs locally on the same server) and the default port (3306 for mysql/mariadb)
  • the direct connection for Wappler in the database manager should list the server ip as host and the externally defined port (like 9910) in as defined in the database service
2 Likes