Repository navigation
Bug: sam init - CalledProcessError #7929
Description
Description:
sam init --location git+ssh://git@github.com/my_org/my_repo.git failed with the following error.
2025-03-11 15:59:50 git clone failed with error: Cloning into 'odx-eq-lambda-aws-sam-python'...
OpenSSL version mismatch. Built against 30000020, you have 30300010
fatal: Could not read from remote repository.
Steps to reproduce:
- Create github repository and template with following structure:
❯ tree
.
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── cookiecutter.json
├── hooks
│ └── post_gen_project
└── {{cookiecutter.project_name}}
├── Makefile
├── Pipfile
├── README.md
├── buildspec.yaml
├── events
│ └── testevent.json
├── function
│ ├── __init__.py
│ └── requirements.txt
├── samconfig.toml
├── template.yaml
└── tests
├── __init__.py
├── conftest.py
└── unit
├── __init__.py
└── test_hello_function.py
- Run the command 'sam init --location git+ssh://git@github.com/my_org/my_repo.git'
Observed result:
2025-03-11 15:45:20 git clone failed with error: Cloning into 'my_repo'...
OpenSSL version mismatch. Built against 30000020, you have 30300010
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Error: Command '['git', 'clone', 'ssh://git@github.com/my_org/my_repo.git']' returned non-zero exit status 128.
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 "samcli/commands/init/command.py", line 103, in wrapped
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/init/command.py", line 266, in cli
File "samcli/commands/init/command.py", line 347, in do_cli
File "samcli/commands/init/init_generator.py", line 24, in do_generate
File "samcli/lib/init/init.py", line 112, in generate_project
File "cookiecutter/main.py", line 80, in cookiecutter
File "cookiecutter/repository.py", line 108, in determine_repo_dir
File "cookiecutter/vcs.py", line 105, in clone
File "subprocess.py", line 466, in check_output
File "subprocess.py", line 571, in run
An unexpected error was encountered while executing "sam init".
Search for an existing issue:
Expected result:
sam init completes successfully and the project directory is created.
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
- OS: Ubuntu 22.04(wsl)
sam --version: SAM CLI, version 1.134.0- AWS region: ap-northeast-1
# Paste the output of `sam --info` here
{
"version": "1.134.0",
"system": {
"python": "3.11.10",
"os": "Linux-5.15.167.4-microsoft-standard-WSL2-x86_64-with-glibc2.35"
},
"additional_dependencies": {
"docker_engine": "27.5.1",
"aws_cdk": "Not available",
"terraform": "Not available"
},
"available_beta_feature_env_vars": [
"SAM_CLI_BETA_FEATURES",
"SAM_CLI_BETA_BUILD_PERFORMANCE",
"SAM_CLI_BETA_TERRAFORM_SUPPORT",
"SAM_CLI_BETA_RUST_CARGO_LAMBDA"
]
}
Add --debug flag to command you are running
Same as the above results.
We have also confirmed that we can successfully clone from GitHub with the following command.
git clone git+ssh://git@github.com/my_org/my_repo.git
Also, the project is successfully created from CodeCommit's repository with the same contents.
Activity
vicheey commentedon Mar 28, 2025
Thank you for reaching out. This is likely because of the permission that SAM CLI uses to get the package. I'll take a look.
vicheey commentedon Mar 29, 2025
I was not able to reproduce the issue using my private repo. Please let me know if there is any
wikeegan commentedon May 2, 2025
I have been running into this same issue. Initially via a Codebuild stage, but was able to fix that by updating the image from Ubuntu to Amazon Linux. Issue started to appear late last year, and was stable for a few years before then.
Currently getting the issue now locally when running
sam build, but have also been able to reproduce the OP issue withsam init. Please see belowSam init Issue
Sam build Issue
Truncated Debug logs
Npm Logs
System Info
The
git --no-replace-objects ls-remote ssh://git@github.com/XXX/ada-common-lib.gitcommand does run successfully when not invoked within samroger-zhangg commentedon Jul 2, 2026
Hi, we're revisiting this issue during triage. We recently merged an OpenSSL update to version 3.3.7 (PR #9079) which may resolve the library version mismatch described here.
Could anyone still experiencing this issue try upgrading to the latest SAM CLI release and report back?
sam --version)CalledProcessError/ OpenSSL mismatch still occurs after upgradingIf the latest release resolves this, we'll close the issue. Thanks!
roger-zhangg commentedon Aug 1, 2026
Closing this as stale — no response to the triage follow-up above in ~29 days.
The OpenSSL update to 3.3.7 (#9079) has since shipped, which we believe addresses the library version mismatch described here.
If you're still hitting this after upgrading to a recent SAM CLI release, please comment and feel free to re-open — no need to file a new issue. What we'd need:
sam --version)openssl version)Thanks for the original report.
github-actions commentedon Aug 1, 2026
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.