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:  ELIFECYCLE Command failed with exit code 141 on automatic tests. #6321

Closed
Juubes opened this issue Nov 22, 2023 · 3 comments
Closed
Labels
blocked/more-info-needed More info is needed from the requester. If no response in 14 days, it will become stale.

Comments

@Juubes
Copy link

Juubes commented Nov 22, 2023

I spent about six hours debugging this and figured out what's up.

Description:

I had a bug with the sam local start-api command. The CLI command throws 141 and exits the whole stack. No other info. I was running automated tests against a local backend environment. I have an API Gateway + Authorizers + Lambda + DynamoDB stack. I'm using remote DynamoDB. We're also using CDK and testing it locally with SAM. I couldn't reproduce the error with Postman. I fixed the error with 5s -> 30s timeout on tests

Steps to reproduce:

  1. Start the API Gateway + Lambdas stack with sam local start-api
  2. Run automatic tests with Jest + supertest
  3. Make a request to the local backend with
import * as request from 'supertest';

const res = await request(API_URL)
  .get('account/data')
  .send();

Observed result:

2023-11-22 23:22:46,285 | Starting a timer for 3 seconds for function 'GetAccountDataFunction'                                        
START RequestId: 42b2fbe9-fc18-4063-82b4-5f58c82d8d19 Version: $LATEST
END RequestId: 42b2fbe9-fc18-4063-82b4-5f58c82d8d19
REPORT RequestId: 42b2fbe9-fc18-4063-82b4-5f58c82d8d19  Init Duration: 0.12 ms  Duration: 494.41 ms     Billed Duration: 495 ms Memory Size: 128 MB   Max Memory Used: 128 MB

2023-11-22 23:22:47,982 | Cleaning all decompressed code dirs                                                                         
2023-11-22 23:22:47,982 | No Content-Type given. Defaulting to 'application/json'.                                                    
2023-11-22 23:22:47 127.0.0.1 - - [22/Nov/2023 23:22:47] "GET /v1/d/account/data HTTP/1.1" 200 -
 ELIFECYCLE  Command failed with exit code 141.

Sometimes the backend crashes on different functions. We now know it's about the timeout of the frontend.

Expected result:

No error

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

Linux, running inside a VSCode dev container. CDK through NPM.

SAM info:
{
"version": "1.99.0",
"system": {
"python": "3.11.3",
"os": "Linux-6.5.4-76060504-generic-x86_64-with-glibc2.35"
},
"additional_dependencies": {
"docker_engine": "24.0.7-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"
]
}

@Juubes Juubes added the stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at. label Nov 22, 2023
@mildaniel
Copy link
Contributor

Hi @Juubes, thanks for raising this issue. I'm having some trouble reproducing, are you able to provide a minimal sample app that you're able to reproduce with?

@mildaniel mildaniel added 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. labels Nov 23, 2023
@mildaniel
Copy link
Contributor

Closing due to inactivity. If the issue persists, please open a new issue.

Copy link
Contributor

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

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