-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
Running the Lambda container image built from bugfix/import-error fails immediately with Runtime.ImportModuleError: attempted relative import with no known parent package because the Dockerfile flattens the src directory and the handler imports src.*, so the src package is missing at runtime.
To Reproduce
- Build and push the Lambda container image using the existing Dockerfile (copies
src/contents directly into$LAMBDA_TASK_ROOT). - Deploy the image via Terraform with handler
event_gate_lambda.lambda_handler. - Invoke the Lambda; CloudWatch logs show
Runtime.ImportModuleError: Unable to import module 'event_gate_lambda': attempted relative import with no known parent package.
Expected behavior
The Lambda container should load src.event_gate_lambda.lambda_handler, resolve src.* imports, and execute without an import error.
Screenshots
N/A
Additional context
The fix was to copy src intact into $LAMBDA_TASK_ROOT/src and set both the container CMD and Terraform handler to src.event_gate_lambda.lambda_handler so Python can locate the package structure.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working