Skip to content
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

SSH unsupported option "accept-new" #2908

Closed
trsteel88 opened this issue Jan 18, 2022 · 12 comments
Closed

SSH unsupported option "accept-new" #2908

trsteel88 opened this issue Jan 18, 2022 · 12 comments

Comments

@trsteel88
Copy link

trsteel88 commented Jan 18, 2022

  • 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

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar
@antonmedv antonmedv changed the title Error in v7-rc4 Local ssh doesn’t support accept-new Jan 18, 2022
@trsteel88 trsteel88 changed the title Local ssh doesn’t support accept-new v7-rc4 error - Local ssh doesn’t support accept-new Jan 19, 2022
@trsteel88
Copy link
Author

Ok, so it looks like you can get around this bug if you define git_ssh_command as "ssh".

set('git_ssh_command', 'ssh');

@hailwood
Copy link

hailwood commented Feb 2, 2022

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.

@antonmedv
Copy link
Member

This is bad :( accept-new is really helpful. Will write a doc.

@Sogl
Copy link

Sogl commented Jul 26, 2022

Same problem. I asked hosting to be transferred to another server with OpenSSH_8.0p1, OpenSSL 1.1.1k FIPS 25 Mar 2021

@antonmedv antonmedv changed the title v7-rc4 error - Local ssh doesn’t support accept-new SSH unsupported option "accept-new" Jul 26, 2022
@jonnott
Copy link

jonnott commented Sep 6, 2022

@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 :(

ocean90 added a commit to wearerequired/composer-deployer that referenced this issue Jan 23, 2023
ocean90 added a commit to wearerequired/composer-deployer that referenced this issue Jan 27, 2023
* Require deployer/deployer 7.1

* Don't suggest deprecated deployer/dist package

* Remove removed options

* Replace locateBinaryPath() with which()

* Replace inventory() with import()

* Rename task success to deploy:success and cleanup to deploy:cleanup.

* Remove duplicate Composer action

* Override git_ssh_command to fix git clone command

deployphp/deployer#2908

* Remove duplicate deploy task which are now included in deploy:prepare

* Add reusable workflow

* Update PHP and Deployer version used for deploy action

* Remove parallel, set no-interaction

* Use release_or_current_path so tasks can be used after a deployment too

* Use selectors via labels to define which stage should be deployed

* Add support for ACTIONS_STEP_DEBUG

* Run printenv

* Check for RUNNER_DEBUG

* Update check for RUNNER_DEBUG

* Set LANG to fix 'perl: warning: Setting locale failed.'

* Update locale by default

* Set LANG as step env
HereticPilgrim pushed a commit to HereticPilgrim/deployer that referenced this issue Mar 1, 2023
antonmedv pushed a commit that referenced this issue Mar 1, 2023
#3520)

* Added a note about missing ssh-option. Fixes issue #2908

* Slight wording update

---------

Co-authored-by: Manu <manuel.grauwiler@transformatik.ch>
@HereticPilgrim
Copy link
Contributor

@antonmedv Issue may be closed. Or is there anything else I can help out with?

@antonmedv
Copy link
Member

Nice catch) it can be closed.

@cr0ybot
Copy link

cr0ybot commented Jul 9, 2023

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.

@fd6130
Copy link

fd6130 commented Oct 31, 2023

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.

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.

@antonmedv
Copy link
Member

[staging] fatal: Could not read from remote repository.
[staging] Please make sure you have the correct access rights

@fd6130
Copy link

fd6130 commented Nov 1, 2023

[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.

@curder
Copy link

curder commented Feb 21, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants