Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[email protected]: Uncaught Cannot read properties of undefined (reading 'closeResultSet') #249

Open
PierreFritsch opened this issue Jan 16, 2025 · 3 comments

Comments

@PierreFritsch
Copy link

Hi folks

While checking our logs for application crashes, we stumbled upon a null pointer exception in the hdb module:

Uncaught Cannot read properties of undefined (reading 'closeResultSet')

The stack trace points to ResultSet:

  this._connection.closeResultSet({
    resultSetId: this.id
  }, done);

We cannot provide further hints on how to reproduce for the time being, maybe this information is already sufficient to check if this function needs further checks or a different error handling?

We suspect that the exception might be related to a DB pool being drained by another process, as our logs contain the following error message approx. 100ms earlier:

Acquiring client from pool timed out. Please review your system setup, transaction handling, and pool configuration. Pool State: borrowed: 10, pending: 0, size: 10, available: 0, max: 10

Stack Trace

TypeError: Cannot read properties of undefined (reading 'closeResultSet'),
at ResultSet.sendClose (/home/vcap/app/node_modules/hdb/lib/protocol/ResultSet.js:299:20),
at callEmitEndAndClose (/home/vcap/app/node_modules/hdb/lib/protocol/ResultSet.js:153:15),
at /home/vcap/app/dynatrace/oneagent/agent/bin/
1.299.50.20240930-123825/any/nodejs/nodejsagent.js:2273:48,
at t.runInContext (/home/vcap/app/dynatrace/oneagent/agent/bin/1.299.50.20240930-123825/any/
nodejs/nodejsagent.js:2384:24),
at callEmitEndAndClose (/home/vcap/app/dynatrace/oneagent/agent/bin/1.299.50.20240930-123825/any/nodejs/nodejsagent.js:2
273:18),
at process.processTicksAndRejections (node:internal/process/task_queues:77:11)

Version Information

npm ls hdb
├─┬ @sap/[email protected]
│ └─┬ @sap/[email protected]
│   ├─┬ @sap/[email protected]
│   │ └── [email protected] deduped
│   └── [email protected]
├─┬ @sap/[email protected]
│ └── [email protected] deduped
├─┬ @sap/[email protected]
│ └─┬ @sap/[email protected]
│   ├─┬ @sap/[email protected]
│   │ └── [email protected] deduped
│   └── [email protected] deduped
@PierreFritsch
Copy link
Author

CC @jan-philip-zieher FYI

@jan-philip-zieher
Copy link

jan-philip-zieher commented Jan 16, 2025

One sidemark to reproduce, we did something like this:

execute() {
 this._connection.init();
 spawn({ tenant: this.request.tenant, user: this.request.user, id: correlationId }, async () => {
  doDbActions(this._connection);
 });
}

and execute() was triggered multiple times at the same time

@IanMcCurdy
Copy link
Collaborator

Thanks for raising this issue. I've discovered that calling ResultSet.close() multiple times on the same object can reproduce this error. Is it possible that your application is doing this? Regardless, we will fix this issue and add appropriate error handling for this case, but perhaps you can fix it on your side in the meantime.

Thanks,
Ian

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants