Skip to content
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

Bug: sam local invoke - APIError #7668

Open
aratatous opened this issue Nov 11, 2024 · 1 comment
Open

Bug: sam local invoke - APIError #7668

aratatous opened this issue Nov 11, 2024 · 1 comment
Labels
area/debugging blocked/more-info-needed More info is needed from the requester. If no response in 14 days, it will become stale.

Comments

@aratatous
Copy link

Description:

Lambda Plugin run works fine, but debug fails

Steps to reproduce:

Try to run a lambda with Lambda AWS plugin in debug mode.

Observed result:

Error: 500 Server Error for http+docker://localhost/v1.35/containers/99ca22218a9b69add0520c8fa423ccf4039cf45cdca0abccb7f07076afe01215/start: Internal Server Error ("error while creating mount source path '/host_mnt/Applications/PyCharm.app/Contents/plugins/python-ce/helpers/pydev': mkdir /host_mnt/Applications/PyCharm.app/Contents/plugins/python-ce/helpers/pydev: file exists")
Traceback:
File "click/core.py", line 1078, in main
File "click/core.py", line 1688, in invoke
File "click/core.py", line 1688, in invoke
File "click/core.py", line 1434, in invoke
File "click/core.py", line 783, in invoke
File "samcli/cli/cli_config_file.py", line 347, in wrapper
File "click/decorators.py", line 92, in new_func
File "click/core.py", line 783, in invoke
File "samcli/lib/telemetry/metric.py", line 185, in wrapped
File "samcli/lib/telemetry/metric.py", line 150, in wrapped
File "samcli/lib/utils/version_checker.py", line 43, in wrapped
File "samcli/cli/main.py", line 95, in wrapper
File "samcli/commands/local/invoke/cli.py", line 108, in cli
File "samcli/commands/local/invoke/cli.py", line 209, in do_cli
File "samcli/commands/local/lib/local_lambda.py", line 166, in invoke
File "samcli/lib/telemetry/metric.py", line 325, in wrapped_func
File "samcli/local/lambdafn/runtime.py", line 227, in invoke
File "samcli/local/lambdafn/runtime.py", line 177, in run
File "samcli/local/docker/manager.py", line 118, in run
File "samcli/local/docker/container.py", line 393, in start
File "samcli/local/docker/container.py", line 389, in start
File "docker/models/containers.py", line 420, in start
File "docker/utils/decorators.py", line 19, in wrapped
File "docker/api/container.py", line 1136, in start
File "docker/api/client.py", line 277, in _raise_for_status
File "docker/errors.py", line 39, in create_api_error_from_http_exception

An unexpected error was encountered while executing "sam local invoke".

Expected result:

I put debug break points in the code, and I expect IDE to stop at those break points for debugging Python Lambda code.

Additional environment details (Ex: Windows, Mac, Amazon Linux etc)

  1. OS:
    Mac OS version 15.1
  2. sam --version:
    SAM CLI, version 1.126.0
  3. AWS region:
    us-west-2
    5-

Paste the output of sam --info here

% sam --info
{
"version": "1.127.0",
"system": {
"python": "3.11.10",
"os": "macOS-15.1-arm64-arm-64bit"
},
"additional_dependencies": {
"docker_engine": "27.3.1",
"aws_cdk": "Not available",
"terraform": "Not available"
},
"available_beta_feature_env_vars": [
"SAM_CLI_BETA_FEATURES",
"SAM_CLI_BETA_BUILD_PERFORMANCE",
"SAM_CLI_BETA_TERRAFORM_SUPPORT",
"SAM_CLI_BETA_RUST_CARGO_LAMBDA"
]
}

@aratatous aratatous added the stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at. label Nov 11, 2024
@mndeveci
Copy link
Contributor

Are you using the AWS plugin for Pycharm here (https://aws.amazon.com/pycharm/)?

@mndeveci mndeveci added blocked/more-info-needed More info is needed from the requester. If no response in 14 days, it will become stale. area/debugging and removed stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at. labels Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/debugging blocked/more-info-needed More info is needed from the requester. If no response in 14 days, it will become stale.
Projects
None yet
Development

No branches or pull requests

2 participants