deployer
deployer copied to clipboard
SSH unsupported option "accept-new"
- Deployer version: 7.0.0-rc.4
task deploy:release
task deploy:update_code
[prod] error in update_code.php on line 84:
[prod] run export GIT_TERMINAL_PROMPT='0' GIT_SSH_COMMAND='ssh -o StrictHostKeyChecking=accept-new'; cd ~/application/prod/.dep/repo && (/usr/local/cpanel/3rdparty/lib/path-bin/git remote update 2>&1)
[prod] Fetching origin
[prod] command-line line 0: unsupported option "accept-new".
[prod] fatal: Could not read from remote repository.
[prod] Please make sure you have the correct access rights
[prod] and the repository exists.
[prod] error: Could not fetch origin
[prod] exit code 1 (General error)
task deploy:failed
Ok, so it looks like you can get around this bug if you define git_ssh_command as "ssh".
set('git_ssh_command', 'ssh');
A note here that you'd think the answer would be "upgrade the version of openssh on your server" since the accept-new option was introduced in 7.6...
However this is going to be a common problem as AmazonLinux only officially supports openssh v7.4.
This is bad :( accept-new is really helpful. Will write a doc.
Same problem. I asked hosting to be transferred to another server with OpenSSH_8.0p1, OpenSSL 1.1.1k FIPS 25 Mar 2021
@antonmedv Could this be mentioned somewhere clearly in the docs? I couldn't get around this issue until I searched the github issues and found the set('git_ssh_command', 'ssh');
solution above :(
@antonmedv Issue may be closed. Or is there anything else I can help out with?
Nice catch) it can be closed.
Just wanted to leave a note here that adding git_ssh_command: "ssh"
to my deploy.yaml file not only removed the command-line line 0: unsupported option "accept-new".
message, but fixed my git read connection entirely. I've been struggling with fatal: Could not read from remote repository.
for hours now. I had done everything else I could possibly do, including setting up SSH keys and known hosts, etc. I happen to be on a CPanel host that no doubt has outdated OpenSSH.
Just wanted to leave a note here that adding
git_ssh_command: "ssh"
to my deploy.yaml file not only removed thecommand-line line 0: unsupported option "accept-new".
message, but fixed my git read connection entirely. I've been struggling withfatal: Could not read from remote repository.
for hours now. I had done everything else I could possibly do, including setting up SSH keys and known hosts, etc. I happen to be on a CPanel host that no doubt has outdated OpenSSH.
Im using ubuntu 22.04 with "OpenSSH_8.9p1 Ubuntu-3ubuntu0.4, OpenSSL 3.0.2", but still facing
Fetching origin
[staging] ERROR: Repository not found.
[staging] fatal: Could not read from remote repository.
[staging] Please make sure you have the correct access rights
[staging] and the repository exists.
staging] error: Could not fetch origin
[staging] error in update_code.php on line 101:
[staging] exit code 1 (General error)
ERROR: Task deploy:update_code failed!
But when I manually cd to the directory and run the git remote update 2>&1
it works, but not in deployer.
[staging] fatal: Could not read from remote repository. [staging] Please make sure you have the correct access rights
[staging] fatal: Could not read from remote repository. [staging] Please make sure you have the correct access rights
Fun fact: deployer successfully cloned the repo (so not suppose to have "Could not read from remote repository" error), but it error when executing git remote update 2>&1
in update_code.php.
I can cd to the directory .dep/repo
created by deployer and successfully run the command git remote update 2>&1
according to the deployer shell output -v without issue but not in deployer itself.
Deployer: fatal: Could not read from remote repository.
When I cd to directory and run git command: git fetch successfully.
Ok, so it looks like you can get around this bug if you define git_ssh_command as "ssh".
set('git_ssh_command', 'ssh');
If using yaml , you can config it like below:
config:
git_ssh_command: ssh