Unable to add database connection - Connections folder is a file


I’m having an issue where I am unable to add a database to a certain project, other projects work fine.

The database can be connected to when using the “Test connection” button, but when clicking save, I get “Write failed of [Path to project folder]/dmxConnect/modules/Connections/[name].php”

It gives me the option to save anyway, but this then doesn’t add the database.

Try deleting the connection, closing down Wappler and starting again with a new connection? Might be worth a shot…

Already tried sadly. No connection is actually made at all, if I click save anyway, it just doesn’t save.

I’ve even attempted to copy a database from one of my other wappler projects and put it in this projects .wappler folder, but even that isn’t detected.

No matter what I do I can’t seem to add a database to this project

I’ve also noticed the Database Manager has a constant loading icon.

Where is your project folder located? Do you have wrote permissions?

What OS are you using?

What Wappler version.

I have just solved the problem now, but this was almost certainly due to a bug, I just have no idea how it occurred.

It looks like instead of making a folder named “Connections” in dmxConnect/modules, it made a file called “Connections” (with no file extension) , not a folder. Hence why it was unable to put the file where it was trying to.

I’ve just deleted the entire modules folder inside of dmxConnect, and started Wappler back up. I am now able to databases.

The project was originally made on 3.9.7 on Windows 10. However, I updated to 3.9.9 and the Beta try to and get it working again, but I guess this is irrelevant seeing as the problem was due to the file.

Weirdly though, I have been using 3.9.7 since I started using Wappler, and have had 3 projects before where this issue didn’t occur at all. It only seemed to happen with this project.

Weird - did the folder existed before?

Did you restore the project from somewhere or use git or ftp maybe?

Nope sorry, the folder was brand new, and neither git nor ftp was used. This was essentially a completely brand new blank project. I tried reproducing it, but I can’t seem to.

If you could reproduce it with exact steps it will be very useful.

How did you create the database connection in first place? With the database manager or server connect?

Also what kind of database and where is it stored?

Initially, I attempted to add it via the database manager, then, when that didn’t work I attempted to add it in server connect.

It was a MySQL database and is hosted on my external VPS.

The exact steps as I remember them:

  1. Created the project
  2. Built a few pages of the site with Bootstrap 5, beta 3, Custom.
  3. Attempted to add the server in the database manager. I believe this is where the initial issue occurred with the database not adding and the endless loading icon next to the “Database Connections” text started showing (Screenshot in my above post).
  4. Attempted to add it via server connect, database did not add due to the “Cannot write file” message, which later turned out to be due to the folder being a file.
  5. Attempted again to add it via the database manager, upon clicking save nothing happened here, not even the “Cannot write” message.

I will try to reproduce this some more over the weekend, but I’m not sure if it will be possible seeing as this is the first time this has occurred out of 3 to 5 projects I have created.

Thanks this is very helpful, will try to reproduce it.