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

TypeError: Cannot read properties of null (reading 'propagateTraceContextHeaders') #4138

Closed
qlp-mathias opened this issue Jul 15, 2024 · 1 comment · Fixed by #4168
Closed
Assignees

Comments

@qlp-mathias
Copy link

parentSpan.propagateTraceContextHeaders(

For some reason we ran into the case that parentSpan was null and the above line triggered an outage on one of our customer facing services.

Screenshot 2024-07-15 at 13 11 48

@trentm
Copy link
Member

trentm commented Jul 30, 2024

Can repro with:

cd test/instrumentation/modules/@aws-sdk/fixtures
# ... setup other AWS envvars to use localstack
TEST_ENDPOINT=http://localhost:4566 node use-client-sns.js | ecslog

Log output:

[2024-07-30T17:14:23.324Z] ERROR (elastic-apm-node): useClientSNS rejected
    error: {
        "type": "TypeError",
        "message": "Cannot read properties of null (reading 'propagateTraceContextHeaders')",
        "stack_trace":
            TypeError: Cannot read properties of null (reading 'propagateTraceContextHeaders')
                at /Users/trentm/el/apm-agent-nodejs/lib/instrumentation/modules/@aws-sdk/client-sns.js:52:22
                at SNSClient.send (/Users/trentm/el/apm-agent-nodejs/node_modules/@smithy/smithy-client/dist-cjs/client.js:20:20)
                at SNSClient._wrappedSmithyClientSend (/Users/trentm/el/apm-agent-nodejs/lib/instrumentation/modules/@smithy/smithy-client.js:158:21)
                at useClientSNS (/Users/trentm/el/apm-agent-nodejs/test/instrumentation/modules/@aws-sdk/fixtures/use-client-sns.js:83:26)
    }

@trentm trentm self-assigned this Jul 30, 2024
@trentm trentm removed the triage label Jul 30, 2024
trentm added a commit that referenced this issue Jul 30, 2024
…tion

Before this change, instrumentation of `@aws-sdk/client-sns` would *crash*
if there wasn't a current transaction.

Fixes: #4138
trentm added a commit that referenced this issue Jul 30, 2024
…tion (#4168)

Before this change, instrumentation of `@aws-sdk/client-sns` would *crash*
if there wasn't a current transaction.

Fixes: #4138
trentm added a commit that referenced this issue Aug 1, 2024
…tion (#4168)

Before this change, instrumentation of `@aws-sdk/client-sns` would *crash*
if there wasn't a current transaction.

Fixes: #4138
PeterEinberger pushed a commit to fpm-git/apm-agent-nodejs that referenced this issue Aug 20, 2024
…tion (elastic#4168)

Before this change, instrumentation of `@aws-sdk/client-sns` would *crash*
if there wasn't a current transaction.

Fixes: elastic#4138
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants