You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We use the serverless-newrelic-lambda-layers plugin for our lambdas, which pulls the latest newrelic layer. We have experienced an issue whereby the newrelic agent mistakenly identifies the event as an api gateway proxy event when the destination lambda is invoked, then tries to retrieve pathname property from a non-existent request url. This is preventing the lambda from running.
{
"errorType": "TypeError",
"errorMessage": "Cannot read properties of undefined (reading 'pathname')",
"stack": [
"TypeError: Cannot read properties of undefined (reading 'pathname')",
" at Object.scrub (/opt/nodejs/node_modules/newrelic/lib/util/urltils.js:94:27)",
" at setWebRequest (/opt/nodejs/node_modules/newrelic/lib/serverless/aws-lambda.js:328:29)",
" at Runtime.wrappedHandler (/opt/nodejs/node_modules/newrelic/lib/serverless/aws-lambda.js:153:9)",
" at runInContextCb (/opt/nodejs/node_modules/newrelic/lib/shim/shim.js:1188:22)",
" at AsyncLocalStorage.run (node:async_hooks:338:14)",
" at AsyncLocalContextManager.runInContext (/opt/nodejs/node_modules/newrelic/lib/context-manager/async-local-context-manager.js:65:36)",
" at TransactionShim.applySegment (/opt/nodejs/node_modules/newrelic/lib/shim/shim.js:1178:25)",
" at Runtime.transactionWrapper (/opt/nodejs/node_modules/newrelic/lib/shim/transaction-shim.js:414:17)",
" at Runtime.patchHandlerSync [as handler] (/opt/nodejs/node_modules/newrelic-lambda-wrapper/index.js:140:25)",
" at Runtime.handleOnceNonStreaming (file:///var/runtime/index.mjs:1173:29)"
]
}
Steps to Reproduce
This can be replicated by using two lambdas.
One lambda deployed as a destination lambda.
The second lambda, performing any given operation, and configured to invoke the destination lambda on success or failure
After successfully executing the normal lambda operation the destination lambda will not be invoked and the logs will contain the information as per the description re: the undefined object when trying to get the pathname property.
This is the serverless.yml config snippet for reference
I believe it has same root cause as #2291, where the logic to determine if the event is a proxy event only check for version property.
This is problematic because other events can also have "version": "1.0" or "version": "2.0". In this case, the lambda destination invocation event has "version": "1.0"
The text was updated successfully, but these errors were encountered:
Description
We use the serverless-newrelic-lambda-layers plugin for our lambdas, which pulls the latest newrelic layer. We have experienced an issue whereby the newrelic agent mistakenly identifies the event as an api gateway proxy event when the destination lambda is invoked, then tries to retrieve
pathname
property from a non-existent request url. This is preventing the lambda from running.Expected Behavior
The lambda should be executed successfully
Troubleshooting or NR Diag results
this is the error log
Steps to Reproduce
This can be replicated by using two lambdas.
One lambda deployed as a destination lambda.
The second lambda, performing any given operation, and configured to invoke the destination lambda on success or failure
After successfully executing the normal lambda operation the destination lambda will not be invoked and the logs will contain the information as per the description re: the undefined object when trying to get the
pathname
property.This is the serverless.yml config snippet for reference
Your Environment
Additional context
I believe it has same root cause as #2291, where the logic to determine if the event is a proxy event only check for
version
property.This is problematic because other events can also have
"version": "1.0"
or"version": "2.0"
. In this case, the lambda destination invocation event has"version": "1.0"
The text was updated successfully, but these errors were encountered: