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

Sam build fails for {wrapt==1.12.1(sdist)} #2291

Closed
imti283 opened this issue Oct 12, 2020 · 9 comments
Closed

Sam build fails for {wrapt==1.12.1(sdist)} #2291

imti283 opened this issue Oct 12, 2020 · 9 comments

Comments

@imti283
Copy link

imti283 commented Oct 12, 2020

Description:

Running sam build with aws-xray-sdk in requirement.txt failing as it is unable to get wrapt wheel package and giving below error -
aws_lambda_builders.workflows.python_pip.packager.MissingDependencyError: {wrapt==1.12.1(sdist)}

Steps to reproduce the issue:

  1. Simple one page lambda code in a folder with requirement.txt having only dependency as aws-xray-sdk
  2. Ran below command -
    sam build --template "C:\agent2\_work\142\s\Assets\events\Post/Assets_Events_POST-build.yaml" --region us-west-2 --debug

Observed result:

C:\agent2_work\142\s\Assets\events\Post>sam build --template "C:\agent2_work\142\s\Assets\events\Post/Assets_Events_POST-build.yaml" --region us-west-2 --debug
Telemetry endpoint configured to be https://aws-serverless-tools-telemetry.us-west-2.amazonaws.com/metrics
'build' command is called
No Parameters detected in the template
2 resources found in the template
Found Serverless function with name='AssetsEventsPOST' and CodeUri='.'
No Parameters detected in the template
Building function 'AssetsEventsPOST'
Loading workflow module 'aws_lambda_builders.workflows'
Registering workflow 'PythonPipBuilder' with capability 'Capability(language='python', dependency_manager='pip', application_framework=None)'
Registering workflow 'NodejsNpmBuilder' with capability 'Capability(language='nodejs', dependency_manager='npm', application_framework=None)'
Registering workflow 'RubyBundlerBuilder' with capability 'Capability(language='ruby', dependency_manager='bundler', application_framework=None)'
Registering workflow 'GoDepBuilder' with capability 'Capability(language='go', dependency_manager='dep', application_framework=None)'
Registering workflow 'GoModulesBuilder' with capability 'Capability(language='go', dependency_manager='modules', application_framework=None)'
Registering workflow 'JavaGradleWorkflow' with capability 'Capability(language='java', dependency_manager='gradle', application_framework=None)'
Registering workflow 'JavaMavenWorkflow' with capability 'Capability(language='java', dependency_manager='maven', application_framework=None)'
Registering workflow 'DotnetCliPackageBuilder' with capability 'Capability(language='dotnet', dependency_manager='cli-package', application_framework=None)'
Registering workflow 'CustomMakeBuilder' with capability 'Capability(language='provided', dependency_manager=None, application_framework=None)'
Found workflow 'PythonPipBuilder' to support capabilities 'Capability(language='python', dependency_manager='pip', application_framework=None)'
Running workflow 'PythonPipBuilder'
Running PythonPipBuilder:ResolveDependencies
calling pip download -r C:\agent2_work\142\s\Assets\events\Post\requirements.txt --dest C:\Users\dummyUser\AppData\Local\Temp\tmp85csqu6i
Full dependency closure: {python-dateutil==2.8.1(wheel), jsonpickle==1.4.1(wheel), six==1.15.0(wheel), zipp==3.3.0(wheel), wrapt==1.12.1(sdist), botocore==1.18.15(wheel), aws-xray-sdk==2.6.0(wheel), jmespath==0.10.0(wheel), urllib3==1.25.10(wheel), future==0.18.2(sdist), importlib-metadata==2.0.0(wheel)}
initial compatible: {python-dateutil==2.8.1(wheel), jsonpickle==1.4.1(wheel), six==1.15.0(wheel), zipp==3.3.0(wheel), botocore==1.18.15(wheel), aws-xray-sdk==2.6.0(wheel), jmespath==0.10.0(wheel), urllib3==1.25.10(wheel), importlib-metadata==2.0.0(wheel)}
initial incompatible: {future==0.18.2(sdist), wrapt==1.12.1(sdist)}
Downloading missing wheels: {future==0.18.2(sdist), wrapt==1.12.1(sdist)}
calling pip download --only-binary=:all: --no-deps --platform manylinux1_x86_64 --implementation cp --abi cp37m --dest C:\Users\dummyUser\AppData\Local\Temp\tmp85csqu6i future==0.18.2
calling pip download --only-binary=:all: --no-deps --platform manylinux1_x86_64 --implementation cp --abi cp37m --dest C:\Users\dummyUser\AppData\Local\Temp\tmp85csqu6i wrapt==1.12.1
compatible wheels after second download pass: {python-dateutil==2.8.1(wheel), jsonpickle==1.4.1(wheel), six==1.15.0(wheel), zipp==3.3.0(wheel), botocore==1.18.15(wheel), aws-xray-sdk==2.6.0(wheel), jmespath==0.10.0(wheel), urllib3==1.25.10(wheel), importlib-metadata==2.0.0(wheel)}
Build missing wheels from sdists (C compiling True): {future==0.18.2(sdist), wrapt==1.12.1(sdist)}
calling pip wheel --no-deps --wheel-dir C:\Users\dummyUser\AppData\Local\Temp\tmp85csqu6i C:\Users\dummyUser\AppData\Local\Temp\tmp85csqu6i\future-0.18.2.tar.gz
calling pip wheel --no-deps --wheel-dir C:\Users\dummyUser\AppData\Local\Temp\tmp85csqu6i C:\Users\dummyUser\AppData\Local\Temp\tmp85csqu6i\wrapt-1.12.1.tar.gz
compatible after building wheels (no C compiling): {python-dateutil==2.8.1(wheel), jsonpickle==1.4.1(wheel), six==1.15.0(wheel), zipp==3.3.0(wheel), botocore==1.18.15(wheel), aws-xray-sdk==2.6.0(wheel), jmespath==0.10.0(wheel), urllib3==1.25.10(wheel), future==0.18.2(wheel), importlib-metadata==2.0.0(wheel)}
Build missing wheels from sdists (C compiling False): {wrapt==1.12.1(sdist)}
calling pip wheel --no-deps --wheel-dir C:\Users\dummyUser\AppData\Local\Temp\tmp85csqu6i C:\Users\dummyUser\AppData\Local\Temp\tmp85csqu6i\wrapt-1.12.1.tar.gz
compatible after building wheels (C compiling): {python-dateutil==2.8.1(wheel), jsonpickle==1.4.1(wheel), six==1.15.0(wheel), zipp==3.3.0(wheel), botocore==1.18.15(wheel), aws-xray-sdk==2.6.0(wheel), jmespath==0.10.0(wheel), urllib3==1.25.10(wheel), future==0.18.2(wheel), importlib-metadata==2.0.0(wheel)}
Final compatible: {python-dateutil==2.8.1(wheel), jsonpickle==1.4.1(wheel), six==1.15.0(wheel), zipp==3.3.0(wheel), botocore==1.18.15(wheel), aws-xray-sdk==2.6.0(wheel), jmespath==0.10.0(wheel), urllib3==1.25.10(wheel), future==0.18.2(wheel), importlib-metadata==2.0.0(wheel)}
Final incompatible: {wrapt==1.12.1(wheel)}
Final missing wheels: {wrapt==1.12.1(sdist)}
PythonPipBuilder:ResolveDependencies failed
Traceback (most recent call last):
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\aws_lambda_builders\workflows\python_pip\actions.py", line 42, in execute
requirements_path=self.manifest_path,
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\aws_lambda_builders\workflows\python_pip\packager.py", line 137, in build_dependencies
self._dependency_builder.build_site_packages(requirements_path, artifacts_dir_path, scratch_dir_path)
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\aws_lambda_builders\workflows\python_pip\packager.py", line 201, in build_site_packages
raise MissingDependencyError(packages_without_wheels)
aws_lambda_builders.workflows.python_pip.packager.MissingDependencyError: {wrapt==1.12.1(sdist)}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\aws_lambda_builders\workflow.py", line 269, in run
action.execute()
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\aws_lambda_builders\workflows\python_pip\actions.py", line 45, in execute
raise ActionFailedError(str(ex))
aws_lambda_builders.actions.ActionFailedError: {wrapt==1.12.1(sdist)}

Build Failed
Sending Telemetry: {'metrics': [{'commandRun': {'awsProfileProvided': False, 'debugFlagProvided': True, 'region': 'us-west-2', 'commandName': 'sam build', 'duration': 20257, 'exitReason': 'WorkflowFailedError', 'exitCode': 1, 'requestId': 'c5551ae9-caea-4b93-9c48-d07fa2cbc8e3', 'installationId': 'b7024037-b875-42d8-8e62-2abac9896f08', 'sessionId': 'd38fda56-1b47-4cf4-8840-65a6966432b4', 'executionEnvironment': 'CLI', 'pyversion': '3.7.6', 'samcliVersion': '0.53.0'}}]}
Telemetry response: 200
Error: PythonPipBuilder:ResolveDependencies - {wrapt==1.12.1(sdist)}

Expected result:

It should build successfully with all dependency
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)

I already have wheel(0.35.1) installed.
Python Version - Python 3.7.4
Pip Version - pip 20.2.3
SAM version - SAM CLI, version 0.53.0

@benkehoe
Copy link

We've experienced this recently for pyyaml 5.3.1 on Mac, SAM CLI version 1.6.2; with --use-container the build succeeds.

@mndeveci
Copy link
Contributor

Hi @imti283 ,

As @benkehoe pointed out you need to use --use-container flag to build your application inside container, since some of the dependencies of aws-xray-sdk doesn't have wheels, and needs to build from source. Using container will fix this issue.

I confirmed that build works with --use-container flag, please re-open this issue if you need.

@benkehoe
Copy link

I don't think this is fully closed. We were able to pip install pyyaml directly, so the wheels appear to exist, but it failed in the sam builder, and sam doesn't expose enough of what's going on for us to tell what's different.

@jfuss
Copy link
Contributor

jfuss commented Oct 28, 2020

I don't think this is fully closed. We were able to pip install pyyaml directly, so the wheels appear to exist, but it failed in the sam builder, and sam doesn't expose enough of what's going on for us to tell what's different.

PyYaml does not have .whls: https://pypi.org/project/PyYAML/#files. Additionally the builder does not directly pip install because they would build it for they system you are on not the system for lambda (building for mac will not run in Lambda for example). Further details can be found here on how the pip builder actually works.

@mndeveci
Copy link
Contributor

Hi @benkehoe,

Addition to @jfuss’s comments, you can see that wrapt and pyyaml has C extensions and they don’t have specific .whls for linux. In order to build them from source, SAM CLI requires a linux (since lambda runs on linux), which can be accomplished by using container option in build command.

@benkehoe
Copy link

@jfuss @mndeveci this is enlightening, thanks so much! Maybe SAM could help users understand this when the builder encounters this situation?

@mndeveci
Copy link
Contributor

@benkehoe , I added an issue on aws/aws-lambda-builders to give more details whenever a build fails because of this kind of dependencies on non-linux system.

@jojo786
Copy link

jojo786 commented Nov 10, 2021

I added a comment to #1840, but decided to add more details on using --use-container


sam build --use-container --debug                                                                                                          
2021-11-10 15:53:43,594 | Telemetry endpoint configured to be https://aws-serverless-tools-telemetry.us-west-2.amazonaws.com/metrics
2021-11-10 15:53:43,594 | Using config file: samconfig.toml, config environment: default
2021-11-10 15:53:43,594 | Expand command line arguments to:
2021-11-10 15:53:43,594 | --template_file=/Users/tuser/WorkDocs/gitwork/python/whats/template.yml --use_container --build_dir=.aws-sam/build --cache_dir=.aws-sam/cache 
2021-11-10 15:53:44,131 | 'build' command is called
2021-11-10 15:53:44,131 | Starting Build inside a container
2021-11-10 15:53:44,162 | No Parameters detected in the template
2021-11-10 15:53:44,229 | 2 stacks found in the template
2021-11-10 15:53:44,229 | No Parameters detected in the template
2021-11-10 15:53:44,273 | 2 resources found in the stack 
2021-11-10 15:53:44,273 | No Parameters detected in the template
2021-11-10 15:53:44,337 | Found Serverless function with name='AwsWhatsNew' and CodeUri='./'
2021-11-10 15:53:44,337 | --base-dir is not presented, adjusting uri ./ relative to /Users/tuser/WorkDocs/gitwork/python/whats/template.yml
2021-11-10 15:53:44,338 | No Parameters detected in the template
2021-11-10 15:53:44,404 | Instantiating build definitions
2021-11-10 15:53:44,409 | Same function build definition found, adding function (Previous: BuildDefinition(python3.9, /Users/tuser/WorkDocs/gitwork/python/whats, Zip, , 2399419a-8345-45a3-a1fd-e9c50a30b531, {}, {}, arm64, []), Current: BuildDefinition(python3.9, /Users/tuser/WorkDocs/gitwork/python/whats, Zip, , fda944d2-8437-45af-9d98-4cc62e47574c, {}, {}, arm64, []), Function: Function(name='AwsWhatsNew', functionname='AwsWhatsNew', runtime='python3.9', memory=None, timeout=200, handler='handler.wambda_handwer', imageuri=None, packagetype='Zip', imageconfig=None, codeuri='/Users/tuser/WorkDocs/gitwork/python/whats', environment={'Variables': {'PostsTableName': 'AwsNewsRecentPostsTable', 'PostRecencyThreshold': '7000'}}, rolearn=None, layers=[], events={'CheckForNewPostsScheduledEvent': {'Type': 'Schedule', 'Properties': {'Schedule': 'rate(1 minute)'}}}, metadata=None, inlinecode=None, codesign_config_arn=None, architectures=['arm64'], stack_path=''))
2021-11-10 15:53:44,411 | Building codeuri: /Users/tuser/WorkDocs/gitwork/python/whats runtime: python3.9 metadata: {} architecture: arm64 functions: ['AwsWhatsNew']
2021-11-10 15:53:44,427 | Building to following folder /Users/tuser/WorkDocs/gitwork/python/whats/.aws-sam/build/AwsWhatsNew

Fetching public.ecr.aws/sam/build-python3.9:latest-arm64 Docker container image......
2021-11-10 15:53:48,507 | Mounting /Users/tuser/WorkDocs/gitwork/python/whats as /tmp/samcli/source:ro,delegated inside runtime container
Using the request object from command line argument
Loading workflow module 'aws_lambda_builders.workflows'
Registering workflow 'PythonPipBuilder' with capability 'Capability(language='python', dependency_manager='pip', application_framework=None)'
Registering workflow 'NodejsNpmBuilder' with capability 'Capability(language='nodejs', dependency_manager='npm', application_framework=None)'
Registering workflow 'RubyBundlerBuilder' with capability 'Capability(language='ruby', dependency_manager='bundler', application_framework=None)'
Registering workflow 'GoDepBuilder' with capability 'Capability(language='go', dependency_manager='dep', application_framework=None)'
Registering workflow 'GoModulesBuilder' with capability 'Capability(language='go', dependency_manager='modules', application_framework=None)'
Registering workflow 'JavaGradleWorkflow' with capability 'Capability(language='java', dependency_manager='gradle', application_framework=None)'
Registering workflow 'JavaMavenWorkflow' with capability 'Capability(language='java', dependency_manager='maven', application_framework=None)'
Registering workflow 'DotnetCliPackageBuilder' with capability 'Capability(language='dotnet', dependency_manager='cli-package', application_framework=None)'
Registering workflow 'CustomMakeBuilder' with capability 'Capability(language='provided', dependency_manager=None, application_framework=None)'
Found workflow 'PythonPipBuilder' to support capabilities 'Capability(language='python', dependency_manager='pip', application_framework=None)'
Running workflow 'PythonPipBuilder'
Running PythonPipBuilder:ResolveDependencies
calling pip download -r /tmp/samcli/source/requirements.txt --dest /tmp/samcli/scratch --exists-action i
Full dependency closure: {aws-lambda-powertools==1.21.1(wheel), python-dateutil==2.8.2(wheel), botocore==1.23.2(wheel), urllib3==1.26.7(wheel), idna==3.3(wheel), charset-normalizer==2.0.7(wheel), future==0.18.2(sdist), oauthlib==3.1.1(wheel), sgmllib3k==1.0.0(sdist), requests==2.26.0(wheel), boto3==1.20.2(wheel), aws-xray-sdk==2.8.0(wheel), s3transfer==0.5.0(wheel), fastjsonschema==2.15.1(wheel), wrapt==1.13.3(sdist), six==1.16.0(wheel), jmespath==0.10.0(wheel), certifi==2021.10.8(wheel), python-twitter==3.5(wheel), feedparser==6.0.8(wheel), requests-oauthlib==1.3.0(wheel)}
initial compatible: {aws-lambda-powertools==1.21.1(wheel), python-dateutil==2.8.2(wheel), six==1.16.0(wheel), botocore==1.23.2(wheel), s3transfer==0.5.0(wheel), jmespath==0.10.0(wheel), oauthlib==3.1.1(wheel), python-twitter==3.5(wheel), fastjsonschema==2.15.1(wheel), requests==2.26.0(wheel), urllib3==1.26.7(wheel), idna==3.3(wheel), charset-normalizer==2.0.7(wheel), certifi==2021.10.8(wheel), aws-xray-sdk==2.8.0(wheel), boto3==1.20.2(wheel), feedparser==6.0.8(wheel), requests-oauthlib==1.3.0(wheel)}
initial incompatible: {future==0.18.2(sdist), wrapt==1.13.3(sdist), sgmllib3k==1.0.0(sdist)}
Downloading missing wheels: {future==0.18.2(sdist), wrapt==1.13.3(sdist), sgmllib3k==1.0.0(sdist)}
calling pip download --only-binary=:all: --no-deps --platform manylinux2014_aarch64 --implementation cp --abi cp39 --dest /tmp/samcli/scratch future==0.18.2
calling pip download --only-binary=:all: --no-deps --platform manylinux2014_aarch64 --implementation cp --abi cp39 --dest /tmp/samcli/scratch wrapt==1.13.3
calling pip download --only-binary=:all: --no-deps --platform manylinux2014_aarch64 --implementation cp --abi cp39 --dest /tmp/samcli/scratch sgmllib3k==1.0.0
compatible wheels after second download pass: {aws-lambda-powertools==1.21.1(wheel), python-dateutil==2.8.2(wheel), six==1.16.0(wheel), jmespath==0.10.0(wheel), s3transfer==0.5.0(wheel), botocore==1.23.2(wheel), oauthlib==3.1.1(wheel), python-twitter==3.5(wheel), fastjsonschema==2.15.1(wheel), requests==2.26.0(wheel), urllib3==1.26.7(wheel), idna==3.3(wheel), charset-normalizer==2.0.7(wheel), certifi==2021.10.8(wheel), aws-xray-sdk==2.8.0(wheel), boto3==1.20.2(wheel), feedparser==6.0.8(wheel), requests-oauthlib==1.3.0(wheel)}
Build missing wheels from sdists (C compiling True): {future==0.18.2(sdist), sgmllib3k==1.0.0(sdist), wrapt==1.13.3(sdist)}
calling pip wheel --no-deps --wheel-dir /tmp/samcli/scratch /tmp/samcli/scratch/future-0.18.2.tar.gz
calling pip wheel --no-deps --wheel-dir /tmp/samcli/scratch /tmp/samcli/scratch/sgmllib3k-1.0.0.tar.gz
calling pip wheel --no-deps --wheel-dir /tmp/samcli/scratch /tmp/samcli/scratch/wrapt-1.13.3.tar.gz
compatible after building wheels (no C compiling): {aws-lambda-powertools==1.21.1(wheel), python-dateutil==2.8.2(wheel), botocore==1.23.2(wheel), urllib3==1.26.7(wheel), idna==3.3(wheel), charset-normalizer==2.0.7(wheel), future==0.18.2(wheel), oauthlib==3.1.1(wheel), sgmllib3k==1.0.0(wheel), requests==2.26.0(wheel), boto3==1.20.2(wheel), aws-xray-sdk==2.8.0(wheel), s3transfer==0.5.0(wheel), fastjsonschema==2.15.1(wheel), six==1.16.0(wheel), jmespath==0.10.0(wheel), certifi==2021.10.8(wheel), python-twitter==3.5(wheel), feedparser==6.0.8(wheel), requests-oauthlib==1.3.0(wheel)}
Build missing wheels from sdists (C compiling False): {wrapt==1.13.3(sdist)}
calling pip wheel --no-deps --wheel-dir /tmp/samcli/scratch /tmp/samcli/scratch/wrapt-1.13.3.tar.gz
compatible after building wheels (C compiling): {aws-lambda-powertools==1.21.1(wheel), python-dateutil==2.8.2(wheel), botocore==1.23.2(wheel), urllib3==1.26.7(wheel), idna==3.3(wheel), charset-normalizer==2.0.7(wheel), future==0.18.2(wheel), oauthlib==3.1.1(wheel), sgmllib3k==1.0.0(wheel), requests==2.26.0(wheel), boto3==1.20.2(wheel), aws-xray-sdk==2.8.0(wheel), s3transfer==0.5.0(wheel), fastjsonschema==2.15.1(wheel), six==1.16.0(wheel), jmespath==0.10.0(wheel), certifi==2021.10.8(wheel), python-twitter==3.5(wheel), feedparser==6.0.8(wheel), requests-oauthlib==1.3.0(wheel)}
Final compatible: {aws-lambda-powertools==1.21.1(wheel), python-dateutil==2.8.2(wheel), botocore==1.23.2(wheel), s3transfer==0.5.0(wheel), fastjsonschema==2.15.1(wheel), urllib3==1.26.7(wheel), idna==3.3(wheel), charset-normalizer==2.0.7(wheel), future==0.18.2(wheel), six==1.16.0(wheel), jmespath==0.10.0(wheel), oauthlib==3.1.1(wheel), sgmllib3k==1.0.0(wheel), python-twitter==3.5(wheel), requests==2.26.0(wheel), certifi==2021.10.8(wheel), aws-xray-sdk==2.8.0(wheel), boto3==1.20.2(wheel), feedparser==6.0.8(wheel), requests-oauthlib==1.3.0(wheel)}
Final incompatible: {wrapt==1.13.3(wheel)}
Final missing wheels: {wrapt==1.13.3(sdist)}
PythonPipBuilder:ResolveDependencies failed
Traceback (most recent call last):
  File "/usr/local/opt/sam-cli/lib/python3.9/site-packages/aws_lambda_builders/workflows/python_pip/actions.py", line 51, in execute
    package_builder.build_dependencies(
  File "/usr/local/opt/sam-cli/lib/python3.9/site-packages/aws_lambda_builders/workflows/python_pip/packager.py", line 157, in build_dependencies
    self._dependency_builder.build_site_packages(requirements_path, artifacts_dir_path, scratch_dir_path)
  File "/usr/local/opt/sam-cli/lib/python3.9/site-packages/aws_lambda_builders/workflows/python_pip/packager.py", line 261, in build_site_packages
    raise MissingDependencyError(packages_without_wheels)
aws_lambda_builders.workflows.python_pip.packager.MissingDependencyError: {wrapt==1.13.3(sdist)}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/opt/sam-cli/lib/python3.9/site-packages/aws_lambda_builders/workflow.py", line 291, in run
    action.execute()
  File "/usr/local/opt/sam-cli/lib/python3.9/site-packages/aws_lambda_builders/workflows/python_pip/actions.py", line 57, in execute
    raise ActionFailedError(str(ex))
aws_lambda_builders.actions.ActionFailedError: {wrapt==1.13.3(sdist)}
Builder workflow failed
Traceback (most recent call last):
  File "/usr/local/opt/sam-cli/lib/python3.9/site-packages/aws_lambda_builders/workflows/python_pip/actions.py", line 51, in execute
    package_builder.build_dependencies(
  File "/usr/local/opt/sam-cli/lib/python3.9/site-packages/aws_lambda_builders/workflows/python_pip/packager.py", line 157, in build_dependencies
    self._dependency_builder.build_site_packages(requirements_path, artifacts_dir_path, scratch_dir_path)
  File "/usr/local/opt/sam-cli/lib/python3.9/site-packages/aws_lambda_builders/workflows/python_pip/packager.py", line 261, in build_site_packages
    raise MissingDependencyError(packages_without_wheels)
aws_lambda_builders.workflows.python_pip.packager.MissingDependencyError: {wrapt==1.13.3(sdist)}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/opt/sam-cli/lib/python3.9/site-packages/aws_lambda_builders/workflow.py", line 291, in run
    action.execute()
  File "/usr/local/opt/sam-cli/lib/python3.9/site-packages/aws_lambda_builders/workflows/python_pip/actions.py", line 57, in execute
    raise ActionFailedError(str(ex))
aws_lambda_builders.actions.ActionFailedError: {wrapt==1.13.3(sdist)}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/opt/sam-cli/lib/python3.9/site-packages/aws_lambda_builders/__main__.py", line 118, in main
    builder.build(
  File "/usr/local/opt/sam-cli/lib/python3.9/site-packages/aws_lambda_builders/builder.py", line 151, in build
    return workflow.run()
  File "/usr/local/opt/sam-cli/lib/python3.9/site-packages/aws_lambda_builders/workflow.py", line 96, in wrapper
    func(self, *args, **kwargs)
  File "/usr/local/opt/sam-cli/lib/python3.9/site-packages/aws_lambda_builders/workflow.py", line 298, in run
    raise WorkflowFailedError(workflow_name=self.NAME, action_name=action.NAME, reason=str(ex))
aws_lambda_builders.exceptions.WorkflowFailedError: PythonPipBuilder:ResolveDependencies - {wrapt==1.13.3(sdist)}
2021-11-10 15:58:42,431 | Build inside container returned response {"jsonrpc": "2.0", "id": 1, "error": {"code": 400, "message": "PythonPipBuilder:ResolveDependencies - {wrapt==1.13.3(sdist)}"}}

Build Failed
2021-11-10 15:58:48,241 | Sending Telemetry: {'metrics': [{'commandRun': {'requestId': '5909d380-fd52-4f48-a5b9-1e069dc5311f', 'installationId': 'a9744711-07a5-4231-8a5f-9cd59d0aa9f4', 'sessionId': 'c74686b4-6e01-45e2-b354-a3c350352866', 'executionEnvironment': 'CLI', 'ci': False, 'pyversion': '3.9.7', 'samcliVersion': '1.35.0', 'awsProfileProvided': False, 'debugFlagProvided': True, 'region': '', 'commandName': 'sam build', 'duration': 304634, 'exitReason': 'BuildInsideContainerError', 'exitCode': 1}}]}
2021-11-10 15:58:49,625 | HTTPSConnectionPool(host='aws-serverless-tools-telemetry.us-west-2.amazonaws.com', port=443): Read timed out. (read timeout=0.1)
Error: PythonPipBuilder:ResolveDependencies - {wrapt==1.13.3(sdist)}
````

@Kotaimen
Copy link

@jojo786 I find a workaround - add this to sam build command: --container-env-var WRAPT_EXTENSIONS=false.

See https://github.com/GrahamDumpleton/wrapt/blob/develop/setup.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants