data-api-client icon indicating copy to clipboard operation
data-api-client copied to clipboard

Error tracing issues

Open ffxsam opened this issue 2 years ago • 2 comments

Has anyone else noticed your stack traces don't seem to go back as far as they should when there's a SQL error?

    "stack": [
        "BadRequestException: Number of characters in SQLStatement is longer than 65536",
        "    at Object.extractError (/var/runtime/node_modules/aws-sdk/lib/protocol/json.js:52:27)",
        "    at Request.extractError (/var/runtime/node_modules/aws-sdk/lib/protocol/rest_json.js:55:8)",
        "    at Request.callListeners (/var/runtime/node_modules/aws-sdk/lib/sequential_executor.js:106:20)",
        "    at Request.emit (/var/runtime/node_modules/aws-sdk/lib/sequential_executor.js:78:10)",
        "    at Request.emit (/var/runtime/node_modules/aws-sdk/lib/request.js:688:14)",
        "    at Request.transition (/var/runtime/node_modules/aws-sdk/lib/request.js:22:10)",
        "    at AcceptorStateMachine.runTo (/var/runtime/node_modules/aws-sdk/lib/state_machine.js:14:12)",
        "    at /var/runtime/node_modules/aws-sdk/lib/state_machine.js:26:10",
        "    at Request.<anonymous> (/var/runtime/node_modules/aws-sdk/lib/request.js:38:9)",
        "    at Request.<anonymous> (/var/runtime/node_modules/aws-sdk/lib/request.js:690:12)"
    ]

I wonder why it starts within the AWS SDK library, and not my actual code. Anyone know? It makes it incredibly difficult to debug issues.

ffxsam avatar Jan 05 '22 00:01 ffxsam

I'm not sure what the underlying reason is but it looks like a general problem with errors from the AWS JS SDK https://github.com/aws/aws-sdk-js/issues/1358. A comment on that issue says that it has been fixed in the v3 SDK as it needed a major version change https://github.com/aws/aws-sdk-js/issues/1358#issuecomment-754494140

cnnrmtthws avatar Jan 14 '22 12:01 cnnrmtthws

I've patched my own personal version of data-api-client to use the v3 SDK. I'll have to pay attention to whether db errors trace differently now.

ffxsam avatar Jan 14 '22 22:01 ffxsam