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: TITLE Bug: sam local invoke - error #7843

Open
chriseugenerodriguez opened this issue Jan 23, 2025 · 2 comments
Open

Bug: TITLE Bug: sam local invoke - error #7843

chriseugenerodriguez opened this issue Jan 23, 2025 · 2 comments
Labels
blocked/more-info-needed More info is needed from the requester. If no response in 14 days, it will become stale.

Comments

@chriseugenerodriguez
Copy link

running sam local invoke locally throough vs-code. getting this error on method: sam local invoke.

Description:

[*] Deploy: sam deploy --guided --template-file ..\..\..\..\..\..\chris.rodriguez\AppData\Local\Temp\aws-toolkit-vscode\vsctk1eac7a2a\output\template.yaml
2025-01-22 16:14:00.798 [info] Invoking index.handler (nodejs18.x)
2025-01-22 16:14:02.375 [info] Local image is up-to-date
2025-01-22 16:14:02.386 [info] Using local image: public.ecr.aws/lambda/nodejs:18-rapid-x86_64.
2025-01-22 16:14:02.386 [info] Mounting C:\Users\CHRIS~1.ROD\AppData\Local\Temp\aws-toolkit-vscode\vsctk1eac7a2a\output\openbookActivityOperationsEmail as /var/task:ro,delegated, inside runtime container
2025-01-22 16:14:04.320 [info] Error: (109, 'GetOverlappedResult', 'The pipe has been ended.')
Traceback:
  File "C:\Program Files\Amazon\AWSSAMCLI\runtime\Lib\site-packages\click\core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "C:\Program Files\Amazon\AWSSAMCLI\runtime\Lib\site-packages\click\core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Amazon\AWSSAMCLI\runtime\Lib\site-packages\click\core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Amazon\AWSSAMCLI\runtime\Lib\site-packages\click\core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Amazon\AWSSAMCLI\runtime\Lib\site-packages\click\core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Amazon\AWSSAMCLI\runtime\Lib\site-packages\samcli\cli\cli_config_file.py", line 347, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Amazon\AWSSAMCLI\runtime\Lib\site-packages\click\decorators.py", line 92, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Amazon\AWSSAMCLI\runtime\Lib\site-packages\click\core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Amazon\AWSSAMCLI\runtime\Lib\site-packages\samcli\lib\telemetry\metric.py", line 185, in wrapped
    raise exception  # pylint: disable=raising-bad-type
    ^^^^^^^^^^^^^^^
  File "C:\Program Files\Amazon\AWSSAMCLI\runtime\Lib\site-packages\samcli\lib\telemetry\metric.py", line 150, in wrapped
    return_value = func(*args, **kwargs)
                   ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Amazon\AWSSAMCLI\runtime\Lib\site-packages\samcli\lib\utils\version_checker.py", line 43, in wrapped
    actual_result = func(*args, **kwargs)
                    ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Amazon\AWSSAMCLI\runtime\Lib\site-packages\samcli\cli\main.py", line 95, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Amazon\AWSSAMCLI\runtime\Lib\site-packages\samcli\commands\local\invoke\cli.py", line 108, in cli
    do_cli(
  File "C:\Program Files\Amazon\AWSSAMCLI\runtime\Lib\site-packages\samcli\commands\local\invoke\cli.py", line 209, in do_cli
    context.local_lambda_runner.invoke(
  File "C:\Program Files\Amazon\AWSSAMCLI\runtime\Lib\site-packages\samcli\commands\local\lib\local_lambda.py", line 166, in invoke
    self.local_runtime.invoke(
  File "C:\Program Files\Amazon\AWSSAMCLI\runtime\Lib\site-packages\samcli\lib\telemetry\metric.py", line 325, in wrapped_func
    return_value = func(*args, **kwargs)
                   ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Amazon\AWSSAMCLI\runtime\Lib\site-packages\samcli\local\lambdafn\runtime.py", line 224, in invoke
    container = self.create(
                ^^^^^^^^^^^^
  File "C:\Program Files\Amazon\AWSSAMCLI\runtime\Lib\site-packages\samcli\local\lambdafn\runtime.py", line 116, in create
    self._container_manager.create(container)
  File "C:\Program Files\Amazon\AWSSAMCLI\runtime\Lib\site-packages\samcli\local\docker\manager.py", line 96, in create
    container.create()
  File "C:\Program Files\Amazon\AWSSAMCLI\runtime\Lib\site-packages\samcli\local\docker\container.py", line 240, in create
    real_container = self.docker_client.containers.create(self._image, **kwargs)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Amazon\AWSSAMCLI\runtime\Lib\site-packages\docker\models\containers.py", line 935, in create
    resp = self.client.api.create_container(**create_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Amazon\AWSSAMCLI\runtime\Lib\site-packages\docker\api\container.py", line 440, in create_container
    return self.create_container_from_config(config, name, platform)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Amazon\AWSSAMCLI\runtime\Lib\site-packages\docker\api\container.py", line 456, in create_container_from_config
    res = self._post_json(u, data=config, params=params)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Amazon\AWSSAMCLI\runtime\Lib\site-packages\docker\api\client.py", line 303, in _post_json
    return self._post(url, data=json.dumps(data2), **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Amazon\AWSSAMCLI\runtime\Lib\site-packages\docker\utils\decorators.py", line 44, in inner
    return f(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Amazon\AWSSAMCLI\runtime\Lib\site-packages\docker\api\client.py", line 242, in _post
    return self.post(url, **self._set_request_timeout(kwargs))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Amazon\AWSSAMCLI\runtime\Lib\site-packages\requests\sessions.py", line 637, in post
    return self.request("POST", url, data=data, json=json, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Amazon\AWSSAMCLI\runtime\Lib\site-packages\requests\sessions.py", line 589, in request
    resp = self.send(prep, **send_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Amazon\AWSSAMCLI\runtime\Lib\site-packages\requests\sessions.py", line 703, in send
    r = adapter.send(request, **kwargs)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Amazon\AWSSAMCLI\runtime\Lib\site-packages\requests\adapters.py", line 667, in send
    resp = conn.urlopen(
           ^^^^^^^^^^^^^
  File "C:\Program Files\Amazon\AWSSAMCLI\runtime\Lib\site-packages\urllib3\connectionpool.py", line 789, in urlopen
    response = self._make_request(
               ^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Amazon\AWSSAMCLI\runtime\Lib\site-packages\urllib3\connectionpool.py", line 536, in _make_request
    response = conn.getresponse()
               ^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Amazon\AWSSAMCLI\runtime\Lib\site-packages\urllib3\connection.py", line 507, in getresponse
    httplib_response = super().getresponse()
                       ^^^^^^^^^^^^^^^^^^^^^
  File "http\client.py", line 1428, in getresponse
  File "http\client.py", line 331, in begin
  File "http\client.py", line 292, in _read_status
  File "C:\Program Files\Amazon\AWSSAMCLI\runtime\Lib\site-packages\docker\transport\npipesocket.py", line 224, in readinto
    return self.sock.recv_into(buf)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Amazon\AWSSAMCLI\runtime\Lib\site-packages\docker\transport\npipesocket.py", line 25, in wrapped
    return f(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Amazon\AWSSAMCLI\runtime\Lib\site-packages\docker\transport\npipesocket.py", line 152, in recv_into
    return win32file.GetOverlappedResult(self._handle, overlapped, 0)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

An unexpected error was encountered while executing "sam local invoke".
Search for an existing issue:

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

  1. OS: Windows 10 Pro
  2. SAM CLI, version 1.132.0
  3. AWS region: us-1-east
{
  "version": "1.132.0",
  "system": {
    "python": "3.12.6",
    "os": "Windows-10-10.0.19044-SP0" 
  },
  "additional_dependencies": {        
    "docker_engine": "27.4.0",        
    "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"  
  ]
}

Add --debug flag to command you are running

@chriseugenerodriguez chriseugenerodriguez added the stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at. label Jan 23, 2025
@roger-zhangg
Copy link
Member

This seems like a Docker named pipes communication error. Did you tried restarting the docker daemon, or restarting the host machine to see if this error still exist. And if the issue still exist, I want to know if the docker is running in WSL2 or in windows?

@chriseugenerodriguez
Copy link
Author

chriseugenerodriguez commented Jan 24, 2025 via email

@roger-zhangg roger-zhangg added stage/needs-feedback Needs feedback from the community (are you also interested in/experiencing this?) blocked/more-info-needed More info is needed from the requester. If no response in 14 days, it will become stale. and removed stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at. stage/needs-feedback Needs feedback from the community (are you also interested in/experiencing this?) labels Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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