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

Cannot read property 'nameState' of null #67

Closed
frangrolemund opened this issue Jan 29, 2021 · 2 comments · Fixed by #69
Closed

Cannot read property 'nameState' of null #67

frangrolemund opened this issue Jan 29, 2021 · 2 comments · Fixed by #69
Assignees
Labels
bug Something isn't working

Comments

@frangrolemund
Copy link

Description

After performing the NewRelic Apollo integration I've started noticing the following in our logs. This doesn't mean a whole lot but did notice this reported in the koa integration back in June - wondering if maybe it is related here. Apologies for the poor format:

2021-01-29T10:44:44.636Z [WARN] Cannot read property 'nameState' of null Context: {"error":{"message":"Cannot read property 'nameState' of null","extensions":{"code":"INTERNAL_SERVER_ERROR","exception":{"stacktrace":["TypeError: Cannot read property 'nameState' of null"," at setTransactionName (/usr/cocina/node_modules/@newrelic/apollo-server-plugin/lib/create-plugin.js:314:33)"," at Object.willSendResponse (/usr/cocina/node_modules/@newrelic/apollo-server-plugin/lib/create-plugin.js:224:11)"," at /usr/cocina/node_modules/apollo-server-core/dist/utils/dispatcher.js:21:31"," at Array.map (<anonymous>)"," at Dispatcher.callTargets (/usr/cocina/node_modules/apollo-server-core/dist/utils/dispatcher.js:18:24)"," at Dispatcher.<anonymous> (/usr/cocina/node_modules/apollo-server-core/dist/utils/dispatcher.js:27:43)"," at Generator.next (<anonymous>)"," at /usr/cocina/node_modules/apollo-server-core/dist/utils/dispatcher.js:8:71"," at new Promise (<anonymous>)"," at __awaiter (/usr/cocina/node_modules/apollo-server-core/dist/utils/dispatcher.js:4:12)"]}},"name":"TypeError"}}

Expected Behavior

I'd like to not have this error appear in the logs either by changing my integration somehow or updating the package if necessary.

Steps to Reproduce

Not clear what triggers this error.

Your Environment

Node v12.14.1
Apollo Server Express 2.17.0

Additional context

We're also instrumented with AWS Xray as well.

@frangrolemund frangrolemund added bug Something isn't working needs-triage labels Jan 29, 2021
@michaelgoin
Copy link
Member

Interesting. Really surprised there would be state loss introduced mid-plugin execution.

Do you by chance have any other custom or 3rd-party plugins in use?

We can handle this symptom, though. We can grab the transaction off of the operation segment.

Thank you for letting us know and sorry for the inconvenience!

@realproven
Copy link

Thanks for looking at this, much appreciated!

We're also instrumenting with AWS Xray at the same time which is operating as custom Express middleware but not an Apollo plugin per-se. I'm somewhat surprised the two coexist as well as they do and generally speaking I get good information, it is just that there are certain scenarios that throw this error above that I can't nail down. If it can be masked at least, that would really be awesome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
3 participants