GLOBAL issue: cannot find DB connection v3.5 - unable to access site with remote db

Fixed in Wappler 3.5.1

Guys

I updated to 3.5.1 and still got this error when inserting a register (simple sign up form).
I’m using nodejs + docker on Mac OS Catalina. It’s brand new web app, created using version 3.5.1

Message from Chrome Dev Tools:

{status: "500", message: "knex: Required configuration option 'client' is missing.",
}
message: "knex: Required configuration option 'client' is missing."
stack: "Error: knex: Required configuration option 'client' is missing.↔    at new Client (/opt/node_app/node_modules/knex/lib/client.js:54:11)↔    at Knex (/opt/node_app/node_modules/knex/lib/knex.js:53:28)↔    at App.setDbConnection (/opt/node_app/lib/core/app.js:206:25)↔    at App.connect (/opt/node_app/lib/modules/dbconnector.js:8:14)↔    at App._exec (/opt/node_app/lib/core/app.js:393:57)↔    at App.exec (/opt/node_app/lib/core/app.js:335:20)↔    at App._exec (/opt/node_app/lib/core/app.js:354:25)↔    at async App._exec (/opt/node_app/lib/core/app.js:364:17)↔    at async App.exec (/opt/node_app/lib/core/app.js:335:9)↔    at async App.define (/opt/node_app/lib/core/app.js:318:9)"
status: "500"

@George

Seems your db connection setting is wrong. Did you edit something in it manually? Just check the server connect db connection and reapply it.

Hello @George!

Did you edit something in it manually?

No! I didn’t

Just check the server connect db connection and reapply it.

The connection is working, I already created tables.

Just for the record there are two types of connections - one direct connection for Wappler and it’s database manager and one for server connect that will access the database from your website

So yes your direct connection for Wappler seems to be working but there is a problem with the server connect one.

I too get the following with 3.5.5

{“status”:“500”,“message”:“knex: Required configuration option ‘client’ is missing.”,“stack”:“Error: knex: Required configuration option ‘client’ is missing.\n at new Client (/opt/node_app/node_modules/knex/lib/client.js:55:11)\n at Knex (/opt/node_app/node_modules/knex/lib/knex.js:53:28)\n at App.setDbConnection (/opt/node_app/lib/core/app.js:202:25)\n at App.connect (/opt/node_app/lib/modules/dbconnector.js:8:14)\n at App._exec (/opt/node_app/lib/core/app.js:384:57)\n at App._exec (/opt/node_app/lib/core/app.js:355:28)\n at async App.exec (/opt/node_app/lib/core/app.js:324:9)\n at async App.define (/opt/node_app/lib/core/app.js:314:9)”}

edited my db.json to client instead of type

This error was solved in Wappler 3.5.5 - but you probably have wrong database connections, so just reapply them.

Wrong database connections?
I have today deleted the existing database, created a new one, created the tables, again, rebuilt the server connect queries.

And still I get the error.
I checked the Wappler Local and Docker db.json
Local says
“direct”: true,
“client”: “mysql”,

the docker one
“direct”: true,
“type”: “mysql”,

I’m not sure if this helps or not, but in your last post, I still see “type”: “mysql”.

Hi @scott
Yes, it was apparently fixed in 3.5.5 though
I have manually amended the db.json to client instead of type and still errors

This is what I was referring to. I don’t know for sure that is the cause of the error, but from reading the posts above, it seems like it could be.

The docker one says
{
“direct”: true,
“client”: “mysql”,
“connection”: {
“host”: “XXX.XXX.XXX.XX”,
“port”: 9906,
“user”: “root”,
“password”: “***********”,
“database”: “mydb”
},

Maybe just reapply your project settings so that the right docker connections get generated.

Just open the project settings and save them.

Already tried that

And then redeploy your docker and check how the connections are generated.

I redeployed docker to digital ocean. Still getting the error.
I even went to the extent of creating a new droplet and deploying to that target and even rebuilt the DB.

Wappler set the db.json to ‘type’ again for the Droplet.
I have manually changed to ‘client’ and updated/redeployed.
But still getting

{“status”:“500”,“message”:“knex: Required configuration option ‘client’ is missing.”,“stack”:“Error: knex: Required configuration option ‘client’ is missing.\n at new Client (/opt/node_app/node_modules/knex/lib/client.js:55:11)\n at Knex (/opt/node_app/node_modules/knex/lib/knex.js:53:28)\n at App.setDbConnection (/opt/node_app/lib/core/app.js:202:25)\n at App.connect (/opt/node_app/lib/modules/dbconnector.js:8:14)\n at App._exec (/opt/node_app/lib/core/app.js:384:57)\n at App._exec (/opt/node_app/lib/core/app.js:355:28)\n at App.exec (/opt/node_app/lib/core/app.js:324:20)\n at App.define (/opt/node_app/lib/core/app.js:314:20)”}

Is there anything else I can try as both db.json stated ‘client’ and not ‘type’?

So I switched off experiment mode
Now I get

when I ls files on my docker webserver its definitely there.

root@ff4e177ce933:/opt/node_app/app/modules/connections# ls
db.json

Thoughts please @George as I really could do with this working.
Thanks in advance

@George, @patrick - I can confirm this has returned for me - but only on my remote server (db still contained within Docker). The db.json file correctly states client, and not type.

Can we get a review/update on this please, as it is affecting a lot of people.

UPDATE:
In the signup workflow that was failing, it is quite long, so I went through it all and removed ANY trace of the actions that are now replaced by global (removed DB connection, that I thought I needed prior to validate - as the validate step looked erroneous without), security provider etc
 and it’s now working.

@George - when you have validate, it does ask you to select the DB, which you can’t unless it’s in the actual SC, however it does seem to work if you just ignore it. (I reported this elsewhere).

1 Like