BS4 forms Docker node.js mysql not inserting

Adding BS4 register form, with no security or validation added, to keep it simple.
Fails to insert record on local server but works on digitalOcean remote server…

Can anyone help??

Hi.
You are looking in the wrong tab.
See the output in the Network tab to identify what the response is along with 400 status.

But, if there is no response body, you will need to debug the SA.
To do that, my approach is to disable all steps, and enable each step one by one.
Enable a step, submit the form, see the response. If all ok, repeat for subsequent steps.
If the form is failing at the very first step, you might want to look into the INPUT section.
There are sometimes some validations which cause SA to fail.

Hi Sid,
Ok got this back as error:

{“status”:“500”,“code”:“ER_DBACCESS_DENIED_ERROR”,“message”:“ER_DBACCESS_DENIED_ERROR: Access denied for user ‘db_user’@’%’ to database ‘beyond_meditation’”,“stack”:“Error: ER_DBACCESS_DENIED_ERROR: Access denied for user ‘db_user’@’%’ to database ‘beyond_meditation’\n at Handshake.Sequence._packetToError (/opt/node_app/node_modules/mysql/lib/protocol/sequences/Sequence.js:47:14)\n at Handshake.ErrorPacket (/opt/node_app/node_modules/mysql/lib/protocol/sequences/Handshake.js:123:18)\n at Protocol._parsePacket (/opt/node_app/node_modules/mysql/lib/protocol/Protocol.js:291:23)\n at Parser._parsePacket (/opt/node_app/node_modules/mysql/lib/protocol/Parser.js:433:10)\n at Parser.write (/opt/node_app/node_modules/mysql/lib/protocol/Parser.js:43:10)\n at Protocol.write (/opt/node_app/node_modules/mysql/lib/protocol/Protocol.js:38:16)\n at Socket. (/opt/node_app/node_modules/mysql/lib/Connection.js:88:28)\n at Socket. (/opt/node_app/node_modules/mysql/lib/Connection.js:526:10)\n at Socket.emit (events.js:314:20)\n at addChunk (_stream_readable.js:297:12)\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:68:18\n at new Promise ()\n at Client_MySQL.acquireRawConnection (/opt/node_app/node_modules/knex/lib/dialects/mysql/index.js:63:12)\n at create (/opt/node_app/node_modules/knex/lib/client.js:290:39)\n at processTicksAndRejections (internal/process/task_queues.js:97:5)”}

…eeeek :dizzy_face:

This usually means that your local IP is not allowed access to the DB.
But, your remote IP is allowed, hence it connects wothout any error.

Or, it could be that the DB does not have remote access enabled.

Try connecting to the DB using a DB app like Dbeaver or Workbench and see of you can connect.

Doesn’t allow connection with DBeaver
using
port: 9906
username : db_user
password: trying both root password and mysql password copied from wappler local development target db.


eroor:
image

If you are using docker, I think there is an option in the Wappler target settings to allow remote connection to DB.

Else you need to check DigitalOcean firewall settings which is blocking you from accessing the DB remotely.

Hi Sid,
Sorted!! docker port config. defaults to 9906, I was trying to gain access to my Local db so should be port: 3306. :sunglasses:

Thanks Sid for you help

1 Like