sam build is stuck in Mounting
Hi
We have been facing this issue in our team where the build freezes on the "Mounting" phase of a lambda for almost 30-40 minutes before it proceeds to the next step. We have tried with three SAM versions and we see this behavior in all three versions. It is intermittent and happens sometimes on java lambda and sometimes on python lambdas. We have to kill the session and restart the build when it happens. Please see the build logs below. The logs below show that the Mounting phase took almost 35 minutes before it finished and proceeded.
Parameters used for sam build --use-container --debug --skip-pull-image
PC Configuration and versions SAM CLI, version - 1.15.0, 1.17.0, 1.18.0 aws cli - aws-cli/2.1.17 Windows PC - Windows 10 Enterprise OS build - 10.0.19041, RAM -32 GB, Docker Engine -20.10.2 with WSL2
Build Logs
2021-03-02 16:09:12,987 | Mounting C:....\word_to_html as /tmp/samcli/source:ro,delegated inside runtime container
Using the request object from command line argument
Loading workflow module 'aws_lambda_builders.workflows'
Registering workflow '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)'
Registering workflow 'CustomMakeBuilder' with capability 'Capability(language='provided', dependency_manager=None, application_framework=None)'
Found workflow 'JavaGradleWorkflow' to support capabilities 'Capability(language='java', dependency_manager='gradle', application_framework=None)'
Running workflow 'JavaGradleWorkflow'
Running JavaGradleWorkflow:GradleBuild
JavaGradleWorkflow:GradleBuild succeeded
Running JavaGradleWorkflow:CopyArtifacts
JavaGradleWorkflow:CopyArtifacts succeeded
2021-03-02 16:44:08,539 | Build inside container returned response {"jsonrpc": "2.0", "id": 1, "result": {"artifacts_dir": "/tmp/samcli/artifacts"}}
2021-03-02 16:44:08,539 | Build inside container was successful. Copying artifacts from container to host
2021-03-02 16:44:09,017 | Copying from container: /tmp/samcli/artifacts/. -> C:...\templates\automated-normalization-template.aws-sam\build\WordToHtmlFunction
2021-03-02 16:44:14,858 | Build inside container succeeded
2021-03-02 16:44:14,861 | Building codeuri: ../lambdas/java/xslt_conversion/ runtime: java8 metadata: {} functions: ['RunXSLTFunction']
2021-03-02 16:44:14,861 | Building to following folder C:.....\templates\automated-normalization-template.aws-sam\build\RunXSLTFunction
2021-03-02 16:44:14,861 | Looking for a supported build workflow in following directories: ['C:\...\lambdas\java\xslt_conversion', 'C:\...\templates']
2021-03-02 16:44:14,868 | Cannot convert host path 'C:....\templates' to its equivalent path within the container. Host path is not mounted within the container
2021-03-02 16:44:14,875 | Requested to skip pulling images ...
Raising a new one since unable to open https://github.com/aws/aws-sam-cli/issues/1994 cc: @RajeswariRamadossTR
I wasn't able to reproduce it locally on Windows. Seems like a docker issue from the mounting log. Can you try updating your docker engine?
Closing because it has been inactive for one month. Feel free to reopen it if you have any other questions.