jerrysu / gulp-rsync

Gulp plugin for deploying files via rsync
119 stars 51 forks source link

chown doesn't work #51

Open pyronaur opened 6 years ago

pyronaur commented 6 years ago

Got this error:

[14:47:09] gulp-rsync: zsh:1: no matches found: --usermap=*:www-data --groupmap=*:www-data
[14:47:09] gulp-rsync:  [14:47:09] gulp-rsync: rsync: connection unexpectedly closed (0 bytes received so far) [sender]
[14:47:09] gulp-rsync:  [14:47:09] gulp-rsync: rsync error: error in rsync protocol data stream (code 12) at io.c(226) [sender=3.1.2]

From: Mac OS X Sierra, rsync 3.1.2

To: Ubuntu 16.04, rsync 3.1.0

Tried config like this chown: 'www-data:www-data', and this: chown: '"www-data:www-data"',

I'm syncing as root, so I'm fairly certain I have permissions. No idea what do do about this.

d79 commented 6 years ago

That would probably be because, as said here, rsync needs the parameter -og to use --chown. I was able to make it work enabling the archive option. Maybe it would be better to add by default the parameter -og if chown is used (and probably -p for chmod).

nh2 commented 1 year ago

I found the answer, it's an rsync bug fixed in 3.2.4 or 3.2.5:

https://stackoverflow.com/questions/68588173/rsync-to-remote-location-exits-with-code-12/74791196#74791196

I would post this also on https://github.com/ansible/ansible/issues/64971 but unfortunately they use the software engineering anti-pattern of locking issues so they likely will never learn of the answer :disappointed_relieved:

gslin commented 1 year ago

Usually adding -s can solve this issue, from rsync manpage:

If you specify "--chown=foo:bar", this is exactly the same as specifying "--usermap=:foo --groupmap=:bar", only easier. If your shell complains about the wildcards, use --protect-args (-s).