cfn submit fails because pip install exited with non-zero status code
See original GitHub issuecfn submit --dry-run
fails with an error
Contents of rpdk.log
[2022-10-11T17:31:54Z] DEBUG - Logging set up successfully
[2022-10-11T17:31:54Z] DEBUG - Running submit: Namespace(command=<function submit at 0x11851fee0>, dry_run=True, endpoint_url=None, region='us-east-1', role_arn=None, set_default=False, subparser_name='submit', use_role=True, verbose=3, version=False)
[2022-10-11T17:31:54Z] DEBUG - Root directory: /Users/me/IdeaProjects/custom-resource-type
[2022-10-11T17:31:54Z] DEBUG - Loading project file '/Users/me/IdeaProjects/custom-resource-type/.rpdk-config'
[2022-10-11T17:31:54Z] INFO - Validating your resource specification...
[2022-10-11T17:31:54Z] WARNING - Explicitly specify value for insertionOrder for array: Authors
[2022-10-11T17:31:54Z] WARNING - Explicitly specify value for tagging
[2022-10-11T17:31:54Z] DEBUG - Resolved '#/definitions/InitechDateFormat' to 'file:///Users/me/IdeaProjects/custom-resource-type/cronitor-cronitor-monitor.json#/definitions/InitechDateFormat'
[2022-10-11T17:31:54Z] DEBUG - Parsed 'file:///Users/me/IdeaProjects/custom-resource-type/cronitor-cronitor-monitor.json#/definitions/InitechDateFormat' to '(<BASE>, 'definitions', 'InitechDateFormat')'
[2022-10-11T17:31:54Z] DEBUG - Edge from '(<BASE>, 'properties', 'DueDate')' to '(<BASE>, 'definitions', 'InitechDateFormat')'
[2022-10-11T17:31:54Z] DEBUG - Resolved '#/definitions/InitechDateFormat' to 'file:///Users/me/IdeaProjects/custom-resource-type/cronitor-cronitor-monitor.json#/definitions/InitechDateFormat'
[2022-10-11T17:31:54Z] DEBUG - Parsed 'file:///Users/me/IdeaProjects/custom-resource-type/cronitor-cronitor-monitor.json#/definitions/InitechDateFormat' to '(<BASE>, 'definitions', 'InitechDateFormat')'
[2022-10-11T17:31:54Z] DEBUG - Edge from '(<BASE>, 'properties', 'ApprovalDate')' to '(<BASE>, 'definitions', 'InitechDateFormat')'
[2022-10-11T17:31:54Z] DEBUG - Resolved '#/definitions/Memo' to 'file:///Users/me/IdeaProjects/custom-resource-type/cronitor-cronitor-monitor.json#/definitions/Memo'
[2022-10-11T17:31:54Z] DEBUG - Parsed 'file:///Users/me/IdeaProjects/custom-resource-type/cronitor-cronitor-monitor.json#/definitions/Memo' to '(<BASE>, 'definitions', 'Memo')'
[2022-10-11T17:31:54Z] DEBUG - Edge from '(<BASE>, 'properties', 'Memo')' to '(<BASE>, 'definitions', 'Memo')'
[2022-10-11T17:31:54Z] DEBUG - Resolved '#/definitions/Memo' to 'file:///Users/me/IdeaProjects/custom-resource-type/cronitor-cronitor-monitor.json#/definitions/Memo'
[2022-10-11T17:31:54Z] DEBUG - Parsed 'file:///Users/me/IdeaProjects/custom-resource-type/cronitor-cronitor-monitor.json#/definitions/Memo' to '(<BASE>, 'definitions', 'Memo')'
[2022-10-11T17:31:54Z] DEBUG - Edge from '(<BASE>, 'properties', 'SecondCopyOfMemo')' to '(<BASE>, 'definitions', 'Memo')'
[2022-10-11T17:31:54Z] DEBUG - Resolved '#/definitions/Tag' to 'file:///Users/me/IdeaProjects/custom-resource-type/cronitor-cronitor-monitor.json#/definitions/Tag'
[2022-10-11T17:31:54Z] DEBUG - Parsed 'file:///Users/me/IdeaProjects/custom-resource-type/cronitor-cronitor-monitor.json#/definitions/Tag' to '(<BASE>, 'definitions', 'Tag')'
[2022-10-11T17:31:54Z] DEBUG - Edge from '(<BASE>, 'properties', 'Tags', 'items')' to '(<BASE>, 'definitions', 'Tag')'
[2022-10-11T17:31:54Z] DEBUG - Rewriting refs in '<BASE>' (file:///Users/me/IdeaProjects/custom-resource-type/cronitor-cronitor-monitor.json)
[2022-10-11T17:31:54Z] DEBUG - '#/definitions/InitechDateFormat' -> '#/definitions/InitechDateFormat'
[2022-10-11T17:31:54Z] DEBUG - '#/definitions/InitechDateFormat' -> '#/definitions/InitechDateFormat'
[2022-10-11T17:31:54Z] DEBUG - '#/definitions/Memo' -> '#/definitions/Memo'
[2022-10-11T17:31:54Z] DEBUG - '#/definitions/Memo' -> '#/definitions/Memo'
[2022-10-11T17:31:54Z] DEBUG - '#/definitions/Tag' -> '#/definitions/Tag'
[2022-10-11T17:31:54Z] WARNING - Resource schema is valid.
[2022-10-11T17:31:54Z] INFO - Validating your resource schema...
[2022-10-11T17:31:54Z] DEBUG - inputs not found. Not writing to package.
[2022-10-11T17:31:54Z] DEBUG - Package started
[2022-10-11T17:31:54Z] DEBUG - '/Users/me/IdeaProjects/custom-resource-type/build' not found, skipping removal
Traceback (most recent call last):
File "/Users/me/.pyenv/versions/3.8.1/lib/python3.8/site-packages/rpdk/python/codegen.py", line 239, in _remove_build_artifacts
shutil.rmtree(deps_path)
File "/Users/me/.pyenv/versions/3.8.1/lib/python3.8/shutil.py", line 700, in rmtree
onerror(os.lstat, path, sys.exc_info())
File "/Users/me/.pyenv/versions/3.8.1/lib/python3.8/shutil.py", line 698, in rmtree
orig_st = os.lstat(path)
FileNotFoundError: [Errno 2] No such file or directory: '/Users/me/IdeaProjects/custom-resource-type/build'
[2022-10-11T17:31:54Z] DEBUG - Dependencies build started from '/Users/me/IdeaProjects/custom-resource-type'
[2022-10-11T17:31:54Z] DEBUG - command is 'pip install --no-cache-dir --no-color --disable-pip-version-check --upgrade --requirement /project/requirements.txt --target /project/build'
[2022-10-11T17:31:54Z] WARNING - Starting Docker build. This may take several minutes if the image 'lambci/lambda:build-python3.7' needs to be pulled first.
[2022-10-11T17:31:54Z] DEBUG - Trying paths: ['/Users/me/.docker/config.json', '/Users/me/.dockercfg']
[2022-10-11T17:31:54Z] DEBUG - Found file at path: /Users/me/.docker/config.json
[2022-10-11T17:31:54Z] DEBUG - Found 'auths' section
[2022-10-11T17:31:54Z] DEBUG - Auth data for 037727099164.dkr.ecr.us-east-1.amazonaws.com is absent. Client might be using a credentials store instead.
[2022-10-11T17:31:54Z] DEBUG - Auth data for 390763969141.dkr.ecr.us-east-2.amazonaws.com is absent. Client might be using a credentials store instead.
[2022-10-11T17:31:54Z] DEBUG - Found 'credsStore' section
[2022-10-11T17:31:55Z] DEBUG - Caught downstream error
Traceback (most recent call last):
File "/Users/me/.pyenv/versions/3.8.1/lib/python3.8/site-packages/rpdk/python/codegen.py", line 285, in _docker_build
logs = docker_client.containers.run(
File "/Users/me/.pyenv/versions/3.8.1/lib/python3.8/site-packages/docker/models/containers.py", line 875, in run
raise ContainerError(
docker.errors.ContainerError: Command 'pip install --no-cache-dir --no-color --disable-pip-version-check --upgrade --requirement /project/requirements.txt --target /project/build' in image 'lambci/lambda:build-python3.7' returned non-zero exit status 2
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/Users/me/.pyenv/versions/3.8.1/lib/python3.8/site-packages/rpdk/core/cli.py", line 100, in main
args.command(args)
File "/Users/me/.pyenv/versions/3.8.1/lib/python3.8/site-packages/rpdk/core/submit.py", line 15, in submit
project.submit(
File "/Users/me/.pyenv/versions/3.8.1/lib/python3.8/site-packages/rpdk/core/project.py", line 650, in submit
self._add_resources_content_to_zip(zip_file)
File "/Users/me/.pyenv/versions/3.8.1/lib/python3.8/site-packages/rpdk/core/project.py", line 678, in _add_resources_content_to_zip
self._plugin.package(self, zip_file)
File "/Users/me/.pyenv/versions/3.8.1/lib/python3.8/site-packages/rpdk/python/codegen.py", line 227, in package
self._build(project.root)
File "/Users/me/.pyenv/versions/3.8.1/lib/python3.8/site-packages/rpdk/python/codegen.py", line 246, in _build
self._docker_build(base_path)
File "/Users/me/.pyenv/versions/3.8.1/lib/python3.8/site-packages/rpdk/python/codegen.py", line 303, in _docker_build
raise DownstreamError("Error running docker build") from e
rpdk.core.exceptions.DownstreamError: Error running docker build
Issue Analytics
- State:
- Created a year ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
pip build failed · Issue #736 · aws-cloudformation ... - GitHub
Resource schema is valid. Generated files for AWS::WorkSpaces::Workspace. Post this command when I run $ cfn submit i receive the following ...
Read more >How to fix '“ERROR: Command errored out with exit status 1 ...
The best thing to do is invoke pip using <python> -m pip where <python> is the Python that you want to install the...
Read more >[Solved] Post build event exit code 1 error - CodeProject
Solution 1. Accept Solution Reject Solution. Probably one of the executed commands returns with a non-zero code. Unfortunately there is no ...
Read more >With cfn-lint - Serverless Rules
pip install cfn -lint cfn-lint-serverless ... If there are any issues with your template, cfn-lint will return a non-zero error code.
Read more >The solver failed with a non-zero exit code of : 2
This error can happen for a number of different reasons. And in your case could be due to change in boundary condition. If...
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
This fix is live in the newly released packages!
cloudformation-cli 0.2.26 cloudformation-cli-python-plugin 2.1.6
Looks like you are running into the same bug as https://github.com/aws-cloudformation/cloudformation-cli-python-plugin/issues/100
We are looking into it and hopefully have a fix out soon