Skip to content

Regression in handlers supported by bootstrap #43

Closed
@rli

Description

@rli

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions