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

Python 3.10 layer broken (ImportModuleError) #159

Closed
dverheijden opened this issue Jun 20, 2023 · 5 comments
Closed

Python 3.10 layer broken (ImportModuleError) #159

dverheijden opened this issue Jun 20, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@dverheijden
Copy link

Description

When using the new Python 3.10 compatible new relic layer (e.g. arn:aws:lambda:eu-west-1:451483290750:layer:NewRelicPython310:1), our application fails. When deploying the python example and modifying the terraform code, I get the same error.

[ERROR] Runtime.ImportModuleError: Unable to import module 'newrelic_lambda_wrapper': Failed to import module 'app': No module named 'app'

Steps to Reproduce

Deploy the lambda python example with the newest new relic layer and python 3.10 (see also newrelic/newrelic-lambda-extension#157). Deployment then succeeds but testing fails with the above error.

Expected Behaviour

It should be able to import the module

Relevant Logs / Console output

[ERROR] Runtime.ImportModuleError: Unable to import module 'newrelic_lambda_wrapper': Failed to import module 'app': No module named 'app'

Your Environment

  • ex: Browser name and version:
  • ex: Operating System and version:

Additional context

@dverheijden dverheijden added the bug Something isn't working label Jun 20, 2023
@dverheijden dverheijden changed the title Python 3.10 layer ModuleImportError Python 3.10 layer broken (ImportModuleError) Jun 20, 2023
@leslie-alldridge
Copy link

Must be specific to their example code as I was able to use the lambda layer in my own code without problems. Perhaps I could compare the two and find the solution 🤔

@shemanthdazn
Copy link

Any update on this, The issue is with other layers also (3.7,3.8)

@umaannamalai
Copy link
Contributor

Thank you for reporting this. We have reviewed this issue and it looks like we may have a bug in the parsing logic for imported handlers. We are working on a fix for this and will update you on our release timeline once we have a better sense of it.

@umaannamalai
Copy link
Contributor

Hi everyone! We have published a likely fix for this issue. Would you be able to try upgrading to the latest layer for your Python runtime and validate that the error has gone away?

@dverheijden
Copy link
Author

After updating to layer version 9, this problem went away. Thanks for the fix!

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
None yet
Development

No branches or pull requests

4 participants