I ran into some issues with my site and changes I made and reverted to an earlier commit by deleting current files and checking the commit out.
I ran npm install and update after checkout and checked that my security provider uses the db connection which I also tested.
Can access the db through a local client. everything running locally in a docker container
I also deleted the node modules after getting the error and reinstalled.
Still getting this error in browser when trying to login:
{
“status”: “500”,
“code”: “ENOTFOUND”,
“message”: “getaddrinfo ENOTFOUND db”,
“stack”: “Error: getaddrinfo ENOTFOUND db\n at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:72:26)\n --------------------\n at Protocol._enqueue (/Users/marcelschmidt/Documents/myadvisor/node_modules/mysql/lib/protocol/Protocol.js:144:48)\n at Protocol.handshake (/Users/marcelschmidt/Documents/myadvisor/node_modules/mysql/lib/protocol/Protocol.js:51:23)\n at Connection.connect (/Users/marcelschmidt/Documents/myadvisor/node_modules/mysql/lib/Connection.js:116:18)\n at /Users/marcelschmidt/Documents/myadvisor/node_modules/knex/lib/dialects/mysql/index.js:66:18\n at new Promise ()\n at Client_MySQL.acquireRawConnection (/Users/marcelschmidt/Documents/myadvisor/node_modules/knex/lib/dialects/mysql/index.js:61:12)\n at create (/Users/marcelschmidt/Documents/myadvisor/node_modules/knex/lib/client.js:247:39)”
}
Please help
Just reapply your project settings so that the right docker target settings get saved.
Active target settings are replaced when you switch tge active target so maybe you commuted in git with other target selected than the local development.
Thanks for reply.
I did that, and redeployed on docker, but getting a new error now:
{
“status”: “500”,
“code”: “ECONNREFUSED”,
“message”: “connect ECONNREFUSED 127.0.0.1:9906”,
“stack”: “Error: connect ECONNREFUSED 127.0.0.1:9906\n at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1144:16)\n --------------------\n at Protocol._enqueue (/opt/node_app/node_modules/mysql/lib/protocol/Protocol.js:144:48)\n at Protocol.handshake (/opt/node_app/node_modules/mysql/lib/protocol/Protocol.js:51:23)\n at Connection.connect (/opt/node_app/node_modules/mysql/lib/Connection.js:116:18)\n at /opt/node_app/node_modules/knex/lib/dialects/mysql/index.js:66:18\n at new Promise ()\n at Client_MySQL.acquireRawConnection (/opt/node_app/node_modules/knex/lib/dialects/mysql/index.js:61:12)\n at create (/opt/node_app/node_modules/knex/lib/client.js:247:39)”
I also see I have 2 db connections. I made sure that both have the same connection settings as per the project settings.
When I try to refresh my ddb schema in db panel I get:
I can access the database from Navicat as local db client with the settings that are in the project settings.
These are the 2 db’s in my global settings:
I have tried my security provider with both and getting the same error.
Well seems your connection settings aren’t correct.
Does Wappler not automatically create these for each target if you select local Docker? If you want to change them at the global vars tab, it refers you to the settings in the site settings. So how would I force Wappler to create the correct settings that is usable? Should I maybe create a 2nd local target?
A bit of progress. After restarting Wappler the one db connection works, One called DB but the one called advisordb does not:
Would there be a way to make sure Wappler only uses the db one?
Yes Wappler creates the docker database connection. You usually need to leave it as it is created.
In docker there are two types of database connections - internal ones for in server connect using the internal database name “db” and internal port 3306
And then you have the external connection which is your public ip (or localhost if on local development target) with external port 9906
So seems you are mixing those up. I recall an earlier post that you had all the same troubles.
In general you need only one database connection also, specially when using docker just leave it as “db”
There is no need for additional connection mirroring the same settings as it will give you only troubles when switching targets.
Thanks for the feedback. I cannot remember creating a second db, but this project has been running for 9+ mths and all is a blurr in my memory.
Do you maybe have a suggested change? I want to just use the “db” one created by Wappler and remove all wrong references so all my server connect actions use db which I believe is my current setup. I just need advice on where to check for incorrect/additional myadvisordb settings.
Can I just delete the 2nd “wrong” db?
Yes indeed you can delete any additional database connection just make sure is not used somewhere in a server action.
Then just activate you local development target, open the project settings and save them to regenerate the right docker db connection options for the targets and you should be all fine.
1 Like
Thanks @George for the help[/support