-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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: sam build --use-container times out on Amazon Linux 2 #6361
Comments
Thanks for opening this issue! I can reproduce your issue where it appears that the build command is stuck. It looks like the Docker container that is created as part of the Taking a look at the template, the functions are defined as Alternatively, changing the architecture over to |
Thank you, I tried switching to: Architectures:
- x86_64 However, this results in a different error: Admin:~/environment/serverless-pdf-chat/backend (main) $ sam build --use-container --debug
2023-12-01 05:32:54,110 | No config file found in this directory.
2023-12-01 05:32:54,116 | OSError occurred while reading TOML file: [Errno 2] No such file or directory:
'/home/ec2-user/environment/serverless-pdf-chat/backend/samconfig.toml'
2023-12-01 05:32:54,118 | Config file location: /home/ec2-user/environment/serverless-pdf-chat/backend/samconfig.toml
2023-12-01 05:32:54,120 | Config file '/home/ec2-user/environment/serverless-pdf-chat/backend/samconfig.toml' does not exist
2023-12-01 05:32:54,157 | Using SAM Template at /home/ec2-user/environment/serverless-pdf-chat/backend/template.yaml
2023-12-01 05:32:54,188 | OSError occurred while reading TOML file: [Errno 2] No such file or directory:
'/home/ec2-user/environment/serverless-pdf-chat/backend/samconfig.toml'
2023-12-01 05:32:54,196 | Using config file: samconfig.toml, config environment: default
2023-12-01 05:32:54,197 | Expand command line arguments to:
2023-12-01 05:32:54,200 | --template_file=/home/ec2-user/environment/serverless-pdf-chat/backend/template.yaml --use_container
--mount_with=READ --build_dir=.aws-sam/build --cache_dir=.aws-sam/cache
2023-12-01 05:32:54,310 | 'build' command is called
2023-12-01 05:32:54,311 | Starting Build inside a container
2023-12-01 05:32:54,348 | Collected default values for parameters: {'Frontend': 'local'}
2023-12-01 05:32:54,389 | There is no customer defined id or cdk path defined for resource DocumentBucket, so we will use the resource
logical id as the resource id
2023-12-01 05:32:54,392 | There is no customer defined id or cdk path defined for resource DocumentBucketPolicy, so we will use the
resource logical id as the resource id
2023-12-01 05:32:54,393 | There is no customer defined id or cdk path defined for resource EmbeddingQueue, so we will use the resource
logical id as the resource id
2023-12-01 05:32:54,395 | There is no customer defined id or cdk path defined for resource EmbeddingQueuePolicy, so we will use the
resource logical id as the resource id
2023-12-01 05:32:54,397 | There is no customer defined id or cdk path defined for resource DocumentTable, so we will use the resource
logical id as the resource id
2023-12-01 05:32:54,399 | There is no customer defined id or cdk path defined for resource MemoryTable, so we will use the resource
logical id as the resource id
2023-12-01 05:32:54,401 | There is no customer defined id or cdk path defined for resource CognitoUserPool, so we will use the
resource logical id as the resource id
2023-12-01 05:32:54,403 | There is no customer defined id or cdk path defined for resource CognitoUserPoolClient, so we will use the
resource logical id as the resource id
2023-12-01 05:32:54,405 | There is no customer defined id or cdk path defined for resource Api, so we will use the resource logical id
as the resource id
2023-12-01 05:32:54,407 | There is no customer defined id or cdk path defined for resource GeneratePresignedUrlFunction, so we will
use the resource logical id as the resource id
2023-12-01 05:32:54,409 | There is no customer defined id or cdk path defined for resource UploadTriggerFunction, so we will use the
resource logical id as the resource id
2023-12-01 05:32:54,411 | There is no customer defined id or cdk path defined for resource GetDocumentFunction, so we will use the
resource logical id as the resource id
2023-12-01 05:32:54,413 | There is no customer defined id or cdk path defined for resource GetAllDocuments, so we will use the
resource logical id as the resource id
2023-12-01 05:32:54,415 | There is no customer defined id or cdk path defined for resource AddConversationFunction, so we will use the
resource logical id as the resource id
2023-12-01 05:32:54,417 | There is no customer defined id or cdk path defined for resource GenerateEmbeddingsFunction, so we will use
the resource logical id as the resource id
2023-12-01 05:32:54,419 | There is no customer defined id or cdk path defined for resource GenerateResponseFunction, so we will use
the resource logical id as the resource id
2023-12-01 05:32:54,421 | There is no customer defined id or cdk path defined for resource AmplifyApp, so we will use the resource
logical id as the resource id
2023-12-01 05:32:54,423 | There is no customer defined id or cdk path defined for resource AmplifyBranch, so we will use the resource
logical id as the resource id
2023-12-01 05:32:54,428 | Unable to resolve property QUEUE: {'Fn::GetAtt': ['EmbeddingQueue', 'QueueName']}. Leaving as is.
2023-12-01 05:32:54,430 | Unable to resolve property queueName: {'Fn::GetAtt': ['EmbeddingQueue', 'QueueName']}. Leaving as is.
2023-12-01 05:32:54,432 | Unable to resolve property Resource: {'Fn::Sub':
['arn:${AWS::Partition}:sqs:${AWS::Region}:${AWS::AccountId}:${queueName}', {'queueName': {'Fn::GetAtt': ['EmbeddingQueue',
'QueueName']}}]}. Leaving as is.
2023-12-01 05:32:54,435 | Unable to resolve property queueName: {'Fn::GetAtt': ['EmbeddingQueue', 'QueueName']}. Leaving as is.
2023-12-01 05:32:54,437 | Unable to resolve property Resource: {'Fn::Sub':
['arn:${AWS::Partition}:sqs:${AWS::Region}:${AWS::AccountId}:${queueName}', {'queueName': {'Fn::GetAtt': ['EmbeddingQueue',
'QueueName']}}]}. Leaving as is.
2023-12-01 05:32:54,440 | Unable to resolve property AppId: {'Fn::GetAtt': ['AmplifyApp', 'AppId']}. Leaving as is.
2023-12-01 05:32:54,442 | 0 stacks found in the template
2023-12-01 05:32:54,443 | Collected default values for parameters: {'Frontend': 'local'}
2023-12-01 05:32:54,479 | There is no customer defined id or cdk path defined for resource DocumentBucket, so we will use the resource
logical id as the resource id
2023-12-01 05:32:54,481 | There is no customer defined id or cdk path defined for resource DocumentBucketPolicy, so we will use the
resource logical id as the resource id
2023-12-01 05:32:54,483 | There is no customer defined id or cdk path defined for resource EmbeddingQueue, so we will use the resource
logical id as the resource id
2023-12-01 05:32:54,484 | There is no customer defined id or cdk path defined for resource EmbeddingQueuePolicy, so we will use the
resource logical id as the resource id
2023-12-01 05:32:54,487 | There is no customer defined id or cdk path defined for resource DocumentTable, so we will use the resource
logical id as the resource id
2023-12-01 05:32:54,489 | There is no customer defined id or cdk path defined for resource MemoryTable, so we will use the resource
logical id as the resource id
2023-12-01 05:32:54,491 | There is no customer defined id or cdk path defined for resource CognitoUserPool, so we will use the
resource logical id as the resource id
2023-12-01 05:32:54,492 | There is no customer defined id or cdk path defined for resource CognitoUserPoolClient, so we will use the
resource logical id as the resource id
2023-12-01 05:32:54,495 | There is no customer defined id or cdk path defined for resource Api, so we will use the resource logical id
as the resource id
2023-12-01 05:32:54,496 | There is no customer defined id or cdk path defined for resource GeneratePresignedUrlFunction, so we will
use the resource logical id as the resource id
2023-12-01 05:32:54,499 | There is no customer defined id or cdk path defined for resource UploadTriggerFunction, so we will use the
resource logical id as the resource id
2023-12-01 05:32:54,501 | There is no customer defined id or cdk path defined for resource GetDocumentFunction, so we will use the
resource logical id as the resource id
2023-12-01 05:32:54,503 | There is no customer defined id or cdk path defined for resource GetAllDocuments, so we will use the
resource logical id as the resource id
2023-12-01 05:32:54,505 | There is no customer defined id or cdk path defined for resource AddConversationFunction, so we will use the
resource logical id as the resource id
2023-12-01 05:32:54,507 | There is no customer defined id or cdk path defined for resource GenerateEmbeddingsFunction, so we will use
the resource logical id as the resource id
2023-12-01 05:32:54,509 | There is no customer defined id or cdk path defined for resource GenerateResponseFunction, so we will use
the resource logical id as the resource id
2023-12-01 05:32:54,511 | There is no customer defined id or cdk path defined for resource AmplifyApp, so we will use the resource
logical id as the resource id
2023-12-01 05:32:54,513 | There is no customer defined id or cdk path defined for resource AmplifyBranch, so we will use the resource
logical id as the resource id
2023-12-01 05:32:54,518 | Unable to resolve property QUEUE: {'Fn::GetAtt': ['EmbeddingQueue', 'QueueName']}. Leaving as is.
2023-12-01 05:32:54,520 | Unable to resolve property queueName: {'Fn::GetAtt': ['EmbeddingQueue', 'QueueName']}. Leaving as is.
2023-12-01 05:32:54,521 | Unable to resolve property Resource: {'Fn::Sub':
['arn:${AWS::Partition}:sqs:${AWS::Region}:${AWS::AccountId}:${queueName}', {'queueName': {'Fn::GetAtt': ['EmbeddingQueue',
'QueueName']}}]}. Leaving as is.
2023-12-01 05:32:54,524 | Unable to resolve property queueName: {'Fn::GetAtt': ['EmbeddingQueue', 'QueueName']}. Leaving as is.
2023-12-01 05:32:54,525 | Unable to resolve property Resource: {'Fn::Sub':
['arn:${AWS::Partition}:sqs:${AWS::Region}:${AWS::AccountId}:${queueName}', {'queueName': {'Fn::GetAtt': ['EmbeddingQueue',
'QueueName']}}]}. Leaving as is.
2023-12-01 05:32:54,527 | Unable to resolve property AppId: {'Fn::GetAtt': ['AmplifyApp', 'AppId']}. Leaving as is.
2023-12-01 05:32:54,529 | 18 resources found in the stack
2023-12-01 05:32:54,531 | Found Serverless function with name='GeneratePresignedUrlFunction' and CodeUri='src/generate_presigned_url/'
2023-12-01 05:32:54,532 | --base-dir is not presented, adjusting uri src/generate_presigned_url/ relative to
/home/ec2-user/environment/serverless-pdf-chat/backend/template.yaml
2023-12-01 05:32:54,534 | Found Serverless function with name='UploadTriggerFunction' and CodeUri='src/upload_trigger/'
2023-12-01 05:32:54,535 | --base-dir is not presented, adjusting uri src/upload_trigger/ relative to
/home/ec2-user/environment/serverless-pdf-chat/backend/template.yaml
2023-12-01 05:32:54,536 | Found Serverless function with name='GetDocumentFunction' and CodeUri='src/get_document/'
2023-12-01 05:32:54,537 | --base-dir is not presented, adjusting uri src/get_document/ relative to
/home/ec2-user/environment/serverless-pdf-chat/backend/template.yaml
2023-12-01 05:32:54,539 | Found Serverless function with name='GetAllDocuments' and CodeUri='src/get_all_documents/'
2023-12-01 05:32:54,540 | --base-dir is not presented, adjusting uri src/get_all_documents/ relative to
/home/ec2-user/environment/serverless-pdf-chat/backend/template.yaml
2023-12-01 05:32:54,542 | Found Serverless function with name='AddConversationFunction' and CodeUri='src/add_conversation/'
2023-12-01 05:32:54,543 | --base-dir is not presented, adjusting uri src/add_conversation/ relative to
/home/ec2-user/environment/serverless-pdf-chat/backend/template.yaml
2023-12-01 05:32:54,544 | Found Serverless function with name='GenerateEmbeddingsFunction' and CodeUri='src/generate_embeddings/'
2023-12-01 05:32:54,545 | --base-dir is not presented, adjusting uri src/generate_embeddings/ relative to
/home/ec2-user/environment/serverless-pdf-chat/backend/template.yaml
2023-12-01 05:32:54,547 | Found Serverless function with name='GenerateResponseFunction' and CodeUri='src/generate_response/'
2023-12-01 05:32:54,548 | --base-dir is not presented, adjusting uri src/generate_response/ relative to
/home/ec2-user/environment/serverless-pdf-chat/backend/template.yaml
2023-12-01 05:32:54,584 | 18 resources found in the stack
2023-12-01 05:32:54,586 | Found Serverless function with name='GeneratePresignedUrlFunction' and CodeUri='src/generate_presigned_url/'
2023-12-01 05:32:54,587 | Found Serverless function with name='UploadTriggerFunction' and CodeUri='src/upload_trigger/'
2023-12-01 05:32:54,588 | Found Serverless function with name='GetDocumentFunction' and CodeUri='src/get_document/'
2023-12-01 05:32:54,589 | Found Serverless function with name='GetAllDocuments' and CodeUri='src/get_all_documents/'
2023-12-01 05:32:54,591 | Found Serverless function with name='AddConversationFunction' and CodeUri='src/add_conversation/'
2023-12-01 05:32:54,592 | Found Serverless function with name='GenerateEmbeddingsFunction' and CodeUri='src/generate_embeddings/'
2023-12-01 05:32:54,593 | Found Serverless function with name='GenerateResponseFunction' and CodeUri='src/generate_response/'
2023-12-01 05:32:54,596 | Instantiating build definitions
2023-12-01 05:32:54,614 | Same function build definition found, adding function (Previous: BuildDefinition(python3.11,
/home/ec2-user/environment/serverless-pdf-chat/backend/src/generate_presigned_url, Zip, , 526748f7-9905-4208-9f95-11eb76731f1e, {},
{}, x86_64, []), Current: BuildDefinition(python3.11,
/home/ec2-user/environment/serverless-pdf-chat/backend/src/generate_presigned_url, Zip, , 5742cdf5-6585-4a29-8986-5680d736e8ca, {},
{}, x86_64, []), Function: Function(function_id='GeneratePresignedUrlFunction', name='GeneratePresignedUrlFunction',
functionname='GeneratePresignedUrlFunction', runtime='python3.11', memory=None, timeout=None, handler='main.lambda_handler',
imageuri=None, packagetype='Zip', imageconfig=None,
codeuri='/home/ec2-user/environment/serverless-pdf-chat/backend/src/generate_presigned_url', environment={'Variables': {'LOG_LEVEL':
'INFO', 'BUCKET': 'DocumentBucket', 'REGION': 'us-east-1'}}, rolearn=None, layers=[<samcli.lib.providers.provider.LayerVersion object
at 0x7f76a900af50>], events={'Root': {'Type': 'Api', 'Properties': {'RestApiId': 'Api', 'Path': '/generate_presigned_url', 'Method':
'GET'}}}, metadata={'SamResourceId': 'GeneratePresignedUrlFunction'}, inlinecode=None, codesign_config_arn=None,
architectures=['x86_64'], 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=None))
2023-12-01 05:32:54,622 | Same function build definition found, adding function (Previous: BuildDefinition(python3.11,
/home/ec2-user/environment/serverless-pdf-chat/backend/src/upload_trigger, Zip, , b94366d2-1831-4f69-8b6f-65db0c98218d, {}, {},
x86_64, []), Current: BuildDefinition(python3.11, /home/ec2-user/environment/serverless-pdf-chat/backend/src/upload_trigger, Zip, ,
b2654db5-5d2d-4cc8-b127-8f32ab8b0314, {}, {}, x86_64, []), Function: Function(function_id='UploadTriggerFunction',
name='UploadTriggerFunction', functionname='UploadTriggerFunction', runtime='python3.11', memory=None, timeout=None,
handler='main.lambda_handler', imageuri=None, packagetype='Zip', imageconfig=None,
codeuri='/home/ec2-user/environment/serverless-pdf-chat/backend/src/upload_trigger', environment={'Variables': {'LOG_LEVEL': 'INFO',
'DOCUMENT_TABLE': 'DocumentTable', 'MEMORY_TABLE': 'MemoryTable', 'QUEUE': {'Fn::GetAtt': ['EmbeddingQueue', 'QueueName']}, 'BUCKET':
'local-us-east-1-123456789012'}}, rolearn=None, layers=[<samcli.lib.providers.provider.LayerVersion object at 0x7f76a8ff6f10>],
events={'S3Event': {'Type': 'S3', 'Properties': {'Bucket': 'DocumentBucket', 'Events': ['s3:ObjectCreated:*'], 'Filter': {'S3Key':
{'Rules': [{'Name': 'suffix', 'Value': '.pdf'}]}}}}}, metadata={'SamResourceId': 'UploadTriggerFunction'}, inlinecode=None,
codesign_config_arn=None, architectures=['x86_64'], 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=None))
2023-12-01 05:32:54,629 | Same function build definition found, adding function (Previous: BuildDefinition(python3.11,
/home/ec2-user/environment/serverless-pdf-chat/backend/src/get_document, Zip, , 885991f3-b99b-441c-9180-901421d602a3, {}, {}, x86_64,
[]), Current: BuildDefinition(python3.11, /home/ec2-user/environment/serverless-pdf-chat/backend/src/get_document, Zip, ,
5fc132c0-6ae2-41d3-ace6-51b979e3e7de, {}, {}, x86_64, []), Function: Function(function_id='GetDocumentFunction',
name='GetDocumentFunction', functionname='GetDocumentFunction', runtime='python3.11', memory=None, timeout=None,
handler='main.lambda_handler', imageuri=None, packagetype='Zip', imageconfig=None,
codeuri='/home/ec2-user/environment/serverless-pdf-chat/backend/src/get_document', environment={'Variables': {'LOG_LEVEL': 'INFO',
'DOCUMENT_TABLE': 'DocumentTable', 'MEMORY_TABLE': 'MemoryTable'}}, rolearn=None, layers=[<samcli.lib.providers.provider.LayerVersion
object at 0x7f76a8ff71d0>], events={'Root': {'Type': 'Api', 'Properties': {'RestApiId': 'Api', 'Path':
'/doc/{documentid}/{conversationid}', 'Method': 'GET'}}}, metadata={'SamResourceId': 'GetDocumentFunction'}, inlinecode=None,
codesign_config_arn=None, architectures=['x86_64'], 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=None))
2023-12-01 05:32:54,636 | Same function build definition found, adding function (Previous: BuildDefinition(python3.11,
/home/ec2-user/environment/serverless-pdf-chat/backend/src/get_all_documents, Zip, , d8a85378-4245-47fb-a10a-c3da84865519, {}, {},
x86_64, []), Current: BuildDefinition(python3.11, /home/ec2-user/environment/serverless-pdf-chat/backend/src/get_all_documents, Zip, ,
f3be56ab-f8a4-4ac7-8662-87e38bf3ed66, {}, {}, x86_64, []), Function: Function(function_id='GetAllDocuments', name='GetAllDocuments',
functionname='GetAllDocuments', runtime='python3.11', memory=None, timeout=None, handler='main.lambda_handler', imageuri=None,
packagetype='Zip', imageconfig=None, codeuri='/home/ec2-user/environment/serverless-pdf-chat/backend/src/get_all_documents',
environment={'Variables': {'LOG_LEVEL': 'INFO', 'DOCUMENT_TABLE': 'DocumentTable'}}, rolearn=None,
layers=[<samcli.lib.providers.provider.LayerVersion object at 0x7f76a9000e90>], events={'Root': {'Type': 'Api', 'Properties':
{'RestApiId': 'Api', 'Path': '/doc', 'Method': 'GET'}}}, metadata={'SamResourceId': 'GetAllDocuments'}, inlinecode=None,
codesign_config_arn=None, architectures=['x86_64'], 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=None))
2023-12-01 05:32:54,642 | Same function build definition found, adding function (Previous: BuildDefinition(python3.11,
/home/ec2-user/environment/serverless-pdf-chat/backend/src/add_conversation, Zip, , cc2a171f-776c-4bba-92d3-a5a3e22668b8, {}, {},
x86_64, []), Current: BuildDefinition(python3.11, /home/ec2-user/environment/serverless-pdf-chat/backend/src/add_conversation, Zip, ,
d9d7809c-d788-4197-88db-69319f55192b, {}, {}, x86_64, []), Function: Function(function_id='AddConversationFunction',
name='AddConversationFunction', functionname='AddConversationFunction', runtime='python3.11', memory=None, timeout=None,
handler='main.lambda_handler', imageuri=None, packagetype='Zip', imageconfig=None,
codeuri='/home/ec2-user/environment/serverless-pdf-chat/backend/src/add_conversation', environment={'Variables': {'LOG_LEVEL': 'INFO',
'DOCUMENT_TABLE': 'DocumentTable', 'MEMORY_TABLE': 'MemoryTable'}}, rolearn=None, layers=[<samcli.lib.providers.provider.LayerVersion
object at 0x7f76a8c5e910>], events={'Root': {'Type': 'Api', 'Properties': {'RestApiId': 'Api', 'Path': '/doc/{documentid}', 'Method':
'POST'}}}, metadata={'SamResourceId': 'AddConversationFunction'}, inlinecode=None, codesign_config_arn=None, architectures=['x86_64'],
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=None))
2023-12-01 05:32:54,648 | Same function build definition found, adding function (Previous: BuildDefinition(python3.11,
/home/ec2-user/environment/serverless-pdf-chat/backend/src/generate_embeddings, Zip, , 243f7dcc-598f-4a95-b076-cedd19dc9723, {}, {},
x86_64, []), Current: BuildDefinition(python3.11, /home/ec2-user/environment/serverless-pdf-chat/backend/src/generate_embeddings, Zip,
, c9c4f1bb-f22e-47c4-83ca-07cdfc2109c0, {}, {}, x86_64, []), Function: Function(function_id='GenerateEmbeddingsFunction',
name='GenerateEmbeddingsFunction', functionname='GenerateEmbeddingsFunction', runtime='python3.11', memory=2048, timeout=180,
handler='main.lambda_handler', imageuri=None, packagetype='Zip', imageconfig=None,
codeuri='/home/ec2-user/environment/serverless-pdf-chat/backend/src/generate_embeddings', environment={'Variables': {'LOG_LEVEL':
'INFO', 'DOCUMENT_TABLE': 'DocumentTable', 'BUCKET': 'DocumentBucket'}}, rolearn=None,
layers=[<samcli.lib.providers.provider.LayerVersion object at 0x7f76a8c2a7d0>], events={'EmbeddingQueueEvent': {'Type': 'SQS',
'Properties': {'Queue': 'arn:aws:lambda:us-east-1:123456789012:function:EmbeddingQueue', 'BatchSize': 1}}}, metadata={'SamResourceId':
'GenerateEmbeddingsFunction'}, inlinecode=None, codesign_config_arn=None, architectures=['x86_64'], 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=None))
2023-12-01 05:32:54,655 | Same function build definition found, adding function (Previous: BuildDefinition(python3.11,
/home/ec2-user/environment/serverless-pdf-chat/backend/src/generate_response, Zip, , 291b6ee4-e11a-4b5d-a661-6d470f41d6a5, {}, {},
x86_64, []), Current: BuildDefinition(python3.11, /home/ec2-user/environment/serverless-pdf-chat/backend/src/generate_response, Zip, ,
9cd1f32c-7a1e-40b2-b46d-bfc44083f572, {}, {}, x86_64, []), Function: Function(function_id='GenerateResponseFunction',
name='GenerateResponseFunction', functionname='GenerateResponseFunction', runtime='python3.11', memory=2048, timeout=30,
handler='main.lambda_handler', imageuri=None, packagetype='Zip', imageconfig=None,
codeuri='/home/ec2-user/environment/serverless-pdf-chat/backend/src/generate_response', environment={'Variables': {'LOG_LEVEL':
'INFO', 'MEMORY_TABLE': 'MemoryTable', 'BUCKET': 'DocumentBucket'}}, rolearn=None, layers=[<samcli.lib.providers.provider.LayerVersion
object at 0x7f76a8c2b010>], events={'Root': {'Type': 'Api', 'Properties': {'RestApiId': 'Api', 'Path':
'/{documentid}/{conversationid}', 'Method': 'POST'}}}, metadata={'SamResourceId': 'GenerateResponseFunction'}, inlinecode=None,
codesign_config_arn=None, architectures=['x86_64'], 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=None))
2023-12-01 05:32:54,669 | Building codeuri: /home/ec2-user/environment/serverless-pdf-chat/backend/src/generate_presigned_url runtime:
python3.11 metadata: {} architecture: x86_64 functions: GeneratePresignedUrlFunction
2023-12-01 05:32:54,671 | Building to following folder
/home/ec2-user/environment/serverless-pdf-chat/backend/.aws-sam/build/GeneratePresignedUrlFunction
Fetching public.ecr.aws/sam/build-python3.11:latest-x86_64 Docker container image..............................................................................................................................................................................................................
2023-12-01 05:33:08,126 | Mounting /home/ec2-user/environment/serverless-pdf-chat/backend/src/generate_presigned_url as
/tmp/samcli/source:ro,delegated, inside runtime container
2023-12-01 05:33:08,133 | Container was not created. Skipping deletion
2023-12-01 05:33:08,135 | Telemetry endpoint configured to be https://aws-serverless-tools-telemetry.us-west-2.amazonaws.com/metrics
Error: Container does not exist. Cannot get logs for this container
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 184, in wrapped
File "samcli/lib/telemetry/metric.py", line 149, in wrapped
File "samcli/lib/utils/version_checker.py", line 42, in wrapped
File "samcli/cli/main.py", line 95, in wrapper
File "samcli/commands/build/command.py", line 171, in cli
File "samcli/commands/build/command.py", line 260, in do_cli
File "samcli/commands/build/build_context.py", line 281, in run
File "samcli/lib/build/app_builder.py", line 219, in build
File "samcli/lib/build/build_strategy.py", line 81, in build
File "samcli/lib/build/build_strategy.py", line 91, in _build_functions
File "samcli/lib/build/build_strategy.py", line 164, in build_single_function_definition
File "samcli/lib/build/app_builder.py", line 699, in _build_function
File "samcli/lib/build/app_builder.py", line 952, in _build_function_on_container
File "samcli/local/docker/container.py", line 383, in wait_for_logs
An 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-%20RuntimeError
Or create a bug report:
https://github.com/aws/aws-sam-cli/issues/new?template=Bug_report.md&title=Bug%3A%20sam%20build%20-%20RuntimeError
2023-12-01 05:33:08,140 | Telemetry endpoint configured to be https://aws-serverless-tools-telemetry.us-west-2.amazonaws.com/metrics
2023-12-01 05:33:08,144 | Unable to find Click Context for getting session_id.
Admin:~/environment/serverless-pdf-chat/backend (main) $ |
Thanks for getting back to me, can you try removing the build images that are currently present in the instance? You can find which images are in the instance with |
I've been having similar issues. All my
I'm trying to build this template: examples/demo-runtime-layer-function/template.yml Here's my log file from before deleting my
In docker desktop, if I choose container -> last ran -> log file, I think it completed successfully?
|
I tried again with a clean Cloud9 setup and changing arm64 to x86_64 and I can successfully build now. Thanks for the support. |
This might sound weird, but what if you run it twice? I was about to say it fixed mine too, but # [1] Deleted images. rebooted.
# [2] build runs, and returns self to the console
# works!
> sam build --use-container --cached --debug
# [3] build runs, and returns self to the console
# lockup
> sam build --use-container --cached --debug
# stalled at the same line
# Fetching public.ecr.aws/sam/build-provided.al2023:latest-x86_64 Docker container image......
2023-12-06 05:43:38,068 | Mounting H:\temp_clone\aws-lambda-pwsh\aws-lambda-powershell-runtime\examples\demo-runtime-layer-function\function as /tmp/samcli/source:ro,delegated, inside runtime
container the logs in docker-desktop says |
I forgot I've had a similar error before #4595 (comment) Merged issues summary
That would make sense why running Potential fix?Is there a timeout setting that I can turn up, because that should be an easy way for me to confirm if that works or not? The current build sometimes, but not always will end with this message:
|
Thanks for getting back, glad this worked out in the end. @ninmonkey, while the container not responding correctly might be the same between the OP and the issue you're facing, this might have a different root cause. I see that the layer that is in that template is using If you are still unable to build successfully (ie. it doesn't hang), can you create a new issue with the steps to reproduce, partial/full debug logs, and the output of |
Closing this issue as the OP's issue has been fixed. @ninmonkey, as @lucashuy mentioned above, feel free to create a new issue with more details if you are still facing problems or have questions. |
|
Description:
sam build --use-container times out for my project.
Steps to reproduce:
Start new Cloud9 instance with default configuration (Amazon Linux 2):
git clone https://github.com/aws-samples/serverless-pdf-chat.git cd serverless-pdf-chat/backend sam deploy --use-container
Observed result:
The command just keeps running and even after 30 minutes shows no reaction:
Expected result:
On my local machine (Macbook Air M1, macOS Ventura), I can successfully build and deploy.
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
The text was updated successfully, but these errors were encountered: