Skip to content

fix: wrong aws lambda handler name#13

Merged
DavidVujic merged 1 commit intoDavidVujic:mainfrom
yhkee0404:patch-1
Apr 19, 2024
Merged

fix: wrong aws lambda handler name#13
DavidVujic merged 1 commit intoDavidVujic:mainfrom
yhkee0404:patch-1

Conversation

@yhkee0404
Copy link
Contributor

@yhkee0404 yhkee0404 commented Apr 19, 2024

fixes the following two errors:

➜  my_aws_lambda_project git:(main) ✗ serverless invoke --function hello         <aws:developer>
Running "serverless" from node_modules
{
    "errorMessage": "Unable to import module 'example.messages_lambda.core': No module named 'example.messages_lambda'",
    "errorType": "Runtime.ImportModuleError",
    "requestId": "9190cef9-a491-4729-b1d8-af66a6593314",
    "stackTrace": []
}
Environment: darwin, node 18.14.0, framework 3.30.1 (local) 3.34.0v (global), plugin 6.2.3, SDK 4.5.1
Credentials: Local, "developer" profile
Docs:        docs.serverless.com
Support:     forum.serverless.com
Bugs:        github.com/serverless/serverless/issues

Error:
Invoked function failed
➜  my_aws_lambda_project git:(main) ✗ serverless invoke local --function hello   <aws:developer>
Running "serverless" from node_modules
Traceback (most recent call last):
  File "/Users/yhkee0404/python-polylith-example/projects/my_aws_lambda_project/node_modules/serverless/lib/plugins/aws/invoke-local/runtime-wrappers/invoke.py", line 80, in <module>

    module = import_module(args.handler_path.replace('/', '.'))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/yhkee0404/.asdf/installs/python/3.11.9/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1126, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1140, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'example.messages_lambda'

Environment: darwin, node 18.14.0, framework 3.30.1 (local) 3.34.0v (global), plugin 6.2.3, SDK 4.5.1
Credentials: Local, "developer" profile
Docs:        docs.serverless.com
Support:     forum.serverless.com
Bugs:        github.com/serverless/serverless/issues

Error:
Error: `python3 -u /Users/yhkee0404/python-polylith-example/projects/my_aws_lambda_project/node_modules/serverless/lib/plugins/aws/invoke-local/runtime-wrappers/invoke.py example.messages_lambda.core handler` Exited with code 1
    at ChildProcess.<anonymous> (/Users/yhkee0404/python-polylith-example/projects/my_aws_lambda_project/node_modules/child-process-ext/spawn.js:38:8)
    at ChildProcess.emit (node:events:513:28)
    at ChildProcess.emit (node:domain:489:12)
    at maybeClose (node:internal/child_process:1091:16)
    at ChildProcess._handle.onexit (node:internal/child_process:302:5)

@DavidVujic
Copy link
Owner

Thank you @yhkee0404 for fixing this one!

@DavidVujic DavidVujic self-requested a review April 19, 2024 06:07
Copy link
Owner

@DavidVujic DavidVujic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏 ⭐

@DavidVujic DavidVujic merged commit 8bf09de into DavidVujic:main Apr 19, 2024
@yhkee0404 yhkee0404 deleted the patch-1 branch April 19, 2024 10:03
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

Successfully merging this pull request may close these issues.

2 participants