-
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 fails with ruby 3.2.x #5530
Comments
@hirowatari I tried both |
$ bundler --version
Bundler version 2.4.10
$ ruby --version
ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x86_64-linux]
$ gem -v
3.4.10 |
Sorry for the bump, but could you perhaps give me any advice on how to further debug this? I looked at this for a long time today but couldn't get any further on debugging the issue. |
could you please share the logs of Can you also try to upgrade gem to 3.4.17, and bundler to 2.4.17 to match the versions in the SAM Build image, as Last thing, could you do the following steps to give us more debugging logs:
Then, update this file
Then, change directory to your project, and run |
Thank you kindly for your attention to this
$ cd src/
$ bundle install --without development test
[DEPRECATED] The `--without` flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use `bundle config set --local without 'development test'`, and stop using this flag
Using bundler 2.4.10
Using uri 0.12.2
Bundle complete! 1 Gemfile dependency, 2 gems now installed.
Gems in the groups 'development' and 'test' were not installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
$ echo $?
0 and here's the verbose output: $ bundle install --verbose --without development test
Running `bundle install --verbose --without "development" "test"` with bundler 2.4.10
[DEPRECATED] The `--without` flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use `bundle config set --local without 'development test'`, and stop using this flag
Found no changes, using resolution from the lockfile
Using bundler 2.4.10
0: bundler (2.4.10) from /home/kenton/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/specifications/default/bundler-2.4.10.gemspec
Using uri 0.12.2
0: uri (0.12.2) from /home/kenton/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/specifications/uri-0.12.2.gemspec
Bundle complete! 1 Gemfile dependency, 2 gems now installed.
Gems in the groups 'development' and 'test' were not installed.
Use `bundle info [gemname]` to see where a bundled gem is installed. changing the gem & bundler versions didn't change the output $ bundler -v
Bundler version 2.4.17
$ gem -v
3.4.17
$ DEBUG=true sam build --debug
2023-07-26 20:16:27,648 | No config file found in this directory.
2023-07-26 20:16:27,650 | OSError occurred while reading TOML file: [Errno 2] No such file or directory: '/home/kenton/hack/aws-sam-lambda-ruby322-bundler-error/samconfig.toml'
2023-07-26 20:16:27,651 | Config file location: /home/kenton/hack/aws-sam-lambda-ruby322-bundler-error/samconfig.toml
2023-07-26 20:16:27,651 | Config file '/home/kenton/hack/aws-sam-lambda-ruby322-bundler-error/samconfig.toml' does not exist
2023-07-26 20:16:27,653 | Using SAM Template at /home/kenton/hack/aws-sam-lambda-ruby322-bundler-error/template.yml
2023-07-26 20:16:27,668 | Using config file: samconfig.toml, config environment: default
2023-07-26 20:16:27,669 | Expand command line arguments to:
2023-07-26 20:16:27,669 | --template_file=/home/kenton/hack/aws-sam-lambda-ruby322-bundler-error/template.yml --mount_with=READ --build_dir=.aws-sam/build --cache_dir=.aws-sam/cache
2023-07-26 20:16:27,705 | 'build' command is called
2023-07-26 20:16:27,707 | No Parameters detected in the template
2023-07-26 20:16:27,719 | There is no customer defined id or cdk path defined for resource Ruby32Lambda, so we will use the resource logical id as the resource id
2023-07-26 20:16:27,720 | 0 stacks found in the template
2023-07-26 20:16:27,720 | No Parameters detected in the template
2023-07-26 20:16:27,729 | There is no customer defined id or cdk path defined for resource Ruby32Lambda, so we will use the resource logical id as the resource id
2023-07-26 20:16:27,729 | 1 resources found in the stack
2023-07-26 20:16:27,730 | Found Serverless function with name='Ruby32Lambda' and CodeUri='src/'
2023-07-26 20:16:27,730 | --base-dir is not presented, adjusting uri src/ relative to /home/kenton/hack/aws-sam-lambda-ruby322-bundler-error/template.yml
2023-07-26 20:16:27,732 | 1 resources found in the stack
2023-07-26 20:16:27,732 | Found Serverless function with name='Ruby32Lambda' and CodeUri='src/'
2023-07-26 20:16:27,733 | Instantiating build definitions
2023-07-26 20:16:27,735 | Same function build definition found, adding function (Previous: BuildDefinition(ruby3.2, /home/kenton/hack/aws-sam-lambda-ruby322-bundler-error/src, Zip, , 4cbee539-5af8-44c3-af71-d83ef954d83f, {}, {}, x86_64, []), Current: BuildDefinition(ruby3.2, /home/kenton/hack/aws-sam-lambda-ruby322-bundler-error/src, Zip, , 8535938d-74a6-4a15-b9fa-6d6fc851b319, {}, {}, x86_64, []), Function:
Function(function_id='Ruby32Lambda', name='Ruby32Lambda', functionname='Ruby32Lambda', runtime='ruby3.2', memory=None, timeout=None, handler='function.handler', imageuri=None, packagetype='Zip', imageconfig=None, codeuri='/home/kenton/hack/aws-sam-lambda-ruby322-bundler-error/src', environment=None, rolearn=None, layers=[], events=None, metadata={'SamResourceId': 'Ruby32Lambda'}, inlinecode=None, codesign_config_arn=None,
architectures=None, 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))
2023-07-26 20:16:27,737 | Building codeuri: /home/kenton/hack/aws-sam-lambda-ruby322-bundler-error/src runtime: ruby3.2 metadata: {} architecture: x86_64 functions: Ruby32Lambda
2023-07-26 20:16:27,738 | Building to following folder /home/kenton/hack/aws-sam-lambda-ruby322-bundler-error/.aws-sam/build/Ruby32Lambda
2023-07-26 20:16:27,739 | Loading workflow module 'aws_lambda_builders.workflows'
2023-07-26 20:16:27,740 | Registering workflow 'CustomMakeBuilder' with capability 'Capability(language='provided', dependency_manager=None, application_framework=None)'
2023-07-26 20:16:27,741 | Registering workflow 'DotnetCliPackageBuilder' with capability 'Capability(language='dotnet', dependency_manager='cli-package', application_framework=None)'
2023-07-26 20:16:27,742 | Registering workflow 'GoModulesBuilder' with capability 'Capability(language='go', dependency_manager='modules', application_framework=None)'
2023-07-26 20:16:27,744 | Registering workflow 'JavaGradleWorkflow' with capability 'Capability(language='java', dependency_manager='gradle', application_framework=None)'
2023-07-26 20:16:27,745 | Registering workflow 'JavaMavenWorkflow' with capability 'Capability(language='java', dependency_manager='maven', application_framework=None)'
2023-07-26 20:16:27,746 | Registering workflow 'NodejsNpmBuilder' with capability 'Capability(language='nodejs', dependency_manager='npm', application_framework=None)'
2023-07-26 20:16:27,747 | Registering workflow 'NodejsNpmEsbuildBuilder' with capability 'Capability(language='nodejs', dependency_manager='npm-esbuild', application_framework=None)'
2023-07-26 20:16:27,749 | Registering workflow 'PythonPipBuilder' with capability 'Capability(language='python', dependency_manager='pip', application_framework=None)'
2023-07-26 20:16:27,750 | Registering workflow 'RubyBundlerBuilder' with capability 'Capability(language='ruby', dependency_manager='bundler', application_framework=None)'
2023-07-26 20:16:27,751 | Registering workflow 'RustCargoLambdaBuilder' with capability 'Capability(language='rust', dependency_manager='cargo', application_framework=None)'
2023-07-26 20:16:27,752 | Found workflow 'RubyBundlerBuilder' to support capabilities 'Capability(language='ruby', dependency_manager='bundler', application_framework=None)'
2023-07-26 20:16:27,753 | Running workflow 'RubyBundlerBuilder'
2023-07-26 20:16:27,753 | Running RubyBundlerBuilder:CopySource
2023-07-26 20:16:27,754 | Creating target folders at /home/kenton/hack/aws-sam-lambda-ruby322-bundler-error/.aws-sam/build/Ruby32Lambda
2023-07-26 20:16:27,754 | Copying directory metadata from source (/home/kenton/hack/aws-sam-lambda-ruby322-bundler-error/src) to destination (/home/kenton/hack/aws-sam-lambda-ruby322-bundler-error/.aws-sam/build/Ruby32Lambda)
2023-07-26 20:16:27,755 | Copying source file (/home/kenton/hack/aws-sam-lambda-ruby322-bundler-error/src/function.rb) to destination (/home/kenton/hack/aws-sam-lambda-ruby322-bundler-error/.aws-sam/build/Ruby32Lambda/function.rb)
2023-07-26 20:16:27,755 | Copying source file (/home/kenton/hack/aws-sam-lambda-ruby322-bundler-error/src/Gemfile) to destination (/home/kenton/hack/aws-sam-lambda-ruby322-bundler-error/.aws-sam/build/Ruby32Lambda/Gemfile)
2023-07-26 20:16:27,756 | RubyBundlerBuilder:CopySource succeeded
2023-07-26 20:16:27,757 | Running RubyBundlerBuilder:RubyBundle
2023-07-26 20:16:27,757 | Running bundle install in /home/kenton/hack/aws-sam-lambda-ruby322-bundler-error/.aws-sam/build/Ruby32Lambda
2023-07-26 20:16:27,757 | executing Bundler: ['bundle', 'install', '--without', 'development', 'test']
2023-07-26 20:16:27,948 | RubyBundlerBuilder:RubyBundle failed
Traceback (most recent call last):
File "aws_lambda_builders/workflows/ruby_bundler/actions.py", line 32, in execute
File "aws_lambda_builders/workflows/ruby_bundler/bundler.py", line 69, in run
aws_lambda_builders.workflows.ruby_bundler.bundler.BundlerExecutionError: Bundler Failed: Running `bundle install --without "development" "test"` with bundler 2.4.17
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "aws_lambda_builders/workflow.py", line 369, in run
File "aws_lambda_builders/workflows/ruby_bundler/actions.py", line 34, in execute
aws_lambda_builders.actions.ActionFailedError: Bundler Failed: Running `bundle install --without "development" "test"` with bundler 2.4.17
Build Failed
2023-07-26 20:16:27,951 | Telemetry endpoint configured to be https://aws-serverless-tools-telemetry.us-west-2.amazonaws.com/metrics
2023-07-26 20:16:27,958 | Telemetry endpoint configured to be https://aws-serverless-tools-telemetry.us-west-2.amazonaws.com/metrics
2023-07-26 20:16:27,958 | Sending Telemetry: {'metrics': [{'commandRun': {'requestId': 'b0934926-62e4-4fc0-9edb-88a8db88499c', 'installationId': '18afec76-7a49-4f25-9885-bf255430f395', 'sessionId': 'fe402d96-9ed1-4777-8069-c46398c58046', 'executionEnvironment': 'CLI', 'ci': False, 'pyversion': '3.11.3', 'samcliVersion': '1.92.0', 'awsProfileProvided': False, 'debugFlagProvided': True, 'region': '', 'commandName': 'sam
build', 'metricSpecificAttributes': {'projectType': 'CFN', 'gitOrigin': None, 'projectName': '543d9497f10f7225629cacc4345571ccd668ebe34b812df09e57cbffc6b9233c', 'initialCommit': None}, 'duration': 282, 'exitReason': 'WorkflowFailedError', 'exitCode': 1}}]}
2023-07-26 20:16:27,958 | Unable to find Click Context for getting session_id.
2023-07-26 20:16:27,961 | Sending Telemetry: {'metrics': [{'events': {'requestId': 'b528ebc2-d0d5-4c27-9c56-496117ad395a', 'installationId': '18afec76-7a49-4f25-9885-bf255430f395', 'sessionId': 'fe402d96-9ed1-4777-8069-c46398c58046', 'executionEnvironment': 'CLI', 'ci': False, 'pyversion': '3.11.3', 'samcliVersion': '1.92.0', 'metricSpecificAttributes': {'events': [{'event_name': 'SamConfigFileExtension', 'event_value':
'.toml', 'thread_id': '2ef10728be2f428bbc7870ec35a9d712', 'time_stamp': '2023-07-27 03:16:27.651', 'exception_name': None}, {'event_name': 'BuildFunctionRuntime', 'event_value': 'ruby3.2', 'thread_id': '763b5a1798df4dc49707f98c6f2aeaae', 'time_stamp': '2023-07-27 03:16:27.733', 'exception_name': None}, {'event_name': 'BuildWorkflowUsed', 'event_value': 'ruby-bundler', 'thread_id': 'db99e0413ff34036a61197f8e313be4e',
'time_stamp': '2023-07-27 03:16:27.739', 'exception_name': None}]}}}]}
2023-07-26 20:16:28,030 | Telemetry response: 200
Error: RubyBundlerBuilder:RubyBundle - Bundler Failed: Running `bundle install --without "development" "test"` with bundler 2.4.17
2023-07-26 20:16:28,032 | Telemetry response: 200
print(f"bundler output stream: {out.decode("utf8")}")
print(f"bundler error stream: {err.decode("utf8")}") with out, err = p.communicate()
print(f"bundler output stream: {out.decode('utf8')}")
print(f"bundler error stream: {err.decode('utf8')}") ]$ sam build --debug
2023-07-26 20:29:31,934 | No config file found in this directory.
2023-07-26 20:29:31,936 | OSError occurred while reading TOML file: [Errno 2] No such file or directory: '/home/kenton/hack/aws-sam-lambda-ruby322-bundler-error/samconfig.toml'
2023-07-26 20:29:31,937 | Config file location: /home/kenton/hack/aws-sam-lambda-ruby322-bundler-error/samconfig.toml
2023-07-26 20:29:31,938 | Config file '/home/kenton/hack/aws-sam-lambda-ruby322-bundler-error/samconfig.toml' does not exist
2023-07-26 20:29:31,939 | Using SAM Template at /home/kenton/hack/aws-sam-lambda-ruby322-bundler-error/template.yml
2023-07-26 20:29:31,950 | Using config file: samconfig.toml, config environment: default
2023-07-26 20:29:31,951 | Expand command line arguments to:
2023-07-26 20:29:31,951 | --template_file=/home/kenton/hack/aws-sam-lambda-ruby322-bundler-error/template.yml --mount_with=READ --build_dir=.aws-sam/build --cache_dir=.aws-sam/cache
2023-07-26 20:29:31,983 | 'build' command is called
2023-07-26 20:29:31,984 | No Parameters detected in the template
2023-07-26 20:29:31,994 | There is no customer defined id or cdk path defined for resource Ruby32Lambda, so we will use the resource logical id as the resource id
2023-07-26 20:29:31,995 | 0 stacks found in the template
2023-07-26 20:29:31,995 | No Parameters detected in the template
2023-07-26 20:29:32,002 | There is no customer defined id or cdk path defined for resource Ruby32Lambda, so we will use the resource logical id as the resource id
2023-07-26 20:29:32,003 | 1 resources found in the stack
2023-07-26 20:29:32,003 | Found Serverless function with name='Ruby32Lambda' and CodeUri='src/'
2023-07-26 20:29:32,004 | --base-dir is not presented, adjusting uri src/ relative to /home/kenton/hack/aws-sam-lambda-ruby322-bundler-error/template.yml
2023-07-26 20:29:32,005 | 1 resources found in the stack
2023-07-26 20:29:32,006 | Found Serverless function with name='Ruby32Lambda' and CodeUri='src/'
2023-07-26 20:29:32,006 | Instantiating build definitions
2023-07-26 20:29:32,008 | Same function build definition found, adding function (Previous: BuildDefinition(ruby3.2, /home/kenton/hack/aws-sam-lambda-ruby322-bundler-error/src, Zip, , 4cbee539-5af8-44c3-af71-d83ef954d83f, {}, {}, x86_64, []), Current: BuildDefinition(ruby3.2, /home/kenton/hack/aws-sam-lambda-ruby322-bundler-error/src, Zip, , 61c12f16-f096-46a6-ba30-4f285365c3a7, {}, {}, x86_64, []), Function:
Function(function_id='Ruby32Lambda', name='Ruby32Lambda', functionname='Ruby32Lambda', runtime='ruby3.2', memory=None, timeout=None, handler='function.handler', imageuri=None, packagetype='Zip', imageconfig=None, codeuri='/home/kenton/hack/aws-sam-lambda-ruby322-bundler-error/src', environment=None, rolearn=None, layers=[], events=None, metadata={'SamResourceId': 'Ruby32Lambda'}, inlinecode=None, codesign_config_arn=None,
architectures=None, 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))
2023-07-26 20:29:32,010 | Building codeuri: /home/kenton/hack/aws-sam-lambda-ruby322-bundler-error/src runtime: ruby3.2 metadata: {} architecture: x86_64 functions: Ruby32Lambda
2023-07-26 20:29:32,011 | Building to following folder /home/kenton/hack/aws-sam-lambda-ruby322-bundler-error/.aws-sam/build/Ruby32Lambda
2023-07-26 20:29:32,011 | Loading workflow module 'aws_lambda_builders.workflows'
2023-07-26 20:29:32,012 | Registering workflow 'CustomMakeBuilder' with capability 'Capability(language='provided', dependency_manager=None, application_framework=None)'
2023-07-26 20:29:32,014 | Registering workflow 'DotnetCliPackageBuilder' with capability 'Capability(language='dotnet', dependency_manager='cli-package', application_framework=None)'
2023-07-26 20:29:32,015 | Registering workflow 'GoModulesBuilder' with capability 'Capability(language='go', dependency_manager='modules', application_framework=None)'
2023-07-26 20:29:32,016 | Registering workflow 'JavaGradleWorkflow' with capability 'Capability(language='java', dependency_manager='gradle', application_framework=None)'
2023-07-26 20:29:32,017 | Registering workflow 'JavaMavenWorkflow' with capability 'Capability(language='java', dependency_manager='maven', application_framework=None)'
2023-07-26 20:29:32,018 | Registering workflow 'NodejsNpmBuilder' with capability 'Capability(language='nodejs', dependency_manager='npm', application_framework=None)'
2023-07-26 20:29:32,019 | Registering workflow 'NodejsNpmEsbuildBuilder' with capability 'Capability(language='nodejs', dependency_manager='npm-esbuild', application_framework=None)'
2023-07-26 20:29:32,021 | Registering workflow 'PythonPipBuilder' with capability 'Capability(language='python', dependency_manager='pip', application_framework=None)'
2023-07-26 20:29:32,022 | Registering workflow 'RubyBundlerBuilder' with capability 'Capability(language='ruby', dependency_manager='bundler', application_framework=None)'
2023-07-26 20:29:32,023 | Registering workflow 'RustCargoLambdaBuilder' with capability 'Capability(language='rust', dependency_manager='cargo', application_framework=None)'
2023-07-26 20:29:32,023 | Found workflow 'RubyBundlerBuilder' to support capabilities 'Capability(language='ruby', dependency_manager='bundler', application_framework=None)'
2023-07-26 20:29:32,024 | Running workflow 'RubyBundlerBuilder'
2023-07-26 20:29:32,025 | Running RubyBundlerBuilder:CopySource
2023-07-26 20:29:32,025 | Creating target folders at /home/kenton/hack/aws-sam-lambda-ruby322-bundler-error/.aws-sam/build/Ruby32Lambda
2023-07-26 20:29:32,025 | Copying directory metadata from source (/home/kenton/hack/aws-sam-lambda-ruby322-bundler-error/src) to destination (/home/kenton/hack/aws-sam-lambda-ruby322-bundler-error/.aws-sam/build/Ruby32Lambda)
2023-07-26 20:29:32,026 | Copying source file (/home/kenton/hack/aws-sam-lambda-ruby322-bundler-error/src/function.rb) to destination (/home/kenton/hack/aws-sam-lambda-ruby322-bundler-error/.aws-sam/build/Ruby32Lambda/function.rb)
2023-07-26 20:29:32,026 | Copying source file (/home/kenton/hack/aws-sam-lambda-ruby322-bundler-error/src/Gemfile) to destination (/home/kenton/hack/aws-sam-lambda-ruby322-bundler-error/.aws-sam/build/Ruby32Lambda/Gemfile)
2023-07-26 20:29:32,027 | RubyBundlerBuilder:CopySource succeeded
2023-07-26 20:29:32,027 | Running RubyBundlerBuilder:RubyBundle
2023-07-26 20:29:32,028 | Running bundle install in /home/kenton/hack/aws-sam-lambda-ruby322-bundler-error/.aws-sam/build/Ruby32Lambda
2023-07-26 20:29:32,028 | executing Bundler: ['bundle', 'install', '--without', 'development', 'test']
bundler output stream: Fetching gem metadata from http://rubygems.org/.
Resolving dependencies...
Bundle complete! 1 Gemfile dependency, 2 gems now installed.
Gems in the groups 'development' and 'test' were not installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
bundler error stream: [DEPRECATED] The `--without` flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use `bundle config set --local without 'development test'`, and stop using this flag
2023-07-26 20:29:32,632 | RubyBundlerBuilder:RubyBundle succeeded
2023-07-26 20:29:32,633 | Running RubyBundlerBuilder:RubyBundleDeployment
2023-07-26 20:29:32,633 | Running bundle install --deployment in /home/kenton/hack/aws-sam-lambda-ruby322-bundler-error/.aws-sam/build/Ruby32Lambda
2023-07-26 20:29:32,634 | executing Bundler: ['bundle', 'install', '--deployment', '--without', 'development', 'test']
bundler output stream: Fetching gem metadata from http://rubygems.org/.
Fetching uri 0.12.2
Installing uri 0.12.2
Bundle complete! 1 Gemfile dependency, 2 gems now installed.
Gems in the groups 'development' and 'test' were not installed.
Bundled gems are installed into `./vendor/bundle`
bundler error stream: [DEPRECATED] The `--deployment` flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use `bundle config set --local deployment 'true'`, and stop using this flag
[DEPRECATED] The `--without` flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use `bundle config set --local without 'development test'`, and stop using this flag
2023-07-26 20:29:33,298 | RubyBundlerBuilder:RubyBundleDeployment succeeded
2023-07-26 20:29:33,299 | There is no customer defined id or cdk path defined for resource Ruby32Lambda, so we will use the resource logical id as the resource id
2023-07-26 20:29:33,299 | 1 resources found in the stack
2023-07-26 20:29:33,300 | Found Serverless function with name='Ruby32Lambda' 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
2023-07-26 20:29:33,302 | Telemetry endpoint configured to be https://aws-serverless-tools-telemetry.us-west-2.amazonaws.com/metrics
2023-07-26 20:29:33,309 | Telemetry endpoint configured to be https://aws-serverless-tools-telemetry.us-west-2.amazonaws.com/metrics
2023-07-26 20:29:33,309 | Sending Telemetry: {'metrics': [{'commandRun': {'requestId': '5a726674-fb44-410c-99b1-49d9fa3ec8f8', 'installationId': '18afec76-7a49-4f25-9885-bf255430f395', 'sessionId': '532661f3-929d-45d1-9be4-b9ac5f9b0adc', 'executionEnvironment': 'CLI', 'ci': False, 'pyversion': '3.11.3', 'samcliVersion': '1.93.0', 'awsProfileProvided': False, 'debugFlagProvided': True, 'region': '', 'commandName': 'sam
build', 'metricSpecificAttributes': {'projectType': 'CFN', 'gitOrigin': None, 'projectName': '543d9497f10f7225629cacc4345571ccd668ebe34b812df09e57cbffc6b9233c', 'initialCommit': None}, 'duration': 1351, 'exitReason': 'success', 'exitCode': 0}}]}
2023-07-26 20:29:33,309 | Unable to find Click Context for getting session_id.
2023-07-26 20:29:33,311 | Sending Telemetry: {'metrics': [{'events': {'requestId': '1decff08-1111-4fd9-aa02-31155b0cc8e6', 'installationId': '18afec76-7a49-4f25-9885-bf255430f395', 'sessionId': '532661f3-929d-45d1-9be4-b9ac5f9b0adc', 'executionEnvironment': 'CLI', 'ci': False, 'pyversion': '3.11.3', 'samcliVersion': '1.93.0', 'metricSpecificAttributes': {'events': [{'event_name': 'SamConfigFileExtension', 'event_value':
'.toml', 'thread_id': '67bb9bd5110645ff9e5b8531bcd92294', 'time_stamp': '2023-07-27 03:29:31.937', 'exception_name': None}, {'event_name': 'BuildFunctionRuntime', 'event_value': 'ruby3.2', 'thread_id': 'a46074b176c744599597a44fd716b7dc', 'time_stamp': '2023-07-27 03:29:32.006', 'exception_name': None}, {'event_name': 'BuildWorkflowUsed', 'event_value': 'ruby-bundler', 'thread_id': '34a944ad903a400dadd9d30c401f0113',
'time_stamp': '2023-07-27 03:29:32.011', 'exception_name': None}]}}}]}
2023-07-26 20:29:33,389 | Telemetry response: 200
2023-07-26 20:29:33,414 | Telemetry response: 200 Woah, it worked 🥳. Is there any other info I can provide? |
actually I was looking for errors when you use SAM CLI that got installed using pip, to know if you have any environment setup issue, but it looks like no. We need to handle the |
could you please also upgrade to the latest SAM CLI to match the same version you used when you installed SAM CLI using pip. |
Thanks for your continued attention to this. $ bundler -v
Bundler version 2.3.26
$ gem -v # installed because it gives the default version of bundler that you requested
3.3.26
$ sam --version
SAM CLI, version 1.93.0
$ sam build --debug
2023-07-29 07:16:24,680 | No config file found in this directory.
2023-07-29 07:16:24,683 | OSError occurred while reading TOML file: [Errno 2] No such file or directory: '/home/kenton/hack/aws-sam-lambda-ruby322-bundler-error/samconfig.toml'
2023-07-29 07:16:24,683 | Config file location: /home/kenton/hack/aws-sam-lambda-ruby322-bundler-error/samconfig.toml
2023-07-29 07:16:24,684 | Config file '/home/kenton/hack/aws-sam-lambda-ruby322-bundler-error/samconfig.toml' does not exist
2023-07-29 07:16:24,685 | Using SAM Template at /home/kenton/hack/aws-sam-lambda-ruby322-bundler-error/template.yml
2023-07-29 07:16:24,701 | Using config file: samconfig.toml, config environment: default
2023-07-29 07:16:24,702 | Expand command line arguments to:
2023-07-29 07:16:24,702 | --template_file=/home/kenton/hack/aws-sam-lambda-ruby322-bundler-error/template.yml --mount_with=READ --build_dir=.aws-sam/build --cache_dir=.aws-sam/cache
2023-07-29 07:16:24,740 | 'build' command is called
2023-07-29 07:16:24,742 | No Parameters detected in the template
2023-07-29 07:16:24,754 | There is no customer defined id or cdk path defined for resource Ruby32Lambda, so we will use the resource logical id as the resource id
2023-07-29 07:16:24,755 | 0 stacks found in the template
2023-07-29 07:16:24,755 | No Parameters detected in the template
2023-07-29 07:16:24,764 | There is no customer defined id or cdk path defined for resource Ruby32Lambda, so we will use the resource logical id as the resource id
2023-07-29 07:16:24,765 | 1 resources found in the stack
2023-07-29 07:16:24,765 | Found Serverless function with name='Ruby32Lambda' and CodeUri='src/'
2023-07-29 07:16:24,766 | --base-dir is not presented, adjusting uri src/ relative to /home/kenton/hack/aws-sam-lambda-ruby322-bundler-error/template.yml
2023-07-29 07:16:24,767 | 1 resources found in the stack
2023-07-29 07:16:24,768 | Found Serverless function with name='Ruby32Lambda' and CodeUri='src/'
2023-07-29 07:16:24,768 | Instantiating build definitions
2023-07-29 07:16:24,770 | Same function build definition found, adding function (Previous: BuildDefinition(ruby3.2, /home/kenton/hack/aws-sam-lambda-ruby322-bundler-error/src, Zip, , 4cbee539-5af8-44c3-af71-d83ef954d83f, {}, {}, x86_64, []), Current: BuildDefinition(ruby3.2, /home/kenton/hack/aws-sam-lambda-ruby322-bundler-error/src, Zip, , e6546b31-fda7-4a72-9614-146123c84a39, {}, {}, x86_64, []), Function:
Function(function_id='Ruby32Lambda', name='Ruby32Lambda', functionname='Ruby32Lambda', runtime='ruby3.2', memory=None, timeout=None, handler='function.handler', imageuri=None, packagetype='Zip', imageconfig=None, codeuri='/home/kenton/hack/aws-sam-lambda-ruby322-bundler-error/src', environment=None, rolearn=None, layers=[], events=None, metadata={'SamResourceId': 'Ruby32Lambda'}, inlinecode=None, codesign_config_arn=None,
architectures=None, 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))
2023-07-29 07:16:24,773 | Building codeuri: /home/kenton/hack/aws-sam-lambda-ruby322-bundler-error/src runtime: ruby3.2 metadata: {} architecture: x86_64 functions: Ruby32Lambda
2023-07-29 07:16:24,774 | Building to following folder /home/kenton/hack/aws-sam-lambda-ruby322-bundler-error/.aws-sam/build/Ruby32Lambda
2023-07-29 07:16:24,774 | Loading workflow module 'aws_lambda_builders.workflows'
2023-07-29 07:16:24,775 | Registering workflow 'CustomMakeBuilder' with capability 'Capability(language='provided', dependency_manager=None, application_framework=None)'
2023-07-29 07:16:24,777 | Registering workflow 'DotnetCliPackageBuilder' with capability 'Capability(language='dotnet', dependency_manager='cli-package', application_framework=None)'
2023-07-29 07:16:24,778 | Registering workflow 'GoModulesBuilder' with capability 'Capability(language='go', dependency_manager='modules', application_framework=None)'
2023-07-29 07:16:24,779 | Registering workflow 'JavaGradleWorkflow' with capability 'Capability(language='java', dependency_manager='gradle', application_framework=None)'
2023-07-29 07:16:24,781 | Registering workflow 'JavaMavenWorkflow' with capability 'Capability(language='java', dependency_manager='maven', application_framework=None)'
2023-07-29 07:16:24,782 | Registering workflow 'NodejsNpmBuilder' with capability 'Capability(language='nodejs', dependency_manager='npm', application_framework=None)'
2023-07-29 07:16:24,783 | Registering workflow 'NodejsNpmEsbuildBuilder' with capability 'Capability(language='nodejs', dependency_manager='npm-esbuild', application_framework=None)'
2023-07-29 07:16:24,785 | Registering workflow 'PythonPipBuilder' with capability 'Capability(language='python', dependency_manager='pip', application_framework=None)'
2023-07-29 07:16:24,804 | Registering workflow 'RubyBundlerBuilder' with capability 'Capability(language='ruby', dependency_manager='bundler', application_framework=None)'
2023-07-29 07:16:24,805 | Registering workflow 'RustCargoLambdaBuilder' with capability 'Capability(language='rust', dependency_manager='cargo', application_framework=None)'
2023-07-29 07:16:24,806 | Found workflow 'RubyBundlerBuilder' to support capabilities 'Capability(language='ruby', dependency_manager='bundler', application_framework=None)'
2023-07-29 07:16:24,806 | Running workflow 'RubyBundlerBuilder'
2023-07-29 07:16:24,807 | Running RubyBundlerBuilder:CopySource
2023-07-29 07:16:24,807 | Creating target folders at /home/kenton/hack/aws-sam-lambda-ruby322-bundler-error/.aws-sam/build/Ruby32Lambda
2023-07-29 07:16:24,808 | Copying directory metadata from source (/home/kenton/hack/aws-sam-lambda-ruby322-bundler-error/src) to destination (/home/kenton/hack/aws-sam-lambda-ruby322-bundler-error/.aws-sam/build/Ruby32Lambda)
2023-07-29 07:16:24,809 | Copying source file (/home/kenton/hack/aws-sam-lambda-ruby322-bundler-error/src/function.rb) to destination (/home/kenton/hack/aws-sam-lambda-ruby322-bundler-error/.aws-sam/build/Ruby32Lambda/function.rb)
2023-07-29 07:16:24,809 | Copying source file (/home/kenton/hack/aws-sam-lambda-ruby322-bundler-error/src/Gemfile) to destination (/home/kenton/hack/aws-sam-lambda-ruby322-bundler-error/.aws-sam/build/Ruby32Lambda/Gemfile)
2023-07-29 07:16:24,810 | RubyBundlerBuilder:CopySource succeeded
2023-07-29 07:16:24,810 | Running RubyBundlerBuilder:RubyBundle
2023-07-29 07:16:24,811 | Running bundle install in /home/kenton/hack/aws-sam-lambda-ruby322-bundler-error/.aws-sam/build/Ruby32Lambda
2023-07-29 07:16:24,811 | executing Bundler: ['bundle', 'install', '--without', 'development', 'test']
2023-07-29 07:16:24,962 | RubyBundlerBuilder:RubyBundle failed
Traceback (most recent call last):
File "aws_lambda_builders/workflows/ruby_bundler/actions.py", line 32, in execute
File "aws_lambda_builders/workflows/ruby_bundler/bundler.py", line 69, in run
aws_lambda_builders.workflows.ruby_bundler.bundler.BundlerExecutionError: Bundler Failed:
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "aws_lambda_builders/workflow.py", line 369, in run
File "aws_lambda_builders/workflows/ruby_bundler/actions.py", line 34, in execute
aws_lambda_builders.actions.ActionFailedError: Bundler Failed:
Build Failed
2023-07-29 07:16:24,964 | Telemetry endpoint configured to be https://aws-serverless-tools-telemetry.us-west-2.amazonaws.com/metrics
2023-07-29 07:16:24,972 | Telemetry endpoint configured to be https://aws-serverless-tools-telemetry.us-west-2.amazonaws.com/metrics
2023-07-29 07:16:24,972 | Sending Telemetry: {'metrics': [{'commandRun': {'requestId': '423cb6df-c54e-47b9-b1e0-cd453ea08d34', 'installationId': '18afec76-7a49-4f25-9885-bf255430f395', 'sessionId': '23a37420-05d9-4354-b232-98b7aa487ef8', 'executionEnvironment': 'CLI', 'ci': False, 'pyversion': '3.11.3', 'samcliVersion': '1.93.0', 'awsProfileProvided': False, 'debugFlagProvided': True, 'region': '', 'commandName': 'sam
build', 'metricSpecificAttributes': {'projectType': 'CFN', 'gitOrigin': None, 'projectName': '543d9497f10f7225629cacc4345571ccd668ebe34b812df09e57cbffc6b9233c', 'initialCommit': None}, 'duration': 262, 'exitReason': 'WorkflowFailedError', 'exitCode': 1}}]}
2023-07-29 07:16:24,972 | Unable to find Click Context for getting session_id.
2023-07-29 07:16:24,976 | Sending Telemetry: {'metrics': [{'events': {'requestId': 'a77fb586-a124-4329-82c0-e4c8efcd0c14', 'installationId': '18afec76-7a49-4f25-9885-bf255430f395', 'sessionId': '23a37420-05d9-4354-b232-98b7aa487ef8', 'executionEnvironment': 'CLI', 'ci': False, 'pyversion': '3.11.3', 'samcliVersion': '1.93.0', 'metricSpecificAttributes': {'events': [{'event_name': 'SamConfigFileExtension', 'event_value':
'.toml', 'thread_id': '855ee736708a4659b5799ec545fabf76', 'time_stamp': '2023-07-29 14:16:24.683', 'exception_name': None}, {'event_name': 'BuildFunctionRuntime', 'event_value': 'ruby3.2', 'thread_id': 'a2dd7dd69eab4ea79ffc29312b4660e1', 'time_stamp': '2023-07-29 14:16:24.768', 'exception_name': None}, {'event_name': 'BuildWorkflowUsed', 'event_value': 'ruby-bundler', 'thread_id': '7a9d0e10859947fd91d8967a15992610',
'time_stamp': '2023-07-29 14:16:24.774', 'exception_name': None}]}}}]}
2023-07-29 07:16:25,097 | Telemetry response: 200
Error: RubyBundlerBuilder:RubyBundle - Bundler Failed:
2023-07-29 07:16:25,100 | Telemetry response: 200 |
thanks @hirowatari for the reply, could you please let us know how did you install SAM CLI in your environment? |
I used https://aur.archlinux.org/packages/aws-sam-cli-bin I'm using the Thank you kindly for the help. |
|
Description:
Running
sam build
failsSteps to reproduce:
Run
sam build
Sample repo: https:/hirowatari/aws-sam-lambda-ruby322-bundler-error
Observed result:
Expected result:
build to succeed
Additional environment details
sam --version
: SAM CLI, version 1.90.0Notes
The text was updated successfully, but these errors were encountered: