StevenM
September 24, 2020, 5:17am
1
I am having a hell of a time with the database connection just not working, or losing the connection and then not being able to remove them.
Yes it is set correctly in the settings, using docker and can get to it just fine using the same settings using Navicat no problem at all!
Anyone else having issues? Driving me up the wall!
Restarted and loaded up again I connect it works for a bit and then stops and then I the connection but it stays. So I create another and it works for a bit then it dies.
I check the database connection other than settings in the database manager and the port keeps reverting to port 3306.
I have no idea what is going on! Meanwhile Navicat connecting is fine, database is as expected.
StevenM
September 24, 2020, 5:49am
2
After adding in the database for a third time I now can not refer to it in the server actions:
StevenM
September 24, 2020, 5:57am
3
After Restarting again I was able to Delete the most recent one and connect the other two
Tried deleting one of the other connections so I would just have the one “db” as above, but it wont delete.
StevenM
September 24, 2020, 6:24am
4
Getting this error when submitting form data to the database:
1. {status: "500", code: "ECONNREFUSED", message: "connect ECONNREFUSED 172.23.0.2:9906",…}
2. code: "ECONNREFUSED"
3. message: "connect ECONNREFUSED 172.23.0.2:9906"
4. stack: "Error: connect ECONNREFUSED 172.23.0.2:9906↵ at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16)"
5. status: "500"
Restarted Wappler, redeployed and same error
StevenM
September 24, 2020, 6:32am
5
OK Anyone has the same issue I followed the process here and it worked!!!
Well, I opened up the docker target and re-saved it like you said. It re-generated the DB connections like it now works.
When I inspect the DB file that Patrick mentioned it now has:
{
"name": "db",
"module": "dbconnector",
"action": "connect",
"options": {
"client": "postgres",
"connection": {
"host": "db",
"port": 5432,
"user": "db_user",
"password": "xxxxxxx",
"database": "demo"
}
Previously, in this same file it had port 9906.
I will kee…
George
September 24, 2020, 6:35am
6
You shouldn’t change the options generated by docker. They are all good.
You have two separate connections - one direct connection for Wappler that uses the external port 9906 on your localhost
And one internal to db for server connect that uses the internal port 3306 on the internal host called db
So it docker is deployed and the services started without errors - those should be just available to connect to.
George
September 24, 2020, 6:37am
7
The exactly with internal 3306 was for MySQL if you use Postgres it is different 5432
External is still 9906
But again it is all generated for you so you don’t have to change anything.
George
September 24, 2020, 6:41am
8
So just open your project settings and reapply them so that the right settings get generated and do not change them afterwards.
Also make sure the development target is selected as active target.
Deploy and the database will be up and running.
StevenM
September 24, 2020, 6:43am
9
Hi @George tried everything and found someone who had similar connection error as above. I followed the direction in that use case and it fixed it for me.
George
September 24, 2020, 6:51am
10
again if you just used the defaults and made sure it is all deployed it will all work automatically.
But if you and change a lot of settings by the hand then things can get messed up. While maybe you just had the wrong target are the services weren’t started by deploying them.
anyway glad it works now.