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

Deploy successfully, but in fact the file doesn't rsync to remote server and no error happens #6

Closed
wonsikin opened this issue Jun 24, 2015 · 14 comments

Comments

@wonsikin
Copy link

My config in _config.yml is :

deploy:
  type: rsync
  host: 139.xxx.xxx.65
  user: webapp
  root: /opt/blog/
  args: 

And after i ran command: hexo d,the terminal show:

INFO  Deploying: rsync
building file list ...
done
drwxr-xr-x         272 2015/06/24 21:48:33 .
-rw-r--r--        7279 2015/06/24 21:48:33 index.html
drwxr-xr-x         102 2015/06/24 21:48:33 2015
drwxr-xr-x         102 2015/06/24 21:48:33 2015/06
drwxr-xr-x         136 2015/06/24 21:48:33 2015/06/24
drwxr-xr-x         102 2015/06/24 21:48:33 2015/06/24/Hello
-rw-r--r--        4716 2015/06/24 21:48:33 2015/06/24/Hello/index.html
drwxr-xr-x         102 2015/06/24 21:48:33 2015/06/24/hello-world
-rw-r--r--        7451 2015/06/24 21:48:33 2015/06/24/hello-world/index.html
drwxr-xr-x         136 2015/06/24 21:48:33 archives
-rw-r--r--        4790 2015/06/24 21:48:33 archives/index.html
drwxr-xr-x         136 2015/06/24 21:48:33 archives/2015
-rw-r--r--        4801 2015/06/24 21:48:33 archives/2015/index.html
drwxr-xr-x         102 2015/06/24 21:48:33 archives/2015/06
-rw-r--r--        4806 2015/06/24 21:48:33 archives/2015/06/index.html
drwxr-xr-x         170 2015/06/24 21:48:33 css
-rw-r--r--       24491 2015/06/24 21:48:33 css/style.css
drwxr-xr-x         238 2015/06/24 21:48:33 css/fonts
-rw-r--r--       62856 2015/06/24 21:48:33 css/fonts/FontAwesome.otf
-rw-r--r--       38205 2015/06/24 21:48:33 css/fonts/fontawesome-webfont.eot
-rw-r--r--      202148 2015/06/24 21:48:33 css/fonts/fontawesome-webfont.svg
-rw-r--r--       80652 2015/06/24 21:48:33 css/fonts/fontawesome-webfont.ttf
-rw-r--r--       44432 2015/06/24 21:48:33 css/fonts/fontawesome-webfont.woff
drwxr-xr-x         102 2015/06/24 21:48:33 css/images
-rw-r--r--      245780 2015/06/24 21:48:33 css/images/banner.jpg
drwxr-xr-x         408 2015/06/24 21:48:33 fancybox
-rw-r--r--          43 2015/06/24 21:48:33 fancybox/blank.gif
-rw-r--r--        6567 2015/06/24 21:48:33 fancybox/fancybox_loading.gif
-rw-r--r--       13984 2015/06/24 21:48:33 fancybox/fancybox_loading@2x.gif
-rw-r--r--        1003 2015/06/24 21:48:33 fancybox/fancybox_overlay.png
-rw-r--r--        1362 2015/06/24 21:48:33 fancybox/fancybox_sprite.png
-rw-r--r--        6553 2015/06/24 21:48:33 fancybox/fancybox_sprite@2x.png
-rw-r--r--        4863 2015/06/24 21:48:33 fancybox/jquery.fancybox.css
-rw-r--r--       48730 2015/06/24 21:48:33 fancybox/jquery.fancybox.js
-rw-r--r--       23187 2015/06/24 21:48:33 fancybox/jquery.fancybox.pack.js
drwxr-xr-x         272 2015/06/24 21:48:33 fancybox/helpers
-rw-r--r--        1080 2015/06/24 21:48:33 fancybox/helpers/fancybox_buttons.png
-rw-r--r--        2447 2015/06/24 21:48:33 fancybox/helpers/jquery.fancybox-buttons.css
-rw-r--r--        3042 2015/06/24 21:48:33 fancybox/helpers/jquery.fancybox-buttons.js
-rw-r--r--        5306 2015/06/24 21:48:33 fancybox/helpers/jquery.fancybox-media.js
-rw-r--r--         735 2015/06/24 21:48:33 fancybox/helpers/jquery.fancybox-thumbs.css
-rw-r--r--        3889 2015/06/24 21:48:33 fancybox/helpers/jquery.fancybox-thumbs.js
drwxr-xr-x         102 2015/06/24 21:48:33 js
-rw-r--r--        3838 2015/06/24 21:48:33 js/script.js
delta-transmission disabled for local transfer or --whole-file
total: matches=0  hash_hits=0  false_alarms=0 data=0

sent 1304 bytes  received 20 bytes  2648.00 bytes/sec
total size is 859036  speedup is 648.82
INFO  Deploy done: rsync

But in fact ,the public folder wasn't sent to remote folder.

I try to fix the problem,and add console in lib/deployer.js :

...
    if (args.args) params.unshift(args.args);
        console.log(params.join(' '));
        return spawn('rsync', params, { verbose: true });
...

It shows :

--delete -v -az public/ -e webapp@139.xxx.xxx.65:/opt/blog/
@wonsikin wonsikin changed the title Deploy successfully, but in fact the file doesn't rsync to remote server and no error happen Deploy successfully, but in fact the file doesn't rsync to remote server and no error happens Jun 24, 2015
@Xuanwo
Copy link
Contributor

Xuanwo commented Jun 24, 2015

@tommy351

@wonsikin
Copy link
Author

I add an argument ssh into the rsync command like the following:

rsync --delete -v -az public/ -e ssh webapp@139.xxx.xxx.65:/opt/blog/

and it run successfully,the public folder is sent to the remote server.

@orangeclk
Copy link

I also encountered the problem today. It seems a new bug.

@BurningDog
Copy link

Or manually set the value of port to 22 (or whatever your port is). Then ssh -p is correctly inserted into the rsync command.

@syhlion
Copy link

syhlion commented Aug 10, 2015

Thanks @BurningDog I can use it

@moklick
Copy link

moklick commented Oct 21, 2015

This repo has 2 issues and 2 PRs.. All because of the missing port. If you can't fix that issue right now, you could just update the docs, that there is no default port..

Otherwise this one line should also fix the bug:
if (!args.hasOwnProperty('port')) args.port = 22;

@leesei
Copy link
Member

leesei commented Nov 10, 2015

Dear commenters, are #7 and #8 still relevant after merge of #11?

@moklick
Copy link

moklick commented Nov 10, 2015

@leesei yep, I think so

@jhalbrecht
Copy link

FWIW I just installed hexo-deployer-rsync 0.1.1. I had to specify port: 22 before it would work properly for me.

C:\Users\jeffa\Development\Hexo\bigstick>npm install hexo-deployer-rsync --save
hexo-deployer-rsync@0.1.1 node_modules\hexo-deployer-rsync
├── chalk@1.1.1 (ansi-styles@2.1.0, supports-color@2.0.0, escape-string-regexp@1.0.3, has-ansi@2.0.0, strip-ansi@3.0.0)
└── hexo-util@0.1.7 (ent@2.2.0, bluebird@2.10.2, highlight.js@8.9.1)

Also when it wasn't actually working before I specified the port, it gave no indication that it wasn't working. It looked like it was working for this first time user (me).

// looks like it's working... but not so.
C:\Users\jeffa\Development\Hexo\bigstick>hexo deploy
INFO  Deploying: rsync
sending incremental file list
drwxr-xr-x        4096 2015/12/08 01:14:59 .
-rw-r--r--        8759 2015/12/08 01:14:59 index.html
drwxr-xr-x           0 2015/12/08 01:14:59 2015
drwxr-xr-x           0 2015/12/08 01:14:59 2015/12
drwxr-xr-x           0 2015/12/08 01:14:59 2015/12/08
drwxr-xr-x           0 2015/12/08 01:14:59 2015/12/08/Sampson
-rw-r--r--        5864 2015/12/08 01:14:59 2015/12/08/Sampson/index.html
[...]

@leesei leesei reopened this Dec 8, 2015
@leesei
Copy link
Member

leesei commented Dec 8, 2015

@jhalbrecht #11 is not pushed to npm.
Use npm i hexojs/hexo-deployer-rsync -S to use the GitHub version.
Please remove the port from config and report your findings.
Thanks.

@tommy351 Care to update the npm version?

@jhalbrecht
Copy link

Created a new hexo 'deleteme' Tested working.
Added hexo rsync per above resulting in error with some warn/error messages. Looks like it installed though.
Errors in deployment The source and destination cannot both be remote.

C:\Users\jeffa\Development\Hexo\deleteme>npm i hexojs/hexo-deployer-rsync -S
npm WARN addRemoteGit Error: Command failed: git -c core.longpaths=true config --get remote.origin.url
npm WARN addRemoteGit
npm WARN addRemoteGit     at ChildProcess.exithandler (child_process.js:203:12)
npm WARN addRemoteGit     at emitTwo (events.js:87:13)
npm WARN addRemoteGit     at ChildProcess.emit (events.js:172:7)
npm WARN addRemoteGit     at maybeClose (internal/child_process.js:818:16)
npm WARN addRemoteGit     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
npm WARN addRemoteGit  hexojs/hexo-deployer-rsync resetting remote C:\Users\jeffa\AppData\Roaming\npm-cache\_git-remotes\git-github-com-hexojs-hexo-deployer-rsync-git-d983e3eb because of error: { [Error: Command failed: git -c core.longpaths=true config --get remote.origin.url
npm WARN addRemoteGit ]
npm WARN addRemoteGit   killed: false,
npm WARN addRemoteGit   code: 1,
npm WARN addRemoteGit   signal: null,
npm WARN addRemoteGit   cmd: 'git -c core.longpaths=true config --get remote.origin.url' }
hexo-deployer-rsync@0.1.1 node_modules\hexo-deployer-rsync
├── chalk@1.1.1 (supports-color@2.0.0, escape-string-regexp@1.0.3, ansi-styles@2.1.0, has-ansi@2.0.0, strip-ansi@3.0.0)
└── hexo-util@0.1.7 (ent@2.2.0, bluebird@2.10.2, highlight.js@8.9.1)

C:\Users\jeffa\Development\Hexo\deleteme>hexo generate
C:\Users\jeffa\Development\Hexo\deleteme>hexo deploy
INFO  Deploying: rsync
The source and destination cannot both be remote.
rsync error: syntax or usage error (code 1) at /usr/src/rsync/rsync-3.0.8/main.c(1148) [Receiver=3.0.8]
FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html
Error: The source and destination cannot both be remote.
rsync error: syntax or usage error (code 1) at /usr/src/rsync/rsync-3.0.8/main.c(1148) [Receiver=3.0.8]

    at ChildProcess.<anonymous> (C:\Users\jeffa\Development\Hexo\deleteme\node_modules\hexo-deployer-rsync\node_modules\hexo-util\lib\spawn.js:42:17)
    at emitTwo (events.js:87:13)
    at ChildProcess.emit (events.js:172:7)
    at maybeClose (internal/child_process.js:818: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:469:12)

C:\Users\jeffa\Development\Hexo\deleteme>
deploy:
  type: rsync
  host: 192.168.1.222
  user: jeffa
  root: /home/jeffa/development/hexo/deleteme
  # root: /tmp
  # port: [port] # Default is 22
  # port: 22
  # delete: [true|false] # Default is true
  # args: <rsync args>
  # verbose: [true|false] # Default is true
  verbose: true
  # ignore_errors: [true|false] # Default is false

@eppfel
Copy link

eppfel commented Dec 16, 2015

Without specifying the port it did not work for me as well, no error, just no result. With it, like charm.

@gboudreau
Copy link

I submitted a PR (#17) that resolves this. Will use the default SSH port when no port is specified, and whatever you specify otherwise.
For anyone who wants to try it before it's merged and/or reaches the npm repo:

npm install git://github.com/gboudreau/hexo-deployer-rsync.git#patch-1 --save

Note: I also removed the port 22 default that was added recently, because that overrides the default port I defined in my ~/.ssh/config file, for the specified host. rsync will use port 22 if nothing is specified.

@Xuanwo
Copy link
Contributor

Xuanwo commented Jul 1, 2016

Closed for sloved, thx @gboudreau

@Xuanwo Xuanwo closed this as completed Jul 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants