cloudformation-cli icon indicating copy to clipboard operation
cloudformation-cli copied to clipboard

pip build failed

Open anshika08 opened this issue 4 years ago • 1 comments

C:\Users\Anshika\Documents\cfnregistry>cfn generate Resource schema is valid. Generated files for AWS::WorkSpaces::Workspace

Post this command when I run $ cfn submit i receive the following error-

C:\Users\Anshika\Documents\cfnregistry>cfn submit
Resource schema is valid.
Starting pip build.
=== Caught downstream error ===
Command '['pip', 'install', '--no-cache-dir', '--no-color', '--disable-pip-version-check', '--upgrade', '--requirement', 'C:\\Users\\Anshika\\Documents\\cfnregistry\\requirements.txt', '--target', 'C:\\Users\\Anshika\\Documents\\cfnregistry\\build']' returned non-zero exit status 1.
---
If debugging indicates this is a possible error with this program,
please report the issue to the team and include the log file 'rpdk.log'.
Issue tracker: https://github.com/aws-cloudformation/aws-cloudformation-rpdk/issues


Log file - 
[2021-04-19T10:54:24Z] DEBUG    - Logging set up successfully
[2021-04-19T10:54:24Z] DEBUG    - Running submit: Namespace(command=<function submit at 0x000002AF082DC678>, dry_run=False, endpoint_url=None, region=None, role_arn=None, set_default=False, subparser_name='submit', use_role=True, verbose=0, version=False)
[2021-04-19T10:54:24Z] DEBUG    - Root directory: C:\Users\Anshika\Documents\cfnregistry
[2021-04-19T10:54:24Z] DEBUG    - Loading project file 'C:\Users\Anshika\Documents\cfnregistry\.rpdk-config'
[2021-04-19T10:54:24Z] INFO     - Validating your resource specification...
[2021-04-19T10:54:24Z] DEBUG    - Resolved '#/definitions/InitechDateFormat' to 'file:///C:/Users/Anshika/Documents/cfnregistry/aws-workspaces-workspace.json#/definitions/InitechDateFormat'
[2021-04-19T10:54:24Z] DEBUG    - Parsed 'file:///C:/Users/Anshika/Documents/cfnregistry/aws-workspaces-workspace.json#/definitions/InitechDateFormat' to '(<BASE>, 'definitions', 'InitechDateFormat')'
[2021-04-19T10:54:24Z] DEBUG    - Edge from '(<BASE>, 'properties', 'DueDate')' to '(<BASE>, 'definitions', 'InitechDateFormat')'
[2021-04-19T10:54:24Z] DEBUG    - Resolved '#/definitions/InitechDateFormat' to 'file:///C:/Users/Anshika/Documents/cfnregistry/aws-workspaces-workspace.json#/definitions/InitechDateFormat'
[2021-04-19T10:54:24Z] DEBUG    - Parsed 'file:///C:/Users/Anshika/Documents/cfnregistry/aws-workspaces-workspace.json#/definitions/InitechDateFormat' to '(<BASE>, 'definitions', 'InitechDateFormat')'
[2021-04-19T10:54:24Z] DEBUG    - Edge from '(<BASE>, 'properties', 'ApprovalDate')' to '(<BASE>, 'definitions', 'InitechDateFormat')'
[2021-04-19T10:54:24Z] DEBUG    - Resolved '#/definitions/Memo' to 'file:///C:/Users/Anshika/Documents/cfnregistry/aws-workspaces-workspace.json#/definitions/Memo'
[2021-04-19T10:54:24Z] DEBUG    - Parsed 'file:///C:/Users/Anshika/Documents/cfnregistry/aws-workspaces-workspace.json#/definitions/Memo' to '(<BASE>, 'definitions', 'Memo')'
[2021-04-19T10:54:24Z] DEBUG    - Edge from '(<BASE>, 'properties', 'Memo')' to '(<BASE>, 'definitions', 'Memo')'
[2021-04-19T10:54:24Z] DEBUG    - Resolved '#/definitions/Memo' to 'file:///C:/Users/Anshika/Documents/cfnregistry/aws-workspaces-workspace.json#/definitions/Memo'
[2021-04-19T10:54:24Z] DEBUG    - Parsed 'file:///C:/Users/Anshika/Documents/cfnregistry/aws-workspaces-workspace.json#/definitions/Memo' to '(<BASE>, 'definitions', 'Memo')'
[2021-04-19T10:54:24Z] DEBUG    - Edge from '(<BASE>, 'properties', 'SecondCopyOfMemo')' to '(<BASE>, 'definitions', 'Memo')'
[2021-04-19T10:54:24Z] DEBUG    - Resolved '#/definitions/Tag' to 'file:///C:/Users/Anshika/Documents/cfnregistry/aws-workspaces-workspace.json#/definitions/Tag'
[2021-04-19T10:54:24Z] DEBUG    - Parsed 'file:///C:/Users/Anshika/Documents/cfnregistry/aws-workspaces-workspace.json#/definitions/Tag' to '(<BASE>, 'definitions', 'Tag')'
[2021-04-19T10:54:24Z] DEBUG    - Edge from '(<BASE>, 'properties', 'Tags', 'items')' to '(<BASE>, 'definitions', 'Tag')'
[2021-04-19T10:54:24Z] DEBUG    - Rewriting refs in '<BASE>' (file:///C:/Users/Anshika/Documents/cfnregistry/aws-workspaces-workspace.json)
[2021-04-19T10:54:24Z] DEBUG    -   '#/definitions/InitechDateFormat' -> '#/definitions/InitechDateFormat'
[2021-04-19T10:54:24Z] DEBUG    -   '#/definitions/InitechDateFormat' -> '#/definitions/InitechDateFormat'
[2021-04-19T10:54:24Z] DEBUG    -   '#/definitions/Memo' -> '#/definitions/Memo'
[2021-04-19T10:54:24Z] DEBUG    -   '#/definitions/Memo' -> '#/definitions/Memo'
[2021-04-19T10:54:24Z] DEBUG    -   '#/definitions/Tag' -> '#/definitions/Tag'
[2021-04-19T10:54:24Z] WARNING  - Resource schema is valid.
[2021-04-19T10:54:24Z] DEBUG    - overrides.json not found. Not writing to package.
[2021-04-19T10:54:24Z] DEBUG    - inputs not found. Not writing to package.
[2021-04-19T10:54:24Z] DEBUG    - Package started
[2021-04-19T10:54:24Z] DEBUG    - 'C:\Users\Anshika\Documents\cfnregistry\build' not found, skipping removal
Traceback (most recent call last):
  File "C:\Users\Anshika\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\rpdk\python\codegen.py", line 197, in _remove_build_artifacts
    shutil.rmtree(deps_path)
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\lib\shutil.py", line 516, in rmtree
    return _rmtree_unsafe(path, onerror)
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\lib\shutil.py", line 377, in _rmtree_unsafe
    onerror(os.scandir, path, sys.exc_info())
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\lib\shutil.py", line 374, in _rmtree_unsafe
    with os.scandir(path) as scandir_it:
FileNotFoundError: [WinError 3] The system cannot find the path specified: 'C:\\Users\\Anshika\\Documents\\cfnregistry\\build'
[2021-04-19T10:54:24Z] DEBUG    - Dependencies build started from 'C:\Users\Anshika\Documents\cfnregistry'
[2021-04-19T10:54:24Z] DEBUG    - command is '['pip', 'install', '--no-cache-dir', '--no-color', '--disable-pip-version-check', '--upgrade', '--requirement', 'C:\\Users\\Anshika\\Documents\\cfnregistry\\requirements.txt', '--target', 'C:\\Users\\Anshika\\Documents\\cfnregistry\\build']'
[2021-04-19T10:54:24Z] WARNING  - Starting pip build.
[2021-04-19T10:54:24Z] DEBUG    - Caught downstream error
Traceback (most recent call last):
  File "C:\Users\Anshika\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\rpdk\python\codegen.py", line 270, in _pip_build
    command, stdout=PIPE, stderr=PIPE, cwd=base_path, check=True
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\lib\subprocess.py", line 512, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['pip', 'install', '--no-cache-dir', '--no-color', '--disable-pip-version-check', '--upgrade', '--requirement', 'C:\\Users\\Anshika\\Documents\\cfnregistry\\requirements.txt', '--target', 'C:\\Users\\Anshika\\Documents\\cfnregistry\\build']' returned non-zero exit status 1.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\Anshika\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\rpdk\core\cli.py", line 100, in main
    args.command(args)
  File "C:\Users\Anshika\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\rpdk\core\submit.py", line 21, in submit
    args.set_default,
  File "C:\Users\Anshika\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\rpdk\core\project.py", line 500, in submit
    self._plugin.package(self, zip_file)
  File "C:\Users\Anshika\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\rpdk\python\codegen.py", line 185, in package
    self._build(project.root)
  File "C:\Users\Anshika\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\rpdk\python\codegen.py", line 206, in _build
    self._pip_build(base_path)
  File "C:\Users\Anshika\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\rpdk\python\codegen.py", line 273, in _pip_build
    raise DownstreamError("pip build failed") from e
rpdk.core.exceptions.DownstreamError: pip build failed

anshika08 avatar Apr 19 '21 10:04 anshika08

@anshika08 What is your version of python and pip?

I ran into this same issue, and I discovered what the problem was when I ran the pip command that cfn was running. When I ran this I was given a much better error message output that showed that I was missing Rust compiler. Upgrading the version of pip that I was using with python 3.7.12 from pip 20.1.1 to 22.0.4, Rust was installed automatically. Then I was able to run the cfn submit command again and it successfully built.

brianrathbun avatar Mar 07 '22 17:03 brianrathbun