Skip to content

Regression in handlers supported by bootstrap #43

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

Closed
rli opened this issue Jun 23, 2021 · 1 comment
Closed

Regression in handlers supported by bootstrap #43

rli opened this issue Jun 23, 2021 · 1 comment

Comments

@rli
Copy link

rli commented Jun 23, 2021

For the deployed python3.8 runtime on AWS today, the following Lambda is valid:

Handler: src/hello_world.app.lambda_handler
Tree as displayed in Lambda console:

py38test/
  src/
    hello_world/
        __init__.py
        app.py

app.py:

import os
import json

def lambda_handler(event, context):
    # TODO implement
    return {
        'statusCode': 200,
        'body': os.getenv('_HANDLER')
    }

Execution result:

Response
{
  "statusCode": 200,
  "body": "src/hello_world.app.lambda_handler"
}

Function Logs
START RequestId: 1518390e-9e46-43e2-a094-87eac6a55448 Version: $LATEST
END RequestId: 1518390e-9e46-43e2-a094-87eac6a55448
REPORT RequestId: 1518390e-9e46-43e2-a094-87eac6a55448	Duration: 1.01 ms	Billed Duration: 2 ms	Memory Size: 128 MB	Max Memory Used: 51 MB	Init Duration: 118.78 ms

However, a local container with the latest awslambdaric fails to run the same lambda:

{"errorMessage": "Unable to import module 'src/hello_world.app': No module named 'src/hello_world'", "errorType": "Runtime.ImportModuleError", "requestId": "33685819-deae-4fb0-aae1-97c81f7aa9e4", "stackTrace": []}

This change in behavior appears to be introduced by 620b148. Is this intended behavior? Since the handler above works on Lambda today, this appears to be customer-breaking.

@carlzogh
Copy link
Contributor

Thanks for the report @rli - This has since been addressed in #45 and is going to be released as part of the 1.2.0 version of the awslambdaric package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants