Too Many Connections Error (node)

I have put this in the general category as I am unsure if this is down to what I am doing or a bug

Windows 10
Wappler 3.0.0
Platform: node

The attached video is fairly self explanatory. this issue occurs when running on my local (Wappler inbuilt) server and the office MySQL server or on my live VPS with cPanel

After running multiple queries I am getting strange errors relating to fields not being present which are and have been updated in previous calls
This then is closely followed by a “Too many connections” errors

Once this error occurs the database is totally locked forcing a service restart (local) or VPS reboot to regain DB access.
Sorry, video is 7 minutes long as I explain the entire process

Hmm seems we need to do more db connections cleanup in NodeJS.

@patrick will investigate

Is the too many connection maybe also related to the errors you get before?

In the video the initial error seems to refer to an update query error relating to the “landlord” field being missing.

As this is the key to the entire repeat then obviously it is present so is probably not missing, it is not being returned due to the connection errors.
The too many connection error then generally follows however i do recall that it has also occurred as the first error so maybe it is random depending on when it occurs in the chain of queries

Do you mean the issue with strict mode?

strict is off on online server

for info:

initial error message after 140 queries

{“status”:“500”,“message”:“Undefined binding(s) detected when compiling UPDATE. Undefined column(s): [landlord] query: update landlords set updated = ? where landlord = ?”,“stack”:“Error: Undefined binding(s) detected when compiling UPDATE. Undefined column(s): [landlord] query: update landlords set updated = ? where landlord = ?\n at QueryCompiler_MySQL.toSQL (/home/brian/nodejsapp/node_modules/knex/lib/query/compiler.js:99:13)\n at Builder.toSQL (/home/brian/nodejsapp/node_modules/knex/lib/query/builder.js:72:44)\n at /home/brian/nodejsapp/node_modules/knex/lib/runner.js:31:36\n at client.acquireConnection.catch.then (/home/brian/nodejsapp/node_modules/knex/lib/runner.js:260:24)\n at process._tickCallback (internal/process/next_tick.js:68:7)”}

page refresh then returns

{“status”:“500”,“code”:“ER_CON_COUNT_ERROR”,“message”:“ER_CON_COUNT_ERROR: Too many connections”,“stack”:“Error: ER_CON_COUNT_ERROR: Too many connections\n at Handshake.Sequence._packetToError (/home/brian/nodejsapp/node_modules/mysql/lib/protocol/sequences/Sequence.js:47:14)\n at Handshake.ErrorPacket (/home/brian/nodejsapp/node_modules/mysql/lib/protocol/sequences/Handshake.js:123:18)\n at Protocol._parsePacket (/home/brian/nodejsapp/node_modules/mysql/lib/protocol/Protocol.js:291:23)\n at Parser._parsePacket (/home/brian/nodejsapp/node_modules/mysql/lib/protocol/Parser.js:433:10)\n at Parser.write (/home/brian/nodejsapp/node_modules/mysql/lib/protocol/Parser.js:43:10)\n at Protocol.write (/home/brian/nodejsapp/node_modules/mysql/lib/protocol/Protocol.js:38:16)\n at Socket. (/home/brian/nodejsapp/node_modules/mysql/lib/Connection.js:88:28)\n at Socket. (/home/brian/nodejsapp/node_modules/mysql/lib/Connection.js:526:10)\n at Socket.emit (events.js:198:13)\n at addChunk (_stream_readable.js:288:12)\n --------------------\n at Protocol._enqueue (/home/brian/nodejsapp/node_modules/mysql/lib/protocol/Protocol.js:144:48)\n at Protocol.handshake (/home/brian/nodejsapp/node_modules/mysql/lib/protocol/Protocol.js:51:23)\n at Connection.connect (/home/brian/nodejsapp/node_modules/mysql/lib/Connection.js:116:18)\n at Promise (/home/brian/nodejsapp/node_modules/knex/lib/dialects/mysql/index.js:69:18)\n at new Promise ()\n at Client_MySQL.acquireRawConnection (/home/brian/nodejsapp/node_modules/knex/lib/dialects/mysql/index.js:64:12)\n at create (/home/brian/nodejsapp/node_modules/knex/lib/client.js:291:39)”}

Then PHPMyAdmin shows

Replace the file in lib/code with the one from the zip (2.1 KB)

Thanks @patrick, seems to have solved the issue

This is now fixed in Wappler 3.0.1

This topic was automatically closed after 24 hours. New replies are no longer allowed.