Failed to deploy with rsync, connection refused.
Closed this issue · 22 comments
I have set the SSH port of my remote server to 1222, and I can establish SSH connection to my server successfully in Terminal.app. The hexo-deployer-rsync settings in the _config.yml
are listed below:
deploy:
- type: rsync
host: 123.206.XX.XXX
port: 1222
user: my_username
root: /home/my_username/public_html
delete: true # Default is true
args: public/
verbose: true # Default is true
ignore_errors: false # Default is false
However, each time I use hexo d
command, the following error information will appear:
INFO Deploying: rsync
ssh: connect to host 123.206.XX.XXX port 22: Connection refused
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at /BuildRoot/Library/Caches/com.apple.xbs/Sources/rsync/rsync-47/rsync/io.c(453) [sender=2.6.9]
FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html
Error: ssh: connect to host 123.206.XX.XXX port 22: Connection refused
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at /BuildRoot/Library/Caches/com.apple.xbs/Sources/rsync/rsync-47/rsync/io.c(453) [sender=2.6.9]
at ChildProcess.<anonymous> (/Users/whm/Documents/hexo/node_modules/hexo-deployer-rsync/node_modules/hexo-util/lib/spawn.js:37:17)
at emitTwo (events.js:87:13)
at ChildProcess.emit (events.js:172:7)
at maybeClose (internal/child_process.js:827:16)
at Socket.<anonymous> (internal/child_process.js:319:11)
at emitOne (events.js:77:13)
at Socket.emit (events.js:169:7)
at Pipe._onclose (net.js:477:12)
FATAL ssh: connect to host 123.206.XX.XXX port 22: Connection refused
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at /BuildRoot/Library/Caches/com.apple.xbs/Sources/rsync/rsync-47/rsync/io.c(453) [sender=2.6.9]
Error: ssh: connect to host 123.206.XX.XXX port 22: Connection refused
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at /BuildRoot/Library/Caches/com.apple.xbs/Sources/rsync/rsync-47/rsync/io.c(453) [sender=2.6.9]
at ChildProcess.<anonymous> (/Users/whm/Documents/hexo/node_modules/hexo-deployer-rsync/node_modules/hexo-util/lib/spawn.js:37:17)
at emitTwo (events.js:87:13)
at ChildProcess.emit (events.js:172:7)
at maybeClose (internal/child_process.js:827:16)
at Socket.<anonymous> (internal/child_process.js:319:11)
at emitOne (events.js:77:13)
at Socket.emit (events.js:169:7)
at Pipe._onclose (net.js:477:12)
I am wondering why it always tries to establish SSH connection using port 22 not my set port 1222?
remove the -
before rsync
and try again?
The problem still exists.
Change https://github.com/hexojs/hexo-deployer-rsync/blob/master/lib/deployer.js#L33-L42 to
var params = [
'-az',
this.public_dir,
'-e ssh -p ' + args.root,
args.user + '@' + args.host + ':' + args.root
];
好像还是有点不对,这里应该给rsync添加一个-e 'ssh -p 1234'
的参数
我这次更新Hexo版本和插件版本之前还能正常使用的,前两天更新了以后就出现这个问题了……
我看一下更新的记录
原来那个参数已经弃用了,现在要重新调整一下脚本
好的,期待修复~
https://github.com/hexojs/hexo-deployer-rsync 在package.json中指定最新的代码试试看
请问如何指定最新的代码呢?
我先直接手动改一下试试吧……
npm install git@github.com:hexojs/hexo-deployer-rsync.git --save
因为版本号没有改,所以可能需要先删除旧的。
貌似我的node和npm版本并不支持这种url的安装方式,于是我手动替换了新的代码,现在hexo d
后的错误如下:
INFO Deploying: rsync
rsync: Failed to exec ssh -p 1222: No such file or directory (2)
rsync error: error in IPC code (code 14) at /BuildRoot/Library/Caches/com.apple.xbs/Sources/rsync/rsync-47/rsync/pipe.c(86) [sender=2.6.9]
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: error in IPC code (code 14) at /BuildRoot/Library/Caches/com.apple.xbs/Sources/rsync/rsync-47/rsync/io.c(453) [sender=2.6.9]
FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html
Error: rsync: Failed to exec ssh -p 1222: No such file or directory (2)
rsync error: error in IPC code (code 14) at /BuildRoot/Library/Caches/com.apple.xbs/Sources/rsync/rsync-47/rsync/pipe.c(86) [sender=2.6.9]
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: error in IPC code (code 14) at /BuildRoot/Library/Caches/com.apple.xbs/Sources/rsync/rsync-47/rsync/io.c(453) [sender=2.6.9]
at ChildProcess.<anonymous> (/Users/whm/Documents/hexo/node_modules/hexo-deployer-rsync/node_modules/hexo-util/lib/spawn.js:37:17)
at emitTwo (events.js:87:13)
at ChildProcess.emit (events.js:172:7)
at maybeClose (internal/child_process.js:827:16)
at Socket.<anonymous> (internal/child_process.js:319:11)
at emitOne (events.js:77:13)
at Socket.emit (events.js:169:7)
at Pipe._onclose (net.js:477:12)
FATAL rsync: Failed to exec ssh -p 1222: No such file or directory (2)
rsync error: error in IPC code (code 14) at /BuildRoot/Library/Caches/com.apple.xbs/Sources/rsync/rsync-47/rsync/pipe.c(86) [sender=2.6.9]
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: error in IPC code (code 14) at /BuildRoot/Library/Caches/com.apple.xbs/Sources/rsync/rsync-47/rsync/io.c(453) [sender=2.6.9]
Error: rsync: Failed to exec ssh -p 1222: No such file or directory (2)
rsync error: error in IPC code (code 14) at /BuildRoot/Library/Caches/com.apple.xbs/Sources/rsync/rsync-47/rsync/pipe.c(86) [sender=2.6.9]
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: error in IPC code (code 14) at /BuildRoot/Library/Caches/com.apple.xbs/Sources/rsync/rsync-47/rsync/io.c(453) [sender=2.6.9]
at ChildProcess.<anonymous> (/Users/whm/Documents/hexo/node_modules/hexo-deployer-rsync/node_modules/hexo-util/lib/spawn.js:37:17)
at emitTwo (events.js:87:13)
at ChildProcess.emit (events.js:172:7)
at maybeClose (internal/child_process.js:827:16)
at Socket.<anonymous> (internal/child_process.js:319:11)
at emitOne (events.js:77:13)
at Socket.emit (events.js:169:7)
at Pipe._onclose (net.js:477:12)
让我想想
试一下 '-e ssh -p ' + args.port
?
将L36改成了'-e ssh -p ' + args.port,
,现在可以正常运行了!
Got,我重新提交下。
嗯,非常感谢!
不客气,有问题欢迎反馈,这个我会尽快推到npm上。
我在使用hexo-deployer-ftpsync的时候也遇到了一个问题,hexojs/hexo-deployer-ftpsync#16 不过貌似这个并不是你们插件的问题,不知道何时能有上游的大神解决😂……
看出来了- -,你报给ftpsync那边了么?
报了,还有那个jsftp也报了。
Best regards,
Haoming Wei
On 周五, 7月 1, 2016 at 17:54, 漩涡 notifications@github.com wrote:
看出来了- -,你报给ftpsync那边了么?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub [https://github.com//issues/20#issuecomment-229907223] , or mute the thread [https://github.com/notifications/unsubscribe/AGec2YAgBH1WnIPp-qAkMEej71O6YhWwks5qROPZgaJpZM4JC5gT] .