Enabling XRay tracing on an existing stack fails
See original GitHub issueBug Report
Description
When enabling AWS X-Ray tracing on an existing stack, the update fails with the following error:
An error occurred: HelloLambdaFunction - The provided execution role does not have permissions to call PutTraceSegments on XRAY (Service: AWSLambdaInternal; Status Code: 400; Error Code: InvalidParameterValueException; Request ID: ********-****-****-****-************).
This error does not seem to be reproducible 100% of the time and appears to be a race to update the Lambda Execution role and the function itself.
These CloudFormation logs show the IamRoleUpdate commenced after the function configuration update:
-
What did you do?
- Deploy a Serverless stack with tracing disable
- Update
provider.tracing.lambda
totrue
- Re-deploy the stack
-
What happened?
- The error
The provided execution role does not have permissions to call PutTraceSegments on XRAY
is returned and the stack does not update
- The error
-
What should’ve happened?
- The stack updates, grants the necessary permissions to the execution role, and enables Lambda X-Ray tracing
-
What’s the content of your
serverless.yml
file?- Initial stack creation:
service: name: xray-permissions provider: name: aws runtime: nodejs10.x functions: hello: handler: handler.hello events: - http: method: get path: hello
- Update:
service: name: xray-permissions provider: name: aws runtime: nodejs10.x tracing: lambda: true # This has been enabled after creation functions: hello: handler: handler.hello events: - http: method: get path: hello
-
What’s the output you get when you use the
SLS_DEBUG=*
environment variable (e.g.SLS_DEBUG=* serverless deploy
)- I didn’t manage to capture this debug information but will update the information when I can reproduce the issue reliably.
Similar or dependent issues:
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:19 (9 by maintainers)
Top Results From Across the Web
Enable Tracing for a Project - AWS CodeStar
AWS X-Ray offers tracing, which you can use to analyze performance behavior of distributed applications (for example, latencies in response times).
Read more >Enabling AWS X-Ray on AWS Lambda
Another issue is when you have an existing stack/role that you want to add the X-Ray permissions to and enable TraceConfig in the...
Read more >Tips and Tricks: Ray Tracing Best Practices
This post presents best practices for implementing ray tracing in games and other real-time graphics applications.
Read more >OptiX does not show up - ParaView Support
But when I enable ray tracing OptiX backend is not available. ... in comm 0): Fatal error in PMPI_Init: Other MPI error, error...
Read more >Minecraft with Ray Tracing and Advanced Graphics FAQ
Download ray tracing enabled packs in the Minecraft Marketplace. Many free worlds featuring PBR and ray tracing are available in the Minecraft Marketplace,...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@jamesmbourne thanks for report. Technically this can happen when you provide a custom execution role (via
provider.role
or viarole
directly in a function configuration).Can you confirm it’s not the case?
As, if default role is used, exactly those permissions are set: https://github.com/serverless/serverless/blob/55c259f994b0062d60c64407f0bec6f17ef44d57/lib/plugins/aws/package/compile/functions/index.js#L319-L332
@bisoldi it means that it needs to be reported at plugin repository, as it’s an issue over there