cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

APM Serverless Lambda. Python extension crash. AWS_Execution_Env not supported

Hello,

 

I'm trying to implement APM Serverless for AWS Lambda in a Python function. The function is deployed via a container image, so the extension is built as a layer in the Dockerfile.

 

Firstly, in case someone is trying to auto instrument this process; The extension must be unzipped into /opt/extensions/ not to /opt/ like suggested in the docs. Otherwise, the Lambda won't see the extension.

 

However, when executing the function, I get the following error:

 

AWS_Execution_Env is not supported, running lambda with default arguments.

EXTENSION Name: appdynamics-extension-script State: Started Events: []

Start RequestId

End RequestId

Error: exit code 0 Extension.Crash

 

Without more information. Any idea what could be causing said crash?

 

Thanks!

1 REPLY 1

Kenji.Kumada
AppDynamics Team
Hi @alejandro.Checa Grande,

Thank you for your post to the community!

From the given information, I see two possible issues that caused the crash.

* the environment varialbe "AWS_Execution_Env" doesn't seem correctly set
* unzipping the extension to /opt/extension

This message "AWS_Execution_Env is not supported, running lambda with default arguments." is from the appdynamics extension script. This message is shown when the execution environment is not Python or Node.js. Could you check if the environment variable "AWS_EXECUTION_ENV" is set? I wrote out the environment variable and in my environment with python 3.7, it was set as "AWS_Lambda_python3.7".

For the second issue, it is not clear whether you should unzip to /opt or /opt/extension. It doesn't seem necessary to put your extention in /opt/extension if it's internal extension. You can have a look to this link.


By the way, I followed the instructions in "Add the AWS Lambda Extension to Your Function when packaged as a container image" section in this documentation page

and it worked fine. You can have a look and see if there is any inconsistent setting in your container image. In this setting, the appdynamics extension script is located in /opt, not /opt/extension. It may be that it crashed because the extension script is executed as an external extension (as you put it in /opt/extension) but I cannot conclude with the provided information.

Hope this answer helps!

Best regards,
Kenji
On-Demand Webinar
Discover new Splunk integrations and AI innovations for Cisco AppDynamics.


Register Now!

Observe and Explore
Dive into our Community Blog for the Latest Insights and Updates!


Read the blog here