You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Error: 500 Server Error for http+docker://localhost/v1.35/build?t=mylambdafunction%3Alatest&q=False&nocache=False&rm=True&forcerm=False&pull=False&dockerfile=.&platform=linux%2Famd64: Internal Server Error ("unexpected error reading Dockerfile: read /var/lib/docker/tmp/docker-builder1007095826: is a directory")
It is very similar to #6308 but the error message, maybe errno, is differ.
$ sam build --debug2024-09-25 00:41:12,786 | No config file found in this directory.2024-09-25 00:41:12,786 | OSError occurred while reading TOML file: [Errno 2] No such file or directory: '/home/lufia/Downloads/sam/xx/samconfig.toml'2024-09-25 00:41:12,786 | Config file location: /home/lufia/Downloads/sam/xx/samconfig.toml2024-09-25 00:41:12,786 | Config file '/home/lufia/Downloads/sam/xx/samconfig.toml' does not exist2024-09-25 00:41:12,787 | Using SAM Template at /home/lufia/Downloads/sam/xx/template.yaml2024-09-25 00:41:12,800 | OSError occurred while reading TOML file: [Errno 2] No such file or directory: '/home/lufia/Downloads/sam/xx/samconfig.toml'2024-09-25 00:41:12,800 | Using config file: samconfig.toml, config environment: default2024-09-25 00:41:12,800 | Expand command line arguments to:2024-09-25 00:41:12,800 | --template_file=/home/lufia/Downloads/sam/xx/template.yaml --mount_with=READ --build_dir=.aws-sam/build --cache_dir=.aws-sam/cache 2024-09-25 00:41:12,824 | 'build' command is called2024-09-25 00:41:12,825 | No Parameters detected in the template2024-09-25 00:41:12,862 | There is no customer defined id or cdk path defined for resource MyLambdaFunction, so we will use the resource logical id as the resource id2024-09-25 00:41:12,862 | There is no customer defined id or cdk path defined for resource ServerlessRestApi, so we will use the resource logical id as the resource id2024-09-25 00:41:12,863 | 0 stacks found in the template2024-09-25 00:41:12,863 | No Parameters detected in the template2024-09-25 00:41:12,874 | There is no customer defined id or cdk path defined for resource MyLambdaFunction, so we will use the resource logical id as the resource id2024-09-25 00:41:12,874 | There is no customer defined id or cdk path defined for resource ServerlessRestApi, so we will use the resource logical id as the resource id2024-09-25 00:41:12,874 | 2 resources found in the stack 2024-09-25 00:41:12,874 | Found Serverless function with name='MyLambdaFunction' and ImageUri='None'2024-09-25 00:41:12,874 | --base-dir is not presented, adjusting uri . relative to /home/lufia/Downloads/sam/xx/template.yaml2024-09-25 00:41:12,874 | --base-dir is not presented, adjusting uri . relative to /home/lufia/Downloads/sam/xx/template.yaml2024-09-25 00:41:12,875 | 2 resources found in the stack 2024-09-25 00:41:12,876 | Found Serverless function with name='MyLambdaFunction' and ImageUri='None'2024-09-25 00:41:12,876 | Error occurred while trying to track an event: Event 'BuildFunctionRuntime' does not accept value 'None'.2024-09-25 00:41:12,876 | Instantiating build definitions
2024-09-25 00:41:12,877 | Unique function build definition found, adding as new (Function Build Definition: BuildDefinition(None, /home/lufia/Downloads/sam/xx, Image, , a5fae4d6-a071-48f5-b7c9-1b2500452402, {'DockerContext': '/home/lufia/Downloads/sam/xx', 'Dockerfile': '.'}, {}, x86_64, []), Function: Function({'function_id': 'MyLambdaFunction', 'name': 'MyLambdaFunction', 'functionname': 'MyLambdaFunction', 'runtime': None, 'memory': None, 'timeout': None, 'handler': None, 'imageuri': None, 'packagetype': 'Image', 'imageconfig': None, 'codeuri': '/home/lufia/Downloads/sam/xx', 'environment': None, 'rolearn': None, 'layers': [], 'events': {'MyAPI': {'Type': 'Api', 'Properties': {'Path': '/', 'Method': 'GET', 'RestApiId': 'ServerlessRestApi'}}}, 'metadata': {'DockerContext': '/home/lufia/Downloads/sam/xx', 'Dockerfile': '.', 'SamResourceId': 'MyLambdaFunction'}, 'inlinecode': None, 'codesign_config_arn': None, 'architectures': ['x86_64'], 'function_url_config': None, 'function_build_info': <FunctionBuildInfo.BuildableImage: ('BuildableImage', 'Regular IMAGE function which can be build with SAM CLI')>, 'stack_path': '', 'runtime_management_config': None, 'logging_config': None}))
2024-09-25 00:41:12,878 | Building codeuri: /home/lufia/Downloads/sam/xx runtime: None architecture: x86_64 functions: MyLambdaFunction2024-09-25 00:41:12,878 | Building to following folder /home/lufia/Downloads/sam/xx/.aws-sam/build/MyLambdaFunction2024-09-25 00:41:12,878 | Building image for MyLambdaFunction function2024-09-25 00:41:12,880 | Setting DockerBuildArgs for MyLambdaFunction function2024-09-25 00:41:12,886 | Telemetry endpoint configured to be https://aws-serverless-tools-telemetry.us-west-2.amazonaws.com/metrics2024-09-25 00:41:12,891 | Telemetry endpoint configured to be https://aws-serverless-tools-telemetry.us-west-2.amazonaws.com/metrics2024-09-25 00:41:12,891 | Unable to find Click Context for getting session_id.2024-09-25 00:41:12,891 | Sending Telemetry: {'metrics': [{'commandRun': {'requestId': '30387b61-b8b6-43b9-abc4-c82d9a621f05', 'installationId': 'af4e5d08-e36d-4473-9826-fa2fe9740cfb', 'sessionId': 'cabca648-cde9-48f1-94da-090578f6bd16', 'executionEnvironment': 'CLI', 'ci': False, 'pyversion': '3.11.10', 'samcliVersion': '1.124.0', 'awsProfileProvided': False, 'debugFlagProvided': True, 'region': '', 'commandName': 'sam build', 'metricSpecificAttributes': {'projectType': 'CFN', 'gitOrigin': None, 'projectName': '5dde896887f6754c9b15bfe3a441ae4806df2fde94001311e08bf110622e0bbe', 'initialCommit': None}, 'duration': 86, 'exitReason': 'APIError', 'exitCode': 255}}]}2024-09-25 00:41:12,891 | Sending Telemetry: {'metrics': [{'events': {'requestId': '74b7cc08-358e-4012-817b-1f7989f1bd3f', 'installationId': 'af4e5d08-e36d-4473-9826-fa2fe9740cfb', 'sessionId': 'cabca648-cde9-48f1-94da-090578f6bd16', 'executionEnvironment': 'CLI', 'ci': False, 'pyversion': '3.11.10', 'samcliVersion': '1.124.0', 'commandName': 'sam build', 'metricSpecificAttributes': {'events': [{'event_name': 'SamConfigFileExtension', 'event_value': '.toml', 'thread_id': '12aeb39af1e94a01be28a684b6386580', 'time_stamp': '2024-09-24 15:41:12.786', 'exception_name': None}, {'event_name': 'SamConfigFileExtension', 'event_value': '.toml', 'thread_id': '5add3ea0cbd94edfbe284fcc766638f7', 'time_stamp': '2024-09-24 15:41:12.800', 'exception_name': None}]}}}]}2024-09-25 00:41:13,349 | HTTPSConnectionPool(host='aws-serverless-tools-telemetry.us-west-2.amazonaws.com', port=443): Read timed out. (read timeout=0.1)2024-09-25 00:41:13,352 | HTTPSConnectionPool(host='aws-serverless-tools-telemetry.us-west-2.amazonaws.com', port=443): Read timed out. (read timeout=0.1)Error: 500 Server Error for http+docker://localhost/v1.35/build?t=mylambdafunction%3Alatest&q=False&nocache=False&rm=True&forcerm=False&pull=False&dockerfile=.&platform=linux%2Famd64: Internal Server Error ("unexpected error reading Dockerfile: read /var/lib/docker/tmp/docker-builder3124676323: is a directory")Traceback: File "click/core.py", line 1078, in main File "click/core.py", line 1688, in invoke File "click/core.py", line 1434, in invoke File "click/core.py", line 783, in invoke File "samcli/cli/cli_config_file.py", line 347, in wrapper File "click/decorators.py", line 92, in new_func File "click/core.py", line 783, in invoke File "samcli/lib/telemetry/metric.py", line 185, in wrapped File "samcli/lib/telemetry/metric.py", line 150, in wrapped File "samcli/lib/utils/version_checker.py", line 43, in wrapped File "samcli/cli/main.py", line 95, in wrapper File "samcli/commands/build/command.py", line 169, in cli File "samcli/commands/build/command.py", line 258, in do_cli File "samcli/commands/build/build_context.py", line 284, in run File "samcli/lib/build/app_builder.py", line 226, in build File "samcli/lib/build/build_strategy.py", line 83, in build File "samcli/lib/build/build_strategy.py", line 93, in _build_functions File "samcli/lib/build/build_strategy.py", line 167, in build_single_function_definition File "samcli/lib/build/app_builder.py", line 671, in _build_function File "samcli/lib/build/app_builder.py", line 429, in _build_lambda_image File "docker/models/images.py", line 302, in build File "docker/utils/json_stream.py", line 60, in split_buffer File "docker/utils/json_stream.py", line 16, in stream_as_text File "docker/api/client.py", line 374, in _stream_helper File "docker/api/client.py", line 281, in _result File "docker/api/client.py", line 277, in _raise_for_status File "docker/errors.py", line 39, in create_api_error_from_http_exceptionAn unexpected error was encountered while executing "sam build".Search for an existing issue:https://github.com/aws/aws-sam-cli/issues?q=is%3Aissue+is%3Aopen+Bug%3A%20sam%20build%20-%20APIErrorOr create a bug report:https://github.com/aws/aws-sam-cli/issues/new?template=Bug_report.md&title=Bug%3A%20sam%20build%20-%20APIError
Expected result:
No errors.
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.
Description:
I have an issue with
sam build
.It is very similar to #6308 but the error message, maybe errno, is differ.
Steps to reproduce:
I can reproduce this with two files.
1. Dockerfile
FROM postgres:15
2. template.yaml
Observed result:
Expected result:
No errors.
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
sam --version
: SAM CLI, version 1.124.0Add --debug flag to command you are running
The text was updated successfully, but these errors were encountered: