easingthemes / ssh-deploy

GitHub Action for deploying code via rsync over ssh. (with NodeJS)
MIT License
1.19k stars 146 forks source link

Dose support deploy to pure IPV6 server ? #125

Closed xiaoxin-sky closed 1 year ago

xiaoxin-sky commented 1 year ago

I get the Network is unreachable log, I think it because my server is use ipv6, But I'm not sure.

Run easingthemes/ssh-deploy@v2.1.2
  with:
    REMOTE_PORT: [2](https://github.com/xiaoxin-sky/dodoting/actions/runs/4215307715/jobs/7316351347#step:6:2)2
    TARGET: /home/REMOTE_USER/
  env:
    SSH_PRIVATE_KEY: ***
    SOURCE: packages/app-server/
    REMOTE_HOST: ***
    REMOTE_USER: ***
    TARGET: /root/tmpGithubAction/
[general] GITHUB_WORKSPACE:  /home/runner/work/dodoting/dodoting
[SSH] Creating /home/runner/.ssh dir in  /home/runner/work/dodoting/dodoting
✅ [SSH] dir created.
[SSH] Creating /home/runner/.ssh/known_hosts file in  /home/runner/work/dodoting/dodoting
✅ [SSH] file created.
✅ Ssh key added to `.ssh` dir  /home/runner/.ssh/deploy_key
[Rsync] Starting Rsync Action: /home/runner/work/dodoting/dodoting/packages/app-server/ to ***@***:/root/tmpGithubAction/
⚠️ [Rsync] error:  rsync exited with code 255
⚠️ [Rsync] stderr:  ssh: connect to host *** port 22: Network is unreachable
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: unexplained error (code 255) at io.c(228) [sender=[3](https://github.com/xiaoxin-sky/dodoting/actions/runs/4215307715/jobs/7316351347#step:6:3).2.3]

⚠️ [Rsync] stdout:  
⚠️ [Rsync] cmd:  rsync /home/runner/work/dodoting/dodoting/packages/app-server/ ***@***:/root/tmpGithubAction/ --rsh "ssh -p 22 -i /home/runner/.ssh/deploy_key -o StrictHostKeyChecking=no" --recursive -rltgoDzvO
 1: 0xa1a6[4](https://github.com/xiaoxin-sky/dodoting/actions/runs/4215307715/jobs/7316351347#step:6:4)0 node::Abort() [/home/runner/runners/2.301.1/externals/node12/bin/node]
 2: 0xa90649  [/home/runner/runners/2.301.1/externals/node12/bin/node]
 3: 0xc06[5](https://github.com/xiaoxin-sky/dodoting/actions/runs/4215307715/jobs/7316351347#step:6:5)99  [/home/runner/runners/2.301.1/externals/node12/bin/node]
 4: 0xc0838[7](https://github.com/xiaoxin-sky/dodoting/actions/runs/4215307715/jobs/7316351347#step:6:7) v[8](https://github.com/xiaoxin-sky/dodoting/actions/runs/4215307715/jobs/7316351347#step:6:8)::internal::Builtin_HandleApiCall(int, unsigned long*, v8::internal::Isolate*) [/home/runner/runners/2.301.1/externals/node12/bin/node]
 5: 0x140dd1[9](https://github.com/xiaoxin-sky/dodoting/actions/runs/4215307715/jobs/7316351347#step:6:9)  [/home/runner/runners/2.301.1/externals/node[12](https://github.com/xiaoxin-sky/dodoting/actions/runs/4215307715/jobs/7316351347#step:6:13)/bin/node]
easingthemes commented 1 year ago

Try using latest version @v4.1.8, and add env var:

SCRIPT_BEFORE: 'ls'
xiaoxin-sky commented 1 year ago

thank you for your reply, I add env var. But it also show network is unreachable.

Run easingthemes/ssh-deploy@v4.1.8
[DIR] Creating /home/runner/.ssh dir in workspace root
✅ [DIR] dir created.
[FILE] writing /home/runner/.ssh/known_hosts file ... 0
✅ [SSH] known_hosts file ensured /home/runner/.ssh
✅ [DIR] /home/runner/.ssh dir exist
[FILE] writing /home/runner/.ssh/deploy_key_***_[16](https://github.com/xiaoxin-sky/dodoting/actions/runs/4268539767/jobs/7431098780#step:6:17)77302966383 file ... 3244
✅ [SSH] key added to `.ssh` dir  /home/runner/.ssh deploy_key_***_1677302966383
[SSH] Adding host to `known_hosts` .... *** /home/runner/.ssh/known_hosts
connect (`***'): Network is unreachable
connect (`***'): Network is unreachable
connect (`***'): Network is unreachable
connect (`***'): Network is unreachable
connect (`***'): Network is unreachable
❌ [SSH] Adding host to `known_hosts` ERROR *** Command failed: ssh-keyscan -p [22](https://github.com/xiaoxin-sky/dodoting/actions/runs/4268539767/jobs/7431098780#step:6:23) -H ***  >> /home/runner/.ssh/known_hosts
✅ [SSH] Adding host to `known_hosts` DONE *** /home/runner/.ssh/known_hosts
✅ [DIR] /home/runner/work/dodoting/dodoting dir exist
[FILE] writing /home/runner/work/dodoting/dodoting/local_ssh_script-before.sh file ... 2
Executing remote script: ssh -i /home/runner/.ssh/deploy_key_***_167730[29](https://github.com/xiaoxin-sky/dodoting/actions/runs/4268539767/jobs/7431098780#step:6:30)66383 ***@***
⚠️ [CMD] Remote script failed: Command failed: DEBIAN_FRONTEND=noninteractive ssh -p 22 -i /home/runner/.ssh/deploy_key_***_1677[30](https://github.com/xiaoxin-sky/dodoting/actions/runs/4268539767/jobs/7431098780#step:6:31)2966383 -o StrictHostKeyChecking=no ***@*** 'RSYNC_STDOUT="" bash -s' < local_ssh_script-before.sh
ssh: connect to host *** port 22: Network is unreachable

  ssh: connect to host *** port 22: Network is unreachable

⚠️ [CMD] Remote script failed: Command failed: DEBIAN_FRONTEND=noninteractive ssh -p 22 -i /home/runner/.ssh/deploy_key_***_1677302966383 -o StrictHostKeyChecking=no ***@*** 'RSYNC_STDOUT="" bash -s' < local_ssh_script-before.sh
ssh: connect to host *** port 22: Network is unreachable
easingthemes commented 1 year ago

Then this sounds like issue related to your server, since first script is just ssh which works with IPV6. Try locally ssh connection and ping also.

github-actions[bot] commented 1 year ago

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.