Timeout while waiting for command: "sam local invoke"
Asked Answered
M

1

6

I'm building server less applications using AWS SAM

SAM + VSCode + Docker desktop

Everything was working fine, but suddenly I started getting timeout error when I run debug.

Note: sam local invoke (without debug) works fine.

Problem occurs when i run debug mode (i.e. F5), it stops as shown below. Could this be problem with networking? python version? Debug was working before.

Note also: I have host windows 10 machine, I'm running a Windows 10 VM (HyperV) within the host, in which I have this is dev environment setup.

Below is log:

    2021-05-20 11:43:48 [INFO]: Preparing to debug locally: Lambda "qa.lambdaHandler"
    2021-05-20 11:43:48 [INFO]: Building SAM application...
    2021-05-20 11:43:48 [INFO]: Running command: (not started) [C:\Program Files\Amazon\AWSSAMCLI\bin\sam.cmd build --build-dir C:\Users\PK\AppData\Local\Temp\aws-toolkit-vscode\vsctkzhq0Ca\output
--template C:/Users/PK/code/GCMS-AWS/publish-dynamodb/cmsqa/app___vsctk___template.yaml
--base-dir C:/Users/PK/code/GCMS-AWS/publish-dynamodb/cmsqa]
    2021-05-20 11:43:50 [INFO]: Building codeuri: C:/Users/PK/code/GCMS-AWS/publish-dynamodb/cmsqa runtime: nodejs12.x metadata: {} functions: ['cmsqa']
    
    2021-05-20 11:43:50 [INFO]: Running NodejsNpmBuilder:NpmPack
    
    2021-05-20 11:44:02 [INFO]: Running NodejsNpmBuilder:CopyNpmrc
    
    2021-05-20 11:44:02 [INFO]: Running NodejsNpmBuilder:CopySource
    
    2021-05-20 11:44:02 [INFO]: Running NodejsNpmBuilder:NpmInstall
    
    2021-05-20 11:44:28 [INFO]: Running NodejsNpmBuilder:CleanUpNpmrc
    
    2021-05-20 11:44:30 [INFO]: 
    Build Succeeded
    
    2021-05-20 11:44:30 [INFO]: 
    Built Artifacts  : ..\..\Temp\aws-toolkit-vscode\vsctkzhq0Ca\output
    Built Template   : ..\..\Temp\aws-toolkit-vscode\vsctkzhq0Ca\output\template.yaml
    
    Commands you can use next
    =========================
    [*] Invoke Function: sam local invoke -t ..\..\Temp\aws-toolkit-vscode\vsctkzhq0Ca\output\template.yaml
    [*] Deploy: sam deploy --guided --template-file ..\..\Temp\aws-toolkit-vscode\vsctkzhq0Ca\output\template.yaml
        
    
    2021-05-20 11:44:30 [INFO]: Build complete.
    2021-05-20 11:44:30 [INFO]: Starting SAM application locally
    2021-05-20 11:44:30 [INFO]: AWS.running.command
    2021-05-20 11:44:30 [ERROR]: Timeout while waiting for command: "sam local invoke"
    2021-05-20 11:44:30 [ERROR]: Failed to run SAM application locally: Timeout while waiting for command: "sam local invoke"
    
    Command stopped: "sam local invoke"
Madsen answered 20/5, 2021 at 10:7 Comment(0)
M
7

I found the problem after spending lot of time... Need to increase timeout here... screenshot

Madsen answered 20/5, 2021 at 10:13 Comment(1)
can confirm I had same issue and this was indeed the solution. Another plugin or bug in VS Code must have updated this unprompted. WFIW the timeout was set to "1234" (in ms) by something which caused the timeout to happen. I also spent alot of time before finding this solutionOpeneyed

© 2022 - 2024 — McMap. All rights reserved.