5.3.3 Bug: Cannot read properties of undefined (reading 'sub')

Just updated to the latest Wappler and a server action that was working before, stopped working.

  server-connect:server Got error? TypeError: Cannot read properties of undefined (reading 'sub')
  server-connect:server     at App._processSubQueries (/opt/node_app/lib/modules/dbconnector.js:634:31)
  server-connect:server     at App.select (/opt/node_app/lib/modules/dbconnector.js:161:54)
  server-connect:server     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
  server-connect:server     at async App._exec (/opt/node_app/lib/core/app.js:599:30)
  server-connect:server     at async App._exec (/opt/node_app/lib/core/app.js:566:17)
  server-connect:server     at async App.exec (/opt/node_app/lib/core/app.js:535:9)
  server-connect:server     at async App.exec (/opt/node_app/lib/modules/core.js:232:13)
  server-connect:server     at async App._exec (/opt/node_app/lib/core/app.js:599:30)
  server-connect:server     at async App._exec (/opt/node_app/lib/core/app.js:566:17)
  server-connect:server     at async App.exec (/opt/node_app/lib/core/app.js:535:9) +0ms

Adn the logs of the query that seems to be causing the bug:

Just confirming: I’ve reverted updating dbconnector.js and it’s working again

I have the Same Problem .

Update old Version dbconnector.js works

Same here

I get the following error after updating to 5.3.3. Some queries started to fail.

message
:
“meta.find is not a function”
stack
:
“TypeError: meta.find is not a function\n at App._processSubQueries (/opt/node_app/lib/modules/dbconnector.js:633:28)\n at App._processSubQueries (/opt/node_app/lib/modules/dbconnector.js:647:50)\n at processTicksAndRejections (node:internal/process/task_queues:96:5)\n at async App.select (/opt/node_app/lib/modules/dbconnector.js:161:29)\n at async App._exec (/opt/node_app/lib/core/app.js:599:30)\n at async App._exec (/opt/node_app/lib/core/app.js:566:17)\n at async App.exec (/opt/node_app/lib/core/app.js:535:9)\n at async App.define (/opt/node_app/lib/core/app.js:517:9)”
status
:
“500”

Do you have multiple levels of sub tables, so an other sub table under a sub table?

Following updated file should fix the error: dbconnector.zip (3.4 KB)

Timing! Literally JUST came here to see if you fixed it yet :slight_smile:

Yes, got multiple levels of subtables.

For example like this:

Will test out the patch now.

@patrick not fixed sadly. I think this is related so I keep it in this thread: while trying to test I have different queries failing now, with this error:

{"status":"500","message":"meta.find is not a function","stack":"TypeError: meta.find is not a function\n    at App._processSubQueries (/opt/node_app/lib/modules/dbconnector.js:633:36)\n    at App._processSubQueries (/opt/node_app/lib/modules/dbconnector.js:641:42)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n    at async App.single (/opt/node_app/lib/modules/dbconnector.js:381:13)\n    at async App._exec (/opt/node_app/lib/core/app.js:599:30)\n    at async App._exec (/opt/node_app/lib/core/app.js:566:17)\n    at async App.exec (/opt/node_app/lib/core/app.js:535:9)\n    at async App.define (/opt/node_app/lib/core/app.js:517:9)"}

And just tested the original error causing server action and this is the error I get:

{3 items
"status":"500"
"message":"Cannot read properties of undefined (reading 'sub')"
"stack":"TypeError: Cannot read properties of undefined (reading 'sub') at App._processSubQueries (/opt/node_app/lib/modules/dbconnector.js:634:31) at App.select (/opt/node_app/lib/modules/dbconnector.js:161:54) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async App._exec (/opt/node_app/lib/core/app.js:599:30) at async App._exec (/opt/node_app/lib/core/app.js:566:17) at async App.exec (/opt/node_app/lib/core/app.js:535:9) at async App.exec (/opt/node_app/lib/modules/core.js:232:13) at async App._exec (/opt/node_app/lib/core/app.js:599:30) at async App._exec (/opt/node_app/lib/core/app.js:566:17) at async App.exec (/opt/node_app/lib/core/app.js:535:9)"
}

Just making sure I applied the patch correctly: I overwrote this file

and deployed again (docker local environment)

Same here, nested sub tables.

Noticed that there was also an typo in the code which is causing the error Cannot read properties of undefined (reading 'sub'). Here an update for that.

dbconnector.zip (3.4 KB)

3 Likes

I had the same problem. Thanks for the quick fix @patrick :+1:

Thanks, this patch works. Not error now.

Fixed in Wappler 5.4

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