aws-sam-cli
aws-sam-cli copied to clipboard
SSL handshake error when using sam build -u
Description
When running sam build -u on the aws lambda HelloWorld app keep getting a SSL handshake error when the build tries to download the maven-clean-plugin.
I can do a sam build and it will build the app and the sam local start-api works. I can run the mvn clean separately with no problem.
I thought it was a proxy issue but I have added my proxy settings to my Docker config and added them to the sam template. I thought this was similar to #918 but that seemed to be a proxy setting.
Steps to reproduce
download aws lambda Helloworld app
Observed result
C:\RIM_API>sam build -u 2019-08-02 10:16:58 Starting Build inside a container 2019-08-02 10:16:58 Building resource 'HelloWorldFunction'
Fetching lambci/lambda:build-java8 Docker container image...... 2019-08-02 10:16:58 Mounting C:\RIM_API\HelloWorldFunction as /tmp/samcli/source:ro,delegated inside runtime container
Build Failed Error: JavaMavenWorkflow:MavenBuild - Maven Failed: [INFO] Scanning for projects... [INFO] [INFO] -----------------------< helloworld:HelloWorld >------------------------ [INFO] Building A sample Hello World created for SAM CLI. 1.0 [INFO] --------------------------------[ jar ]--------------------------------- Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 0.710 s [INFO] Finished at: 2019-08-02T14:17:02Z [INFO] ------------------------------------------------------------------------ [ERROR] Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.5: Could not transfer artifact org.apache.maven.plugins:maven-clean-plugin:pom:2.5 from/to central (https://repo.maven.apache.org/maven2): Remote host closed connection during handshake: SSL peer shut down incorrectly -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException Running JavaMavenWorkflow:CopySource Running JavaMavenWorkflow:MavenBuild
Please provide command output with --debug
flag set.
Expected result
[INFO] [INFO] -----------------------< helloworld:HelloWorld >------------------------ [INFO] Building A sample Hello World created for SAM CLI. 1.0 [INFO] --------------------------------[ jar ]--------------------------------- [INFO] [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ HelloWorld --- [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ HelloWorld --- [WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent! [INFO] skip non existing resourceDirectory C:\Users\eb96409\AppData\Local\Temp\tmpy9e04t_b\src\main\resources [INFO] [INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ HelloWorld --- [INFO] Changes detected - recompiling the module! [WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent! [INFO] Compiling 2 source files to C:\Users\eb96409\AppData\Local\Temp\tmpy9e04t_b\target\classes [INFO]
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
- OS: Window10
-
sam --version
: C:\RIM_API>sam --version SAM CLI, version 0.16.1 IDE: IntelliJ 2019.2 AWS toolkit plugin 1.5
Add --debug flag to command you are running
I can't reproduce this:
sam init --runtime java8 --name java-hello-world
cd java-hello-world
sam build -u
Have you tested if your Docker containers have access to the internet generally?
I have tried to run it away from my work network with the same result. I ran docker run hello-world which ran fine and connected and pulled down the image from docker hub so the container does connect to the intranet.
I have been running the commands from IntelliJ terminal so I tried them in a command shell and got the same results.
Running the command with --debug I see it connects to the docker and gets the container image.
PS C:\RIM_API> sam build -u --debug
2019-08-06 09:23:35 Using SAM Template at C:\RIM_API\template.yaml
2019-08-06 09:23:35 Changing event name from creating-client-class.iot-data to creating-client-class.iot-data-plane
2019-08-06 09:23:35 Changing event name from before-call.apigateway to before-call.api-gateway
2019-08-06 09:23:35 Changing event name from request-created.machinelearning.Predict to request-created.machine-learning.Predict
2019-08-06 09:23:35 Changing event name from before-parameter-build.autoscaling.CreateLaunchConfiguration to before-parameter-build.auto-scaling.CreateLaunchConfiguration
2019-08-06 09:23:35 Changing event name from before-parameter-build.route53 to before-parameter-build.route-53
2019-08-06 09:23:35 Changing event name from request-created.cloudsearchdomain.Search to request-created.cloudsearch-domain.Search
2019-08-06 09:23:35 Changing event name from docs.*.autoscaling.CreateLaunchConfiguration.complete-section to docs.*.auto-scaling.CreateLaunchConfiguration.complete-section
2019-08-06 09:23:35 Changing event name from before-parameter-build.logs.CreateExportTask to before-parameter-build.cloudwatch-logs.CreateExportTask
2019-08-06 09:23:35 Changing event name from docs.*.logs.CreateExportTask.complete-section to docs.*.cloudwatch-logs.CreateExportTask.complete-section
2019-08-06 09:23:35 Changing event name from before-parameter-build.cloudsearchdomain.Search to before-parameter-build.cloudsearch-domain.Search
2019-08-06 09:23:35 Changing event name from docs.*.cloudsearchdomain.Search.complete-section to docs.*.cloudsearch-domain.Search.complete-section
2019-08-06 09:23:35 Changing event name from creating-client-class.iot-data to creating-client-class.iot-data-plane
2019-08-06 09:23:35 Changing event name from before-call.apigateway to before-call.api-gateway
2019-08-06 09:23:35 Changing event name from request-created.machinelearning.Predict to request-created.machine-learning.Predict
2019-08-06 09:23:35 Changing event name from before-parameter-build.autoscaling.CreateLaunchConfiguration to before-parameter-build.auto-scaling.CreateLaunchConfiguration
2019-08-06 09:23:35 Changing event name from before-parameter-build.route53 to before-parameter-build.route-53
2019-08-06 09:23:35 Changing event name from request-created.cloudsearchdomain.Search to request-created.cloudsearch-domain.Search
2019-08-06 09:23:35 Changing event name from docs.*.autoscaling.CreateLaunchConfiguration.complete-section to docs.*.auto-scaling.CreateLaunchConfiguration.complete-section
2019-08-06 09:23:35 Changing event name from before-parameter-build.logs.CreateExportTask to before-parameter-build.cloudwatch-logs.CreateExportTask
2019-08-06 09:23:35 Changing event name from docs.*.logs.CreateExportTask.complete-section to docs.*.cloudwatch-logs.CreateExportTask.complete-section
2019-08-06 09:23:35 Changing event name from before-parameter-build.cloudsearchdomain.Search to before-parameter-build.cloudsearch-domain.Search
2019-08-06 09:23:35 Changing event name from docs.*.cloudsearchdomain.Search.complete-section to docs.*.cloudsearch-domain.Search.complete-section
2019-08-06 09:23:35 'build' command is called
2019-08-06 09:23:35 Starting Build inside a container
2019-08-06 09:23:35 No Parameters detected in the template
2019-08-06 09:23:35 2 resources found in the template
2019-08-06 09:23:35 Found Serverless function with name='HelloWorldFunction' and CodeUri='HelloWorldFunction'
2019-08-06 09:23:35 Trying paths: ['C:\\Users\\eb96409\\.docker\\config.json', 'C:\\Users\\eb96409\\.dockercfg']
2019-08-06 09:23:35 Found file at path: C:\Users\eb96409\.docker\config.json
2019-08-06 09:23:35 Found 'auths' section
2019-08-06 09:23:35 Auth data for https://index.docker.io/v1/ is absent. Client might be using a credentials store instead.
2019-08-06 09:23:35 Found 'credsStore' section
2019-08-06 09:23:35 Building resource 'HelloWorldFunction'
2019-08-06 09:23:35 Looking for a supported build workflow in following directories: ['C:\\RIM_API\\HelloWorldFunction', 'C:\\RIM_API']
2019-08-06 09:23:35 http://localhost:None "GET /v1.35/_ping HTTP/1.1" 200 2
2019-08-06 09:23:35 Trying paths: ['C:\\Users\\eb96409\\.docker\\config.json', 'C:\\Users\\eb96409\\.dockercfg']
2019-08-06 09:23:35 Found file at path: C:\Users\eb96409\.docker\config.json
2019-08-06 09:23:35 Found 'auths' section
2019-08-06 09:23:35 Auth data for https://index.docker.io/v1/ is absent. Client might be using a credentials store instead.
2019-08-06 09:23:35 Found 'credsStore' section
2019-08-06 09:23:35 http://localhost:None "GET /v1.35/images/lambci/lambda:build-java8/json HTTP/1.1" 200 None
2019-08-06 09:23:35 Looking for auth config
2019-08-06 09:23:35 Using credentials store "desktop"
2019-08-06 09:23:35 Looking for auth entry for 'https://index.docker.io/v1/'
2019-08-06 09:23:35 Found auth config
2019-08-06 09:23:36 http://localhost:None "POST /v1.35/images/create?tag=build-java8&fromImage=lambci%2Flambda HTTP/1.1" 200 None
Fetching lambci/lambda:build-java8 Docker container image......
2019-08-06 09:23:36 Mounting C:\RIM_API\HelloWorldFunction as /tmp/samcli/source:ro,delegated inside runtime container
2019-08-06 09:23:36 http://localhost:None "POST /v1.35/containers/create HTTP/1.1" 201 88
2019-08-06 09:23:36 http://localhost:None "GET /v1.35/containers/a8096785153a951c3584ce394308aa3c1bf87e7e04fbff062283374b96a5c67e/json HTTP/1.1" 200 None
2019-08-06 09:23:36 http://localhost:None "GET /v1.35/containers/a8096785153a951c3584ce394308aa3c1bf87e7e04fbff062283374b96a5c67e/json HTTP/1.1" 200 None
2019-08-06 09:23:37 http://localhost:None "POST /v1.35/containers/a8096785153a951c3584ce394308aa3c1bf87e7e04fbff062283374b96a5c67e/start HTTP/1.1" 204 0
2019-08-06 09:23:37 http://localhost:None "GET /v1.35/containers/a8096785153a951c3584ce394308aa3c1bf87e7e04fbff062283374b96a5c67e/json HTTP/1.1" 200 None
2019-08-06 09:23:37 http://localhost:None "POST /containers/a8096785153a951c3584ce394308aa3c1bf87e7e04fbff062283374b96a5c67e/attach?stdout=1&stderr=1&logs=1&stream=1&stdin=0 HTTP/1.1" 101 0
Using the request object from command line argument
Loading workflow module 'aws_lambda_builders.workflows'
Registering workflow 'PythonPipBuilder' with capability 'Capability(language='python', dependency_manager='pip', application_framework=None)'
Registering workflow 'NodejsNpmBuilder' with capability 'Capability(language='nodejs', dependency_manager='npm', application_framework=None)'
Registering workflow 'RubyBundlerBuilder' with capability 'Capability(language='ruby', dependency_manager='bundler', application_framework=None)'
Registering workflow 'GoDepBuilder' with capability 'Capability(language='go', dependency_manager='dep', application_framework=None)'
Registering workflow 'GoModulesBuilder' with capability 'Capability(language='go', dependency_manager='modules', application_framework=None)'
Registering workflow 'JavaGradleWorkflow' with capability 'Capability(language='java', dependency_manager='gradle', application_framework=None)'
Registering workflow 'JavaMavenWorkflow' with capability 'Capability(language='java', dependency_manager='maven', application_framework=None)'
Registering workflow 'DotnetCliPackageBuilder' with capability 'Capability(language='dotnet', dependency_manager='cli-package', application_framework=None)'
Found workflow 'JavaMavenWorkflow' to support capabilities 'Capability(language=u'java', dependency_manager=u'maven', application_framework=None)'
Running workflow 'JavaMavenWorkflow'
Running JavaMavenWorkflow:CopySource
JavaMavenWorkflow:CopySource succeeded
Running JavaMavenWorkflow:MavenBuild
Maven logs: [INFO] Scanning for projects...
[INFO]
[INFO] -----------------------< helloworld:HelloWorld >------------------------
[INFO] Building A sample Hello World created for SAM CLI. 1.0
[INFO] --------------------------------[ jar ]---------------------------------
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.539 s
[INFO] Finished at: 2019-08-06T13:23:40Z
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.5: Could not transfer artifact org.apache.maven.plugins:maven-clean-plugin:pom:2.5 from/to central (https://repo.maven.apache.org/maven2): Remote host closed connection during handshake: SSL peer shut down incorrectly -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
JavaMavenWorkflow:MavenBuild failed
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/aws_lambda_builders/workflow.py", line 248, in run
action.execute()
File "/usr/local/lib/python2.7/site-packages/aws_lambda_builders/workflows/java_maven/actions.py", line 42, in execute
raise ActionFailedError(str(ex))
ActionFailedError: Maven Failed: [INFO] Scanning for projects...
[INFO]
[INFO] -----------------------< helloworld:HelloWorld >------------------------
[INFO] Building A sample Hello World created for SAM CLI. 1.0
[INFO] --------------------------------[ jar ]---------------------------------
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.539 s
[INFO] Finished at: 2019-08-06T13:23:40Z
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.5: Could not transfer artifact org.apache.maven.plugins:maven-clean-plugin:pom:2.5 from/to central (https://repo.maven.apache.org/maven2): Remote host closed connection during handshake: SSL peer shut down incorrectly -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
Builder workflow failed
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/aws_lambda_builders/__main__.py", line 137, in main
mode=params.get('mode', None))
File "/usr/local/lib/python2.7/site-packages/aws_lambda_builders/builder.py", line 115, in build
return workflow.run()
File "/usr/local/lib/python2.7/site-packages/aws_lambda_builders/workflow.py", line 65, in wrapper
func(self, *args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/aws_lambda_builders/workflow.py", line 257, in run
reason=str(ex))
WorkflowFailedError: JavaMavenWorkflow:MavenBuild - Maven Failed: [INFO] Scanning for projects...
[INFO]
[INFO] -----------------------< helloworld:HelloWorld >------------------------
[INFO] Building A sample Hello World created for SAM CLI. 1.0
[INFO] --------------------------------[ jar ]---------------------------------
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.539 s
[INFO] Finished at: 2019-08-06T13:23:40Z
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.5: Could not transfer artifact org.apache.maven.plugins:maven-clean-plugin:pom:2.5 from/to central (https://repo.maven.apache.org/maven2): Remote host closed connection during handshake: SSL peer shut down incorrectly -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
2019-08-06 09:23:40 Build inside container returned response {"jsonrpc": "2.0", "id": 1, "error": {"message": "JavaMavenWorkflow:MavenBuild - Maven Failed: [INFO] Scanning for projects...\n[INFO] \n[INFO] -----------------------< helloworld:HelloWorld >------------------------\n[INFO] Building A sample Hello World created for SAM CLI. 1.0\n[INFO] --------------------------------[ jar ]---------------------------------\nDownloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom\n[INFO] ------------------------------------------------------------------------\n[INFO] BUILD FAILURE\n[INFO] ------------------------------------------------------------------------\n[INFO] Total time: 0.539 s\n[INFO] Finished at: 2019-08-06T13:23:40Z\n[INFO] ------------------------------------------------------------------------\n[ERROR] Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.5: Could not transfer artifact org.apache.maven.plugins:maven-clean-plugin:pom:2.5 from/to central (https://repo.maven.apache.org/maven2): Remote host closed connection during handshake: SSL peer shut down incorrectly -> [Help 1]\n[ERROR] \n[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.\n[ERROR] Re-run Maven using the -X switch to enable full debug logging.\n[ERROR] \n[ERROR] For more information about the errors and possible solutions, please read the following articles:\n[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException", "code": 400}}
2019-08-06 09:23:40 http://localhost:None "GET /v1.35/containers/a8096785153a951c3584ce394308aa3c1bf87e7e04fbff062283374b96a5c67e/json HTTP/1.1" 200 None
2019-08-06 09:23:40 http://localhost:None "DELETE /v1.35/containers/a8096785153a951c3584ce394308aa3c1bf87e7e04fbff062283374b96a5c67e?v=False&link=False&force=True HTTP/1.1" 204 0
Build Failed
Error: JavaMavenWorkflow:MavenBuild - Maven Failed: [INFO] Scanning for projects...
[INFO]
[INFO] -----------------------< helloworld:HelloWorld >------------------------
[INFO] Building A sample Hello World created for SAM CLI. 1.0
[INFO] --------------------------------[ jar ]---------------------------------
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.539 s
[INFO] Finished at: 2019-08-06T13:23:40Z
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.5: Could not transfer artifact org.apache.maven.plugins:maven-clean-plugin:pom:2.5 from/to central (https://repo.maven.apache.org/maven2): Remote host closed connection during handshake: SSL peer shut down incorrectly -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
Is this still an error you are facing? Going to close this as its an older issue and we can re-open if its still an issue with the latest version of AWS SAM CLI.
⚠️COMMENT VISIBILITY WARNING⚠️
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.