ssh-deploy
ssh-deploy copied to clipboard
Warning: Permanently added '***' (ECDSA) to the list of known hosts
2020-10-22T07:41:24.5568739Z [Rsync] Starting Rsync Action: /home/runner/work/oa/oa/dist/ to ***@***:***
2020-10-22T07:41:31.1770919Z ⚠️ [Rsync] error: rsync exited with code 23
2020-10-22T07:41:31.1773617Z ⚠️ [Rsync] stderr: Warning: Permanently added '***' (ECDSA) to the list of known hosts.
2020-10-22T07:41:31.1775129Z rsync: chgrp "***/." failed: Operation not permitted (1)
2020-10-22T07:41:31.1776683Z rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1196) [sender=3.1.2]
2020-10-22T07:41:31.1777553Z
2020-10-22T07:41:31.1778526Z ⚠️ [Rsync] stdout: sending incremental file list
need help 2
me too
and me)
As a workaround. You could prepare SSH_HOSTKEY using ssh-keyscan -p <sshport> <hostname>
and save it to known_hosts
.
See an example
- name: Prepare SSH to work with the remote server
run: |
cd ~ && mkdir .ssh &&
touch ~/.ssh/known_hosts &&
echo "${{ secrets.SSH_HOSTKEY }}" > ~/.ssh/known_hosts
does not work
Run rsync --version
to confirm rsync was installed on your remote host.And install it if needed.
@sergejkaravajnij it doesn't work for us neither, sorry
I wound up using a modified version of @sergejkaravajnij's suggestion (making sure, of course, that the host's IP is saved as a secret in the repo as IP
):
- name: Prepare SSH
run: >
cd ~ && mkdir .ssh &&
touch ~/.ssh/known_hosts &&
ssh-keyscan -H "$IP" >>~/.ssh/known_hosts
env:
IP: ${{ secrets.IP }}
Make sure REMOTE_USER have all permissions of TARGET.
need help +1
I have a similar problem:
⚠️ [Rsync] error: rsync exited with code 255
⚠️ [Rsync] stderr: Warning: Permanently added '[***]:***' (ECDSA) to the list of known hosts.
Permission denied, please try again.
Permission denied, please try again.
***@***: Permission denied (publickey,password).
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: unexplained error (code 255) at io.c([23](https://github.com/ctrlmaniac/larapida-on-django/runs/7752617592?check_suite_focus=true#step:4:24)5) [sender=3.1.3]
⚠️ [Rsync] stdout:
⚠️ [Rsync] cmd: rsync /home/runner/work/***-on-django/***-on-django/webapp/ ***@***:/home/REMOTE_USER/ --rsh "ssh -p *** -i /home/runner/.ssh/deploy_key -o StrictHostKeyChecking=no" --recursive --exclude= -rltgoDzvO
1: 0xa1a640 node::Abort() [/home/runner/runners/2.[29](https://github.com/ctrlmaniac/larapida-on-django/runs/7752617592?check_suite_focus=true#step:4:30)4.0/externals/node12/bin/node]
2: 0xa90649 [/home/runner/runners/2.294.0/externals/node12/bin/node]
3: 0xc06599 [/home/runner/runners/2.294.0/externals/node12/bin/node]
4: 0xc08387 v8::internal::Builtin_HandleApiCall(int, unsigned long*, v8::internal::Isolate*) [/home/runner/runners/2.294.0/externals/node12/bin/node]
5: 0x140dd19 [/home/runner/runners/2.294.0/externals/node12/bin/node]
How should I resolve it?
⚠️ [Rsync] error: rsync exited with code 255 ⚠️ [Rsync] stderr: Warning: Permanently added '[]:' (ECDSA) to the list of known hosts. Permission denied, please try again. Permission denied, please try again. @: Permission denied (publickey,password). rsync: connection unexpectedly closed (0 bytes received so far) [sender] rsync error: unexplained error (code 255) at io.c(235) [sender=3.1.3]
⚠️ [Rsync] stdout:
⚠️ [Rsync] cmd: rsync /home/runner/work/-on-django/-on-django/webapp/ @:/home/REMOTE_USER/ --rsh "ssh -p *** -i /home/runner/.ssh/deploy_key -o StrictHostKeyChecking=no" --recursive --exclude= -rltgoDzvO
1: 0xa1a640 node::Abort() [/home/runner/runners/2.294.0/externals/node12/bin/node]
2: 0xa90649 [/home/runner/runners/2.294.0/externals/node12/bin/node]
3: 0xc06599 [/home/runner/runners/2.294.0/externals/node12/bin/node]
4: 0xc08387 v8::internal::Builtin_HandleApiCall(int, unsigned long*, v8::internal::Isolate*) [/home/runner/runners/2.294.0/externals/node12/bin/node]
5: 0x140dd19 [/home/runner/runners/2.294.0/externals/node12/bin/node]
help me to resolve this
@mohan-1324 @ctrlmaniac Those aren't similar problems. You're running into code 255 and are getting permission errors with your public key. Most likely not in PEM format. There are several threads with the same error, no need to hijack this one.
I am currently also running into error 23, file or directory not found. I'm going to give @SturmB solution a shot.
I've added a lot of additional logs for easier debugging. Also added script execution via ssh
env:
SCRIPT_BEFORE: ls
If script env var is configured, before execution known_hosts
are updated same as proposed here, just using REMOTE_HOST
instead of IP, since remote host is already available.
Also added full e2e testing.
e2e Tests are creating test user and host with docker and then executing this action in real e2e scenario.
Check: https://github.com/easingthemes/ssh-deploy/blob/main/.github/workflows/e2e.yml
-
SCRIPT_BEFORE (optional, default '') Script to run on host machine before rsync. Single line or multiline commands. Execution is preformed by storing commands in .sh file and executing it via .bash over ssh
-
SCRIPT_AFTER (optional, default '') Script to run on host machine after rsync. Rsync output is stored in $RSYNC_STDOUT env variable.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
It works fine after adding SCRIPT_BEFORE: ls (or whoami)
But any idea why the default ssh-keyscan (line 50) fails to begin with? I tested with both ubuntu-22.04 as well as ubuntu-20.04 with similar results.
Any clue whether it has something to do with the GitHub Ubuntu images?
Also is it not possible to use an ed25519
based key with this action?
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.