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

bug: building a zip-based python lambda natively on an arm-based mac with a grpcio dependency fails #7860

Open
JonZeolla opened this issue Jan 31, 2025 · 0 comments
Labels
stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at.

Comments

@JonZeolla
Copy link

Description:

When I try to install grpcio as a dependency and do a sam build (outside of a container), I get this:

2025-01-31 15:50:36,823 | pip stderr: b"WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.\nPlease see
https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.\nTo avoid this problem you can invoke Python with '-m pip' instead of running
pip directly.\nERROR: Could not find a version that satisfies the requirement grpcio==1.70.0 (from versions: none)\n\n[notice] A new release of pip is available:
24.3.1 -> 25.0\n[notice] To update, run: python3.12 -m pip install --upgrade pip\nERROR: No matching distribution found for grpcio==1.70.0\n"

This is my requirements.txt

grpcio==1.70.0 \
    --hash=sha256:0495c86a55a04a874c7627fd33e5beaee771917d92c0e6d9d797628ac40e7655 \
    --hash=sha256:0a5c78d5198a1f0aa60006cd6eb1c912b4a1520b6a3968e677dbcba215fabb40 \
    --hash=sha256:2394e3381071045a706ee2eeb6e08962dd87e8999b90ac15c55f56fa5a8c9597 \
    --hash=sha256:4119fed8abb7ff6c32e3d2255301e59c316c22d31ab812b3fbcbaf3d0d87cc68 \
    --hash=sha256:7c73c42102e4a5ec76608d9b60227d917cea46dff4d11d372f64cbeb56d259d0 \
    --hash=sha256:880bfb43b1bb8905701b926274eafce5c70a105bc6b99e25f62e98ad59cb278e \
    --hash=sha256:8d1584a68d5922330025881e63a6c1b54cc8117291d382e4fa69339b6d914c56 \
    --hash=sha256:9e654c4b17d07eab259d392e12b149c3a134ec52b11ecdc6a515b39aceeec898 \
    --hash=sha256:aa47688a65643afd8b166928a1da6247d3f46a2784d301e48ca1cc394d2ffb40 \
    --hash=sha256:aa573896aeb7d7ce10b1fa425ba263e8dddd83d71530d1322fd3a16f31257b4a \
    --hash=sha256:ac073fe1c4cd856ebcf49e9ed6240f4f84d7a4e6ee95baa5d66ea05d3dd0df7f \
    --hash=sha256:b3c76701428d2df01964bc6479422f20e62fcbc0a37d82ebd58050b86926ef8c \
    --hash=sha256:cd24d2d9d380fbbee7a5ac86afe9787813f285e684b0271599f95a51bce33528 \
    --hash=sha256:d405b005018fd516c9ac529f4b4122342f60ec1cee181788249372524e6db429 \
    --hash=sha256:dfa089a734f24ee5f6880c83d043e4f46bf812fcea5181dcb3a572db1e79e01c \
    --hash=sha256:ef4c14508299b1406c32bdbb9fb7b47612ab979b04cf2b27686ea31882387cff \
    --hash=sha256:f19375f0300b96c0117aca118d400e76fede6db6e91f3c34b7b035822e06c35f \
    --hash=sha256:f32090238b720eb585248654db8e3afc87b48d26ac423c8dde8334a232ff53c9 \
    --hash=sha256:fe9dbd916df3b60e865258a8c72ac98f3ac9e2a9542dcb72b7a34d236242a5ce

This is the download command that I saw when buliding outside of the container:

2025-01-31 15:54:57,157 | calling pip download --only-binary=:all: --no-deps --platform manylinux2014_aarch64 --implementation cp --abi cp312 --dest
/var/folders/7x/83hwcqmj4pnd0qwq_wqdr94w0000gn/T/tmp4z949tuo grpcio==1.70.0

If I add --use-container it fixes it, pulling the manylinux_2_17 platform wheel:

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/manifest/requirements.txt --dest /tmp/samcli/scratch --exists-action i
pip stdout: b'Looking in indexes: https://pypi.org/simple, https://aws:****@REMOVED.d.codeartifact.us-east-1.amazonaws.com/pypi/REMOVED/simple/\nCollecting grpcio==1.70.0 (from -r /tmp/samcli/manifest/requirements.txt (line 1))\n  Downloading grpcio-1.70.0-cp312-cp312-manylinux_2_17_aarch64.whl (5.7 MB)\n     \xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81 5.7/5.7 MB 13.4 MB/s eta 0:00:00\nSaved /tmp/samcli/scratch/grpcio-1.70.0-cp312-cp312-manylinux_2_17_aarch64.whl\nSuccessfully downloaded grpcio\n'
pip stderr: b"WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.\nPlease see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.\nTo avoid this problem you can invoke Python with '-m pip' instead of running pip directly.\n\n[notice] A new release of pip is available: 24.2 -> 25.0\n[notice] To update, run: pip install --upgrade pip\n"
Full dependency closure: {grpcio==1.70.0(wheel)}
initial compatible: {grpcio==1.70.0(wheel)}
initial incompatible: set()
Downloading missing wheels: set()
compatible wheels after second download pass: {grpcio==1.70.0(wheel)}
Build missing wheels from sdists (C compiling True): set()
compatible after building wheels (no C compiling): {grpcio==1.70.0(wheel)}
Build missing wheels from sdists (C compiling False): set()
compatible after building wheels (C compiling): {grpcio==1.70.0(wheel)}
Final compatible: {grpcio==1.70.0(wheel)}

Steps to reproduce:

As far as I can tel, it's running a sam build for a zip-based python lambda on a mac with a grpcio dep.

Observed result:

Failure

$ sam build --manifest "requirements.txt" \
  --region us-east-1 \
  --debug \
  --parameter-overrides \
      REMOVED="ITEMS"
2025-01-31 15:54:56,509 | Config file location: /Users/jonzeolla/src/REMOVED/samconfig.yaml
2025-01-31 15:54:56,510 | Loading configuration values from [default.['build'].parameters] (env.command_name.section) in config file at
'/Users/jonzeolla/src/REMOVED/samconfig.yaml'...
2025-01-31 15:54:56,510 | Configuration values successfully loaded.
2025-01-31 15:54:56,510 | Configuration values are: {}
2025-01-31 15:54:56,516 | Using SAM Template at /Users/jonzeolla/src/REMOVED/template.yaml
2025-01-31 15:54:56,526 | OSError occurred while reading TOML file: [Errno 2] No such file or directory:
'/Users/jonzeolla/src/REMOVED/samconfig.toml'
2025-01-31 15:54:56,527 | Using config file: samconfig.toml, config environment: default
2025-01-31 15:54:56,527 | Expand command line arguments to:
2025-01-31 15:54:56,527 | --template_file=/Users/jonzeolla/src/REMOVED/template.yaml --manifest=requirements.txt
--parameter_overrides={'REMOVED': 'ITEMS'} --mount_with=READ --build_dir=.aws-sam/build --cache_dir=.aws-sam/cache
2025-01-31 15:54:56,544 | 'build' command is called
2025-01-31 15:54:56,550 | Collected default values for parameters: {'REMOVED': 'ITEMS'}
2025-01-31 15:54:56,558 | There is no customer defined id or cdk path defined for resource REMOVEDFunction, so we will use the resource logical id as the resource
id
2025-01-31 15:54:56,558 | There is no customer defined id or cdk path defined for resource DataApi, so we will use the resource logical id as the resource id
2025-01-31 15:54:56,559 | There is no customer defined id or cdk path defined for resource ApiGatewayLogGroup, so we will use the resource logical id as the
resource id
2025-01-31 15:54:56,559 | There is no customer defined id or cdk path defined for resource StoreApiId, so we will use the resource logical id as the resource id
2025-01-31 15:54:56,559 | There is no customer defined id or cdk path defined for resource SecurityGroup, so we will use the resource logical id as the resource
id
2025-01-31 15:54:56,560 | 0 stacks found in the template
2025-01-31 15:54:56,560 | Collected default values for parameters: {'REMOVED': 'ITEMS'}
2025-01-31 15:54:56,567 | There is no customer defined id or cdk path defined for resource REMOVEDFunction, so we will use the resource logical id as the resource
id
2025-01-31 15:54:56,568 | There is no customer defined id or cdk path defined for resource DataApi, so we will use the resource logical id as the resource id
2025-01-31 15:54:56,568 | There is no customer defined id or cdk path defined for resource ApiGatewayLogGroup, so we will use the resource logical id as the
resource id
2025-01-31 15:54:56,568 | There is no customer defined id or cdk path defined for resource StoreApiId, so we will use the resource logical id as the resource id
2025-01-31 15:54:56,569 | There is no customer defined id or cdk path defined for resource SecurityGroup, so we will use the resource logical id as the resource
id
2025-01-31 15:54:56,569 | 5 resources found in the stack
2025-01-31 15:54:56,569 | Found Serverless function with name='REMOVEDFunction' and CodeUri='src/'
2025-01-31 15:54:56,570 | --base-dir is not presented, adjusting uri src/ relative to
/Users/jonzeolla/src/REMOVED/template.yaml
2025-01-31 15:54:56,576 | 5 resources found in the stack
2025-01-31 15:54:56,576 | Found Serverless function with name='REMOVEDFunction' and CodeUri='src/'
2025-01-31 15:54:56,576 | Instantiating build definitions
2025-01-31 15:54:56,577 | Same function build definition found, adding function (Previous: BuildDefinition(python3.12,
/Users/jonzeolla/src/REMOVED/src, Zip, , 8eb8ce96-e730-49fd-b58e-c9b90929e62a, {}, {}, arm64, []), Current:
BuildDefinition(python3.12, /Users/jonzeolla/src/REMOVED/src, Zip, , c5f73946-60e5-4544-9a93-23a291311536, {}, {}, arm64,
[]), Function: Function({'function_id': 'REMOVEDFunction', 'name': 'REMOVEDFunction', 'functionname': 'REMOVEDFunction', 'runtime': 'python3.12', 'memory': 128,
'timeout': 60, 'handler': 'main.lambda_handler', 'imageuri': None, 'packagetype': 'Zip', 'imageconfig': None, 'codeuri':
'/Users/jonzeolla/src/REMOVED/src', 'environment': {'REMOVED': 'ITEMS'}}, 'rolearn': None, 'layers': [], 'events': {'DataApi': {'Type': 'HttpApi', 'Properties': {'Path':
'/api/data/{proxy+}', 'Method': 'GET', 'ApiId': 'DataApi'}}}, 'metadata': {'SamResourceId': 'REMOVEDFunction'}, 'inlinecode': None, 'codesign_config_arn': None,
'architectures': ['arm64'], 'function_url_config': None, 'function_build_info': <FunctionBuildInfo.BuildableZip: ('BuildableZip', 'Regular ZIP function which can
be build with SAM CLI')>, 'stack_path': '', 'runtime_management_config': None, 'logging_config': {'LogFormat': 'JSON'}}))
2025-01-31 15:54:56,579 | Building codeuri: /Users/jonzeolla/src/REMOVED/src runtime: python3.12 architecture: arm64
functions: REMOVEDFunction
2025-01-31 15:54:56,580 | Building to following folder /Users/jonzeolla/src/REMOVED/.aws-sam/build/REMOVEDFunction
2025-01-31 15:54:56,580 | Loading workflow module 'aws_lambda_builders.workflows'
2025-01-31 15:54:56,581 | Registering workflow 'CustomMakeBuilder' with capability 'Capability(language='provided', dependency_manager=None,
application_framework=None)'
2025-01-31 15:54:56,582 | Registering workflow 'DotnetCliPackageBuilder' with capability 'Capability(language='dotnet', dependency_manager='cli-package',
application_framework=None)'
2025-01-31 15:54:56,583 | Registering workflow 'GoModulesBuilder' with capability 'Capability(language='go', dependency_manager='modules',
application_framework=None)'
2025-01-31 15:54:56,584 | Registering workflow 'JavaGradleWorkflow' with capability 'Capability(language='java', dependency_manager='gradle',
application_framework=None)'
2025-01-31 15:54:56,585 | Registering workflow 'JavaMavenWorkflow' with capability 'Capability(language='java', dependency_manager='maven',
application_framework=None)'
2025-01-31 15:54:56,586 | Registering workflow 'NodejsNpmBuilder' with capability 'Capability(language='nodejs', dependency_manager='npm',
application_framework=None)'
2025-01-31 15:54:56,586 | Registering workflow 'NodejsNpmEsbuildBuilder' with capability 'Capability(language='nodejs', dependency_manager='npm-esbuild',
application_framework=None)'
2025-01-31 15:54:56,588 | Registering workflow 'PythonPipBuilder' with capability 'Capability(language='python', dependency_manager='pip',
application_framework=None)'
2025-01-31 15:54:56,588 | Registering workflow 'RubyBundlerBuilder' with capability 'Capability(language='ruby', dependency_manager='bundler',
application_framework=None)'
2025-01-31 15:54:56,589 | Registering workflow 'RustCargoLambdaBuilder' with capability 'Capability(language='rust', dependency_manager='cargo',
application_framework=None)'
2025-01-31 15:54:56,589 | Found workflow 'PythonPipBuilder' to support capabilities 'Capability(language='python', dependency_manager='pip',
application_framework=None)'
2025-01-31 15:54:56,606 | Running workflow 'PythonPipBuilder'
2025-01-31 15:54:56,607 |  Running PythonPipBuilder:ResolveDependencies
2025-01-31 15:54:56,641 | calling pip download -r /Users/jonzeolla/src/REMOVED/requirements.txt --dest
/var/folders/7x/83hwcqmj4pnd0qwq_wqdr94w0000gn/T/tmp4z949tuo --exists-action i
2025-01-31 15:54:57,154 | pip stdout: b'Collecting grpcio==1.70.0 (from -r /Users/jonzeolla/src/REMOVED/requirements.txt
(line 1))\n  Using cached grpcio-1.70.0-cp312-cp312-macosx_10_14_universal2.whl (11.4 MB)\nSaved
/private/var/folders/7x/83hwcqmj4pnd0qwq_wqdr94w0000gn/T/tmp4z949tuo/grpcio-1.70.0-cp312-cp312-macosx_10_14_universal2.whl\nSuccessfully downloaded grpcio\n'
2025-01-31 15:54:57,155 | pip stderr: b"WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.\nPlease see
https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.\nTo avoid this problem you can invoke Python with '-m pip' instead of running
pip directly.\n\n[notice] A new release of pip is available: 24.3.1 -> 25.0\n[notice] To update, run: python3.12 -m pip install --upgrade pip\n"
2025-01-31 15:54:57,156 | Full dependency closure: {grpcio==1.70.0(wheel)}
2025-01-31 15:54:57,156 | initial compatible: set()
2025-01-31 15:54:57,156 | initial incompatible: {grpcio==1.70.0(wheel)}
2025-01-31 15:54:57,157 | Downloading missing wheels: {grpcio==1.70.0(wheel)}
2025-01-31 15:54:57,157 | calling pip download --only-binary=:all: --no-deps --platform manylinux2014_aarch64 --implementation cp --abi cp312 --dest
/var/folders/7x/83hwcqmj4pnd0qwq_wqdr94w0000gn/T/tmp4z949tuo grpcio==1.70.0
2025-01-31 15:54:57,620 | pip stdout: b''
2025-01-31 15:54:57,620 | pip stderr: b"WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.\nPlease see
https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.\nTo avoid this problem you can invoke Python with '-m pip' instead of running
pip directly.\nERROR: Could not find a version that satisfies the requirement grpcio==1.70.0 (from versions: none)\n\n[notice] A new release of pip is available:
24.3.1 -> 25.0\n[notice] To update, run: python3.12 -m pip install --upgrade pip\nERROR: No matching distribution found for grpcio==1.70.0\n"
2025-01-31 15:54:57,621 | compatible wheels after second download pass: set()
2025-01-31 15:54:57,621 | Build missing wheels from sdists (C compiling True): set()
2025-01-31 15:54:57,621 | compatible after building wheels (no C compiling): set()
2025-01-31 15:54:57,622 | Build missing wheels from sdists (C compiling False): set()
2025-01-31 15:54:57,622 | compatible after building wheels (C compiling): set()
2025-01-31 15:54:57,622 | Final compatible: set()
2025-01-31 15:54:57,622 | Final incompatible: {grpcio==1.70.0(wheel)}
2025-01-31 15:54:57,623 | Final missing wheels: {grpcio==1.70.0(wheel)}
2025-01-31 15:54:57,623 | PythonPipBuilder:ResolveDependencies failed
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/aws-sam-cli/1.132.0_1/libexec/lib/python3.13/site-packages/aws_lambda_builders/workflows/python_pip/actions.py", line 71, in execute
    package_builder.build_dependencies(
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        artifacts_dir_path=target_artifact_dir,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        scratch_dir_path=self.scratch_dir,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        requirements_path=self.manifest_path,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/opt/homebrew/Cellar/aws-sam-cli/1.132.0_1/libexec/lib/python3.13/site-packages/aws_lambda_builders/workflows/python_pip/packager.py", line 158, in
build_dependencies
    self._dependency_builder.build_site_packages(requirements_path, artifacts_dir_path, scratch_dir_path)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/aws-sam-cli/1.132.0_1/libexec/lib/python3.13/site-packages/aws_lambda_builders/workflows/python_pip/packager.py", line 266, in
build_site_packages
    raise MissingDependencyError(packages_without_wheels)
aws_lambda_builders.workflows.python_pip.packager.MissingDependencyError: {grpcio==1.70.0(wheel)}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/homebrew/Cellar/aws-sam-cli/1.132.0_1/libexec/lib/python3.13/site-packages/aws_lambda_builders/workflow.py", line 374, in run
    action.execute()
    ~~~~~~~~~~~~~~^^
  File "/opt/homebrew/Cellar/aws-sam-cli/1.132.0_1/libexec/lib/python3.13/site-packages/aws_lambda_builders/workflows/python_pip/actions.py", line 77, in execute
    raise ActionFailedError(str(ex))
aws_lambda_builders.actions.ActionFailedError: {grpcio==1.70.0(wheel)}

Build Failed
2025-01-31 15:54:57,626 | Telemetry endpoint configured to be https://aws-serverless-tools-telemetry.us-west-2.amazonaws.com/metrics
2025-01-31 15:54:57,645 | Telemetry endpoint configured to be https://aws-serverless-tools-telemetry.us-west-2.amazonaws.com/metrics
2025-01-31 15:54:57,646 | Sending Telemetry: {'metrics': [{'commandRun': {'requestId': '531f5aee-3f78-4b66-8389-db6752c49a0e', 'installationId':
'74f11176-db09-4ba9-8716-194102f04973', 'sessionId': '45371a83-16a0-45f6-adc6-b513ab38dace', 'executionEnvironment': 'CLI', 'ci': False, 'pyversion': '3.13.1',
'samcliVersion': '1.132.0', 'awsProfileProvided': False, 'debugFlagProvided': True, 'region': 'us-east-1', 'commandName': 'sam build', 'metricSpecificAttributes':
{'projectType': 'CFN', 'gitOrigin': None, 'projectName': '8a394d9ca2e0fda8fbb794353fca844f7b926087967d0807f32b65ae8d02ae7c', 'initialCommit': None}, 'duration':
1099, 'exitReason': 'WorkflowFailedError', 'exitCode': 1}}]}
2025-01-31 15:54:57,646 | Unable to find Click Context for getting session_id.
2025-01-31 15:54:57,647 | Sending Telemetry: {'metrics': [{'events': {'requestId': '159655f1-e8af-4bea-a0dd-8b748b9b8108', 'installationId':
'74f11176-db09-4ba9-8716-194102f04973', 'sessionId': '45371a83-16a0-45f6-adc6-b513ab38dace', 'executionEnvironment': 'CLI', 'ci': False, 'pyversion': '3.13.1',
'samcliVersion': '1.132.0', 'commandName': 'sam build', 'metricSpecificAttributes': {'events': [{'event_name': 'SamConfigFileExtension', 'event_value': '.yaml',
'thread_id': '725c49de150940aaac840c1aff92c3a0', 'time_stamp': '2025-01-31 20:54:56.508', 'exception_name': None}, {'event_name': 'SamConfigFileExtension',
'event_value': '.toml', 'thread_id': 'b0d3b721ce9c466bb4f6e66ea3d2ab4d', 'time_stamp': '2025-01-31 20:54:56.527', 'exception_name': None}, {'event_name':
'BuildFunctionRuntime', 'event_value': 'python3.12', 'thread_id': '325ad8ddd3ac413295ed5fbdf72b5b36', 'time_stamp': '2025-01-31 20:54:56.576', 'exception_name':
None}, {'event_name': 'BuildWorkflowUsed', 'event_value': 'python-pip', 'thread_id': 'e3a677fd6c194044969f12ffea967156', 'time_stamp': '2025-01-31 20:54:56.580',
'exception_name': None}]}}}]}
2025-01-31 15:54:57,937 | HTTPSConnectionPool(host='aws-serverless-tools-telemetry.us-west-2.amazonaws.com', port=443): Read timed out. (read timeout=0.1)
2025-01-31 15:54:57,938 | HTTPSConnectionPool(host='aws-serverless-tools-telemetry.us-west-2.amazonaws.com', port=443): Read timed out. (read timeout=0.1)
Error: PythonPipBuilder:ResolveDependencies - {grpcio==1.70.0(wheel)}
 svc/data_api on  fix/sam-cross-build [$!+] [Environment: container]

Success

Only change is I added --use-container

$ sam build --manifest "requirements.txt" \
  --use-container --region us-east-1 \
  --debug \
  --parameter-overrides \
      REMOVED="ITEMS"
2025-01-31 15:55:19,623 | Config file location: /Users/jonzeolla/src/REMOVED/samconfig.yaml
2025-01-31 15:55:19,624 | Loading configuration values from [default.['build'].parameters] (env.command_name.section) in config file at
'/Users/jonzeolla/src/REMOVED/samconfig.yaml'...
2025-01-31 15:55:19,624 | Configuration values successfully loaded.
2025-01-31 15:55:19,625 | Configuration values are: {}
2025-01-31 15:55:19,630 | Using SAM Template at /Users/jonzeolla/src/REMOVED/template.yaml
2025-01-31 15:55:19,641 | OSError occurred while reading TOML file: [Errno 2] No such file or directory:
'/Users/jonzeolla/src/REMOVED/samconfig.toml'
2025-01-31 15:55:19,641 | Using config file: samconfig.toml, config environment: default
2025-01-31 15:55:19,641 | Expand command line arguments to:
2025-01-31 15:55:19,641 | --template_file=/Users/jonzeolla/src/REMOVED/template.yaml --manifest=requirements.txt
--use_container --parameter_overrides={'REMOVED': 'ITEMS'} --mount_with=READ --build_dir=.aws-sam/build --cache_dir=.aws-sam/cache
2025-01-31 15:55:19,658 | 'build' command is called
2025-01-31 15:55:19,658 | Starting Build inside a container
2025-01-31 15:55:19,664 | Collected default values for parameters: {'REMOVED': 'ITEMS'}
2025-01-31 15:55:19,672 | There is no customer defined id or cdk path defined for resource REMOVEDFunction, so we will use the resource logical id as the resource
id
2025-01-31 15:55:19,673 | There is no customer defined id or cdk path defined for resource DataApi, so we will use the resource logical id as the resource id
2025-01-31 15:55:19,673 | There is no customer defined id or cdk path defined for resource ApiGatewayLogGroup, so we will use the resource logical id as the
resource id
2025-01-31 15:55:19,673 | There is no customer defined id or cdk path defined for resource StoreApiId, so we will use the resource logical id as the resource id
2025-01-31 15:55:19,673 | There is no customer defined id or cdk path defined for resource SecurityGroup, so we will use the resource logical id as the resource
id
2025-01-31 15:55:19,674 | 0 stacks found in the template
2025-01-31 15:55:19,674 | Collected default values for parameters: {'REMOVED': 'ITEMS'}
2025-01-31 15:55:19,681 | There is no customer defined id or cdk path defined for resource REMOVEDFunction, so we will use the resource logical id as the resource
id
2025-01-31 15:55:19,682 | There is no customer defined id or cdk path defined for resource DataApi, so we will use the resource logical id as the resource id
2025-01-31 15:55:19,682 | There is no customer defined id or cdk path defined for resource ApiGatewayLogGroup, so we will use the resource logical id as the
resource id
2025-01-31 15:55:19,682 | There is no customer defined id or cdk path defined for resource StoreApiId, so we will use the resource logical id as the resource id
2025-01-31 15:55:19,682 | There is no customer defined id or cdk path defined for resource SecurityGroup, so we will use the resource logical id as the resource
id
2025-01-31 15:55:19,683 | 5 resources found in the stack
2025-01-31 15:55:19,683 | Found Serverless function with name='REMOVEDFunction' and CodeUri='src/'
2025-01-31 15:55:19,684 | --base-dir is not presented, adjusting uri src/ relative to
/Users/jonzeolla/src/REMOVED/template.yaml
2025-01-31 15:55:19,690 | 5 resources found in the stack
2025-01-31 15:55:19,690 | Found Serverless function with name='REMOVEDFunction' and CodeUri='src/'
2025-01-31 15:55:19,690 | Instantiating build definitions
2025-01-31 15:55:19,691 | Same function build definition found, adding function (Previous: BuildDefinition(python3.12,
/Users/jonzeolla/src/REMOVED/src, Zip, , 8eb8ce96-e730-49fd-b58e-c9b90929e62a, {}, {}, arm64, []), Current:
BuildDefinition(python3.12, /Users/jonzeolla/src/REMOVED/src, Zip, , 22c2f994-5607-4230-9584-580b4c9d2ed0, {}, {}, arm64,
[]), Function: Function({'function_id': 'REMOVEDFunction', 'name': 'REMOVEDFunction', 'functionname': 'REMOVEDFunction', 'runtime': 'python3.12', 'memory': 128,
'timeout': 60, 'handler': 'main.lambda_handler', 'imageuri': None, 'packagetype': 'Zip', 'imageconfig': None, 'codeuri':
'/Users/jonzeolla/src/REMOVED/src', 'environment': {'Variables': {'REMOVED': "ITEMS"}}, 'rolearn': None, 'layers': [], 'events': {'DataApi': {'Type': 'HttpApi', 'Properties': {'Path':
'/api/data/{proxy+}', 'Method': 'GET', 'ApiId': 'DataApi'}}}, 'metadata': {'SamResourceId': 'REMOVEDFunction'}, 'inlinecode': None, 'codesign_config_arn': None,
'architectures': ['arm64'], 'function_url_config': None, 'function_build_info': <FunctionBuildInfo.BuildableZip: ('BuildableZip', 'Regular ZIP function which can
be build with SAM CLI')>, 'stack_path': '', 'runtime_management_config': None, 'logging_config': {'LogFormat': 'JSON'}}))
2025-01-31 15:55:19,693 | Building codeuri: /Users/jonzeolla/src/REMOVED/src runtime: python3.12 architecture: arm64
functions: REMOVEDFunction
2025-01-31 15:55:19,693 | Building to following folder /Users/jonzeolla/src/REMOVED/.aws-sam/build/REMOVEDFunction
2025-01-31 15:55:19,698 | Checking free port on 127.0.0.1:8278

Fetching public.ecr.aws/sam/build-python3.12:latest-arm64 Docker container image......
2025-01-31 15:55:20,393 | Mounting /Users/jonzeolla/src/REMOVED/src 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 'CustomMakeBuilder' with capability 'Capability(language='provided', dependency_manager=None, application_framework=None)'
Registering workflow 'DotnetCliPackageBuilder' with capability 'Capability(language='dotnet', dependency_manager='cli-package', 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 'NodejsNpmBuilder' with capability 'Capability(language='nodejs', dependency_manager='npm', application_framework=None)'
Registering workflow 'NodejsNpmEsbuildBuilder' with capability 'Capability(language='nodejs', dependency_manager='npm-esbuild', application_framework=None)'
Registering workflow 'PythonPipBuilder' with capability 'Capability(language='python', dependency_manager='pip', application_framework=None)'
Registering workflow 'RubyBundlerBuilder' with capability 'Capability(language='ruby', dependency_manager='bundler', application_framework=None)'
Registering workflow 'RustCargoLambdaBuilder' with capability 'Capability(language='rust', dependency_manager='cargo', 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/manifest/requirements.txt --dest /tmp/samcli/scratch --exists-action i
pip stdout: b'Collecting grpcio==1.70.0 (from -r /tmp/samcli/manifest/requirements.txt (line 1))\n  Downloading grpcio-1.70.0-cp312-cp312-manylinux_2_17_aarch64.whl (5.7 MB)\n     \xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81 5.7/5.7 MB 14.6 MB/s eta 0:00:00\nSaved /tmp/samcli/scratch/grpcio-1.70.0-cp312-cp312-manylinux_2_17_aarch64.whl\nSuccessfully downloaded grpcio\n'
pip stderr: b"WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.\nPlease see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.\nTo avoid this problem you can invoke Python with '-m pip' instead of running pip directly.\n\n[notice] A new release of pip is available: 24.2 -> 25.0\n[notice] To update, run: pip install --upgrade pip\n"
Full dependency closure: {grpcio==1.70.0(wheel)}
initial compatible: {grpcio==1.70.0(wheel)}
initial incompatible: set()
Downloading missing wheels: set()
compatible wheels after second download pass: {grpcio==1.70.0(wheel)}
Build missing wheels from sdists (C compiling True): set()
compatible after building wheels (no C compiling): {grpcio==1.70.0(wheel)}
Build missing wheels from sdists (C compiling False): set()
compatible after building wheels (C compiling): {grpcio==1.70.0(wheel)}
Final compatible: {grpcio==1.70.0(wheel)}
Final incompatible: set()
Final missing wheels: set()
PythonPipBuilder:ResolveDependencies succeeded
 Running PythonPipBuilder:CopySource
Creating target folders at /tmp/samcli/artifacts/etc
Copying directory metadata from source (/tmp/samcli/source/etc) to destination (/tmp/samcli/artifacts/etc)
Copying source file (/tmp/samcli/source/etc/configuration.yaml) to destination (/tmp/samcli/artifacts/etc/configuration.yaml)
Creating target folders at /tmp/samcli/artifacts/data_api
Copying directory metadata from source (/tmp/samcli/source/data_api) to destination (/tmp/samcli/artifacts/data_api)
Creating target folders at /tmp/samcli/artifacts/data_api/handler
Copying directory metadata from source (/tmp/samcli/source/data_api/handler) to destination (/tmp/samcli/artifacts/data_api/handler)
Copying source file (/tmp/samcli/source/data_api/handler/handler_errors.py) to destination (/tmp/samcli/artifacts/data_api/handler/handler_errors.py)
Copying source file (/tmp/samcli/source/data_api/handler/handler_structures.py) to destination (/tmp/samcli/artifacts/data_api/handler/handler_structures.py)
Copying source file (/tmp/samcli/source/data_api/handler/base_handler.py) to destination (/tmp/samcli/artifacts/data_api/handler/base_handler.py)
Creating target folders at /tmp/samcli/artifacts/data_api/handler/handlers
Copying directory metadata from source (/tmp/samcli/source/data_api/handler/handlers) to destination (/tmp/samcli/artifacts/data_api/handler/handlers)
Copying source file (/tmp/samcli/source/data_api/handler/handlers/roles_handler.py) to destination (/tmp/samcli/artifacts/data_api/handler/handlers/roles_handler.py)
Copying source file (/tmp/samcli/source/data_api/handler/handlers/graph_handler.py) to destination (/tmp/samcli/artifacts/data_api/handler/handlers/graph_handler.py)
Copying source file (/tmp/samcli/source/data_api/handler/handlers/insights_handler.py) to destination (/tmp/samcli/artifacts/data_api/handler/handlers/insights_handler.py)
Copying source file (/tmp/samcli/source/data_api/handler/handler_tools.py) to destination (/tmp/samcli/artifacts/data_api/handler/handler_tools.py)
Copying source file (/tmp/samcli/source/data_api/config.py) to destination (/tmp/samcli/artifacts/data_api/config.py)
Copying source file (/tmp/samcli/source/data_api/__init__.py) to destination (/tmp/samcli/artifacts/data_api/__init__.py)
Copying source file (/tmp/samcli/source/main.py) to destination (/tmp/samcli/artifacts/main.py)
PythonPipBuilder:CopySource succeeded
2025-01-31 15:55:22,073 | Build inside container returned response {"jsonrpc": "2.0", "id": 1, "result": {"artifacts_dir": "/tmp/samcli/artifacts"}}
2025-01-31 15:55:22,076 | Build inside container was successful. Copying artifacts from container to host
2025-01-31 15:55:22,150 | Copying from container: /tmp/samcli/artifacts/. ->
/Users/jonzeolla/src/REMOVED/.aws-sam/build/REMOVEDFunction
2025-01-31 15:55:22,220 | Build inside container succeeded
2025-01-31 15:55:22,220 | There is no customer defined id or cdk path defined for resource REMOVEDFunction, so we will use the resource logical id as the resource
id
2025-01-31 15:55:22,221 | There is no customer defined id or cdk path defined for resource DataApi, so we will use the resource logical id as the resource id
2025-01-31 15:55:22,221 | There is no customer defined id or cdk path defined for resource ApiGatewayLogGroup, so we will use the resource logical id as the
resource id
2025-01-31 15:55:22,221 | There is no customer defined id or cdk path defined for resource StoreApiId, so we will use the resource logical id as the resource id
2025-01-31 15:55:22,222 | There is no customer defined id or cdk path defined for resource SecurityGroup, so we will use the resource logical id as the resource
id
2025-01-31 15:55:22,222 | 5 resources found in the stack
2025-01-31 15:55:22,222 | Found Serverless function with name='REMOVEDFunction' and CodeUri='src/'

Build Succeeded

Built Artifacts  : .aws-sam/build
Built Template   : .aws-sam/build/template.yaml

Commands you can use next
=========================
[*] Validate SAM template: sam validate
[*] Invoke Function: sam local invoke
[*] Test Function in the Cloud: sam sync --stack-name {{stack-name}} --watch
[*] Deploy: sam deploy --guided
2025-01-31 15:55:22,227 | Telemetry endpoint configured to be https://aws-serverless-tools-telemetry.us-west-2.amazonaws.com/metrics
2025-01-31 15:55:22,250 | Telemetry endpoint configured to be https://aws-serverless-tools-telemetry.us-west-2.amazonaws.com/metrics
2025-01-31 15:55:22,251 | Sending Telemetry: {'metrics': [{'commandRun': {'requestId': '015bff2f-8ccf-440b-850f-801343612ea9', 'installationId':
'74f11176-db09-4ba9-8716-194102f04973', 'sessionId': 'f972341e-da58-4461-ae7a-7c3f8cee1e91', 'executionEnvironment': 'CLI', 'ci': False, 'pyversion': '3.13.1',
'samcliVersion': '1.132.0', 'awsProfileProvided': False, 'debugFlagProvided': True, 'region': 'us-east-1', 'commandName': 'sam build', 'metricSpecificAttributes':
{'projectType': 'CFN', 'gitOrigin': None, 'projectName': '8a394d9ca2e0fda8fbb794353fca844f7b926087967d0807f32b65ae8d02ae7c', 'initialCommit': None}, 'duration':
2585, 'exitReason': 'success', 'exitCode': 0}}]}
2025-01-31 15:55:22,251 | Unable to find Click Context for getting session_id.
2025-01-31 15:55:22,253 | Sending Telemetry: {'metrics': [{'events': {'requestId': '9d72032f-8a87-45ed-8967-b9409ed77c96', 'installationId':
'74f11176-db09-4ba9-8716-194102f04973', 'sessionId': 'f972341e-da58-4461-ae7a-7c3f8cee1e91', 'executionEnvironment': 'CLI', 'ci': False, 'pyversion': '3.13.1',
'samcliVersion': '1.132.0', 'commandName': 'sam build', 'metricSpecificAttributes': {'events': [{'event_name': 'SamConfigFileExtension', 'event_value': '.yaml',
'thread_id': '9cb67f42d5c641dab9333ace4ab23b38', 'time_stamp': '2025-01-31 20:55:19.623', 'exception_name': None}, {'event_name': 'SamConfigFileExtension',
'event_value': '.toml', 'thread_id': '6e6ef9378d8643beb2fc61e962086c83', 'time_stamp': '2025-01-31 20:55:19.641', 'exception_name': None}, {'event_name':
'BuildWorkflowUsed', 'event_value': 'python-pip', 'thread_id': 'ad13d294de2b4ab79c441c814131785e', 'time_stamp': '2025-01-31 20:55:19.690', 'exception_name':
None}, {'event_name': 'BuildFunctionRuntime', 'event_value': 'python3.12', 'thread_id': '720fe6bfa9fd421099dc8012ccc56779', 'time_stamp': '2025-01-31
20:55:19.690', 'exception_name': None}, {'event_name': 'BuildWorkflowUsed', 'event_value': 'python-pip', 'thread_id': 'feb6d23cce154afebd544efd94bcc77a',
'time_stamp': '2025-01-31 20:55:19.694', 'exception_name': None}]}}}]}
2025-01-31 15:55:22,547 | HTTPSConnectionPool(host='aws-serverless-tools-telemetry.us-west-2.amazonaws.com', port=443): Read timed out. (read timeout=0.1)
2025-01-31 15:55:22,550 | HTTPSConnectionPool(host='aws-serverless-tools-telemetry.us-west-2.amazonaws.com', port=443): Read timed out. (read timeout=0.1)

Expected result:

I expected it would succeed without --use-container

Additional environment details (Ex: Windows, Mac, Amazon Linux etc)

  1. OS: Apple M3 Max 15.2 (24C101)
  2. sam --version:
  3. AWS region: us-east-1
$ sam --info
{
  "version": "1.132.0",
  "system": {
    "python": "3.13.1",
    "os": "macOS-15.2-arm64-arm-64bit-Mach-O"
  },
  "additional_dependencies": {
    "docker_engine": "27.4.0",
    "aws_cdk": "Not available",
    "terraform": "Not available"
  },
  "available_beta_feature_env_vars": [
    "SAM_CLI_BETA_FEATURES",
    "SAM_CLI_BETA_BUILD_PERFORMANCE",
    "SAM_CLI_BETA_TERRAFORM_SUPPORT",
    "SAM_CLI_BETA_RUST_CARGO_LAMBDA"
  ]
}
@JonZeolla JonZeolla added the stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at. label Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at.
Projects
None yet
Development

No branches or pull requests

1 participant