Skip to content

Bug introduced in #270 causes Chalice deployments to produce failing lambda function #315

@jlujan-invitae

Description

@jlujan-invitae

#270 introduced a bug resulting in failure to deploy and run when using Chalice. The cause is that the Chalice packager does not include the full contents of the chalice wheel/package in the generated deployment zip. Code that was added to support local development imports from chalice.config import Config which fails in a production deployment with the error [ERROR] Runtime.ImportModuleError: Unable to import module 'app': No module named 'chalice.config'. The solution is to refactor the LocalLambdaClient into a separate file and wrap the import in try/catch when in production.

Reproducible in:

slack_bolt==1.5.0
Python 3.8.6
AWS Lambda Python 3.8

Steps to reproduce:

  1. chalice package or chalice deploy

Expected result:

Deployments through chalice should produce working lambda function.

Actual result:

Deployed lambda function fails with error:
[ERROR] Runtime.ImportModuleError: Unable to import module 'app': No module named 'chalice.config'

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions