Open mat-patrickschmelter opened 9 months ago
For reference, from your logs:
2024-02-07 14:33:06.607 [info] START RequestId: e703ce28-44c0-4696-adc5-7800faca205d Version: $LATEST
2024-02-07 14:33:06.668 [info] Prepending Lambda task root to path: /var/task
Starting debugger...
2024-02-07 14:33:06.678 [info] Traceback (most recent call last):
File "/tmp/lambci_debug_files/py_debug_wrapper.py", line 46, in <module>
runpy.run_module('debugpy', run_name='__main__')
File "/var/lang/lib/python3.9/runpy.py", line 221, in run_module
mod_name, mod_spec, code = _get_module_details(mod_name)
File "/var/lang/lib/python3.9/runpy.py", line 141, in _get_module_details
raise error("No module named { raw: true }" % mod_name)
ImportError: No module named debugpy
But also, in the target: code
case, sam build
fails because it was expecting python 3.9?
2024-02-07 14:37:33.882 [info] 2024-02-07 14:37:33,875 | Invalid executable for python at /Users/...path.../.pyenv/shims/python
Traceback (most recent call last):
File "/usr/local/Cellar/aws-sam-cli/1.107.0/libexec/lib/python3.12/site-packages/aws_lambda_builders/workflow.py", line 85, in wrapper
valid_path = binary_checker.validator.validate(executable_path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/aws-sam-cli/1.107.0/libexec/lib/python3.12/site-packages/aws_lambda_builders/workflows/python_pip/validator.py", line 52, in validate
raise MisMatchRuntimeError(language=self.language, required_runtime=self.runtime, runtime_path=runtime_path)
aws_lambda_builders.exceptions.MisMatchRuntimeError: python executable found in your path does not match runtime.
Expected version: python3.9, Found a different version at /Users/...path.../.pyenv/shims/python.
Possibly related: https://github.com/awslabs/aws-lambda-builders/issues/30
It could be getting confused because of virtualenv or pyenv: https://github.com/aws/aws-toolkit-vscode/issues/1779
Try setting containerBuild
(documentation) in the launch config. That tells sam to build in the Docker container, which avoids having to worry about python compatibility on your local machine / host system.
Problem
I can not get the local Lambda debugger to work
Steps to reproduce the issue
Create Lambda function with
sam init
. Choose the HelloWorld sample applicaiton, name it HelloWorldFunctionCreate Launch configuration
add
debugpy
torequirements.txt
Invoke
HelloWorld template
debug session Log: https://pastebin.com/QheCQdepInvoke
HelloWorld code
debug session Log: https://pastebin.com/KKve3vzqExpected behavior
Debugging works
System details (run the
AWS: About Toolkit
command)OS: Darwin x64 23.2.0 Visual Studio Code extension host: 1.85.1 AWS Toolkit: 2.8.0 node: 18.15.0 electron: 25.9.7