Command did not exit successfully cdk synth --app adf-build/cdk/generate_pipeline_stacks.py 1> /dev/null exit status 1
Hi,
I have an issue with my ADF version 3.0.4.
Starting from few days, I got an error while updating the deployment map, by the way no updates were made on a single component of ADF.
The output (and the error) is:
` 2022-10-05 19:59:45,491 | INFO | cdk_stacks.main | Pipeline creation/update of cur commenced | (main.py:34)
112 | Traceback (most recent call last):
113 | File "adf-build/cdk/generate_pipeline_stacks.py", line 37, in
here my codebuild for deployment map:
version: 0.2 phases: install: runtime-versions: python: 3.7 nodejs: 10 pre_build: commands: - npm install [email protected] -g -y --quiet --no-progress - aws s3 cp s3://$SHARED_MODULES_BUCKET/adf-build/ ./adf-build/ --recursive --quiet - pip install -r adf-build/requirements.txt -q -t ./adf-build build: commands: - cdk --version - chmod 755 adf-build/cdk/execute_pipeline_stacks.py adf-build/cdk/generate_pipeline_inputs.py adf-build/cdk/generate_pipeline_stacks.py - python adf-build/cdk/generate_pipeline_inputs.py - cdk synth --app adf-build/cdk/generate_pipeline_stacks.py 1> /dev/null - python adf-build/cdk/execute_pipeline_stacks.py
Unfortunately I cannot replicate this error with the latest versions (v3.1.2 and the next upcoming one). What I am guessing is that a dependency used by that specific version of CDK changed.
What you could do is download the output of the CodeBuild container when it was still operational and compare that against its recent failed run. My guess is that a dependency changed and breaks this all of a sudden.
When you find it, you need to add that to the adf-build/requirements.txt that is installed by the pip install -r adf-build/requirements.txt -q -t ./adf-build step. You can find this file in the aws-deployment-framework-bootstrap repo.
I'm closing this issue as it has been inactive for a few weeks. This probably means that it is not reproducible or it has been fixed in the meanwhile.
Please reopen if you still encounter this issue with the latest stable version.
Thank you!
@skylagallm - did you find a root cause for this problem? we are running into a very similar looking issue. Seems like maybe an unpinned dependency updated and is being pulled in?
We were able to get past this by updating all dependencies to match what is currently in this ADF github repo:
- Codebuild image
aws/codebuild/standard:5.0 - buildspec:
npm install [email protected] - buildspec:
nodejs: 14 - buildspec: added the
--no-version-reportingflag to thecdk synth --app adf-build/cdk/generate_pipeline_stacks.pycommand - updated
adf-build/requirements.txtto match what is currently in this github repo- It might be a good idea to explicitly pin all python dependencies to avoid this in the future (
pip freeze > requirements.txt)
- It might be a good idea to explicitly pin all python dependencies to avoid this in the future (
A customer reported running into this issue. In their case, they had modified quite a bit of ADF. Hence, they were not ready to upgrade to the latest release of ADF yet.
While searching for the root cause, it seems that the jsii package has very loose requirements on some of the dependencies they rely upon. The attrs and cattrs libraries would get installed with their latest releases for example.
Before I share how we resolved the issue, I would like to strongly recommend to upgrade to the latest version of ADF. v3.0.4 was released about three years ago. The libraries that ADF relies on have seen multiple security findings. Among others, see CVE-2022-40897, CVE-2021-33503, CVE-2020-26137, CVE-2022-42969, and CVE-2022-40898. On top of that numerous issues have been resolved since then.
If you insist, or need to resolve this temporarily before you apply the upgrade, this is how to fix it:
- In the management account.
- Go to the CodeCommit
aws-deployment-framework-boostraprepository. - Edit the following file:
/adf-build/shared/requirements.txt. - Append the following four dependencies to the end of the file:
attrs==19.3.0
cattrs==1.0.0
botocore==1.12.89
typing-extensions==3.7.4.3
- Commit this to the main branch (the
masterbranch in v3.0.4). - Wait for the bootstrap pipeline to succeed.
- Once that is finished, you can retry the pipeline generation and they should succeed then too.
Please reopen this ticket and ping me if this did not resolve your issue. Or open a new issue if you run into a slightly different problem after.