DataDog / datadog-lambda-python

The Datadog AWS Lambda Layer for Python
https://docs.datadoghq.com/integrations/amazon_lambda/#installing-and-using-the-datadog-layer
Apache License 2.0
88 stars 46 forks source link

No module named 'ddtrace._trace.utils_botocore' after upgrading to lambda layer 99 #525

Closed babyhuey closed 1 month ago

babyhuey commented 1 month ago

Expected Behavior

App works and responds

Actual Behavior

Failure. Stack trace below.

Rolling back to version 98 fixes all issues

Steps to Reproduce the Problem

  1. Set lambda layer to 99
  2. Set extension to arn:aws:lambda:us-east-1:464622532012:layer:Datadog-Extension:65
  3. Try to do anything

Specifications

Stacktrace

[ERROR] Runtime.ImportModuleError: Unable to import module 'datadog_lambda.handler': No module named 'ddtrace._trace.utils_botocore'

purple4reina commented 1 month ago

Hey @babyhuey, can you share the full traceback you're getting?

purple4reina commented 1 month ago

Hi again @babyhuey. After consulting with the team, we think this could be caused by having multiple versions of ddtrace installed. Are you by chance also including ddtrace in your dependencies? If so, does removing it as a dependency fix the issue?

babyhuey commented 1 month ago

Hi again @babyhuey. After consulting with the team, we think this could be caused by having multiple versions of ddtrace installed. Are you by chance also including ddtrace in your dependencies? If so, does removing it as a dependency fix the issue?

Yep. Apologies. Didn't know my engineers added it. Thanks for pointing me there!

purple4reina commented 1 month ago

No worries, more than happy to help.

Hope this can help others who might see this error message in the future

No module named 'ddtrace._trace.utils_botocore'

The solution is to ensure that you are not also packaging a version of ddtrace or datadog-lambda in your dependencies.