Deploy in AWS CodeBuild doesn't wait for build completion
See original GitHub issueThis is a (Bug Report )
Description
For bug reports:
- What went wrong?
Running
sls deploy
in AWS Codebuild, codebuild “finished” the command and moved on before webpack has finished. - What did you expect should have happened? The same as running the command locally; webpack finishes.
- What was the config you used?
- What stacktrace or error message from your provider did you see? Lines omitted for brevity;
[Container] 2020/10/26 16:47:58 Running command npm -v
6.14.4
[Container] 2020/10/26 16:47:58 Running command node -v
v12.18.0
[Container] 2020/10/26 15:55:20 Running command (cd abcdef && npm i && SLS_DEBUG=* npm run deploy-$STAGE -- --force && echo done)
...
271 | Serverless: Invoke deploy
218 | Serverless: Invoke package
219 | Serverless: Invoke aws:common:validate
220 | Serverless: Invoke aws:common:cleanupTempDir
221 | Serverless: Invoke webpack:validate
222 | Serverless: Invoke webpack:compile
223 | Serverless: Bundling with Webpack...
224 | Starting type checking service...
225 | Starting type checking service...
226 | Starting type checking service...
227 | Starting type checking service...
228 | Starting type checking service...
229 | Starting type checking service...
230 | done
231 |
232 | [Container] 2020/10/26 15:57:02 Running command echo abcdef Build ended `date`
It seems to wait about the same amount of time that I would expect between L229 and L230, but on a local Terminal we would see the webpack output and subsequent deployment. In the CodeBuild case, the command just completes and moves on.
My interpretation is that webpack is starting new shell processes that codebuild is not recognising as running. What do you think?
For feature proposals:
- What is the use case that should be solved. The more detail you describe this in the easier it is to understand for us.
- If there is additional config how would it look
Similar or dependent issue(s):
Additional Data
"serverless": "^1.61.2",
"serverless-iam-roles-per-function": "^2.0.2",
"serverless-prune-plugin": "^1.4.2",
"serverless-pseudo-parameters": "^2.5.0",
"serverless-webpack": "^5.3.1",
"typescript": "^3.8.3",
"webpack": "^4.43.0"
- Serverless-Webpack Version you’re using: ^5.3.1
- Webpack version you’re using: ^4.43.0
- Serverless Framework Version you’re using: ^1.61.2 <-- this is because the later v2.5.x is erroring with
serverless-iam-roles-per-function
, and another project is usingserverless-aws-alias
which needs^1.61.2
to deploy the first time, so we are keeping the same throughout. Bringing to the latest versions results in apackageError
inserverless-iam-roles-per-function
. This combination of versions appears stable. - Operating System: linux
- Stack Trace (if available):
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Troubleshooting AWS CodeBuild
Issue: When a build tries to get the value of one or more parameters stored in Amazon EC2 Parameter Store, the build fails...
Read more >Is there a way to wait for Codebuild to finish executing before ...
Mainly because if CloudFormation needs to rollback it is going to try and rebuild the previous build. If the previous rebuild fails you...
Read more >CodeBuild Projects do not complete: They are stuck in the ...
This week, starting on Monday I am unable to get past the QUEUED stage, even if I just wait and the build projects...
Read more >Wait for codebuild and get build result using aws cli or boto3
I want to wait for a codebuild build and get the result of the build using the aws cli or boto3. There does...
Read more >Managing volatile Terraform Deployments with AWS ...
The solution I found is a combination of AWS CodeBuild, AWS Step ... workflow that triggers a CodeBuild run and then waits for...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@ambi-ly Amazing thank you for finding this. Exactly the same issue for CodeBuild.
Figured out the issue in our case.
We are using the Fork TS Checker Webpack Plugin and it was out of memory as it does not limit the number of concurrent functions it run. After allocating more to the CircleCI container it worked.
Concurrency limit can be added using this plugin.
The
ForkTsCheckerWebpackPlugin
is silently erroring out when memory is not sufficient it seems. Similar issue (link) has been reported when you have many functions in the serverless.(Update: Not reporting plugin failure is deliberate design.
If you don’t individually pack your functions, that will help too.