Closed csandanov closed 7 years ago
use 127.0.0.1 instead of localhost, this should fix it
Didn't help
please provide more informations. Are you using docker for mac or something else.
I mean you plainly see the issue, localhost cannot be bound, either the port is already in use or something else happens while binding it. Its nothing special docker-sync does there.
You can enable the verbose mode, see configuration, to see what command is used to run the rsync bind and try it seperatly
It seems docker-sync expects rsync daemon to be running (because of rsync://), is that so? Didn't find any mention of this.
Ok, so it seems docker-sync starts rsync daemon via docker container. I use Docker for mac 1.12.3 and macOS Sierra 10.12.1. This is my output with a verbose mode:
$ docker-sync start
ok Starting rsync
ok myapp-sync container not running
ok starting myapp-sync container
command docker start myapp-sync
ok myapp-sync: starting initial sync of /project-path
command rsync -ap /project-path/ rsync://127.0.0.1:10872/volume
rsync: failed to connect to 127.0.0.1 (127.0.0.1): Connection refused (61)
rsync error: error in socket IO (code 10) at clientserver.c(125) [sender=3.1.2]
error Error starting sync, exit code 10
message
success Rsync server started
command rsync -ap /project-path/ rsync://127.0.0.1:10872/volume
rsync: failed to connect to 127.0.0.1 (127.0.0.1): Connection refused (61)
rsync error: error in socket IO (code 10) at clientserver.c(125) [sender=3.1.2]
error Error starting sync, exit code 10
message
ok Cli mode is auto, selecting ..
ok .. docker-sync
success Starting to watch /project-path - Press CTRL-C to stop
command fswatch -orIE --event AttributeModified --event Created --event Link --event MovedFrom --event MovedTo --event Renamed --event Removed --event Updated /project-path | xargs -I -n1 docker-sync sync -n myapp-sync --config='/project-path/docker-sync.yml'
I've updated rsync to 3.1.2 via brew, so the error is a bit different now.
I see via docker ps
that rsync container always exposes port 8000. I've changed 10872 to 8000 in docker-sync.yml and tried again, now I have errors with symlinks permissions:
rsync: failed to set permissions on "vendor/bin/drupal" (in volume): Not supported (95)
rsync: failed to set permissions on "vendor/bin/drush" (in volume): Not supported (95)
rsync: failed to set permissions on "vendor/bin/drush.complete.sh" (in volume): Not supported (95)
rsync: failed to set permissions on "vendor/bin/drush.launcher" (in volume): Not supported (95)
rsync: failed to set permissions on "vendor/bin/drush.php" (in volume): Not supported (95)
rsync: failed to set permissions on "vendor/bin/php-parse" (in volume): Not supported (95)
rsync: failed to set permissions on "vendor/bin/phpdoc-md" (in volume): Not supported (95)
rsync: failed to set permissions on "vendor/bin/phpunit" (in volume): Not supported (95)
rsync: failed to set permissions on "vendor/bin/psysh" (in volume): Not supported (95)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1249) [sender=3.1.2]
But I guess it's another issue not related to rsync. Is there a way to change rsync's public port?
Those are most probably symlinks to be binaries which are not part of you project but rather you system. Please use the issue search to find the various solutions for that. You probably want to try unison as a strategy since in becomes our new default.
Did you check the wiki already?there is a part for rsync upgrade, also check the boilerplate to ensure you basics are running and you issues are not project specific
I've fixed the permissions problem with the exclude option.
I based my docker-sync.yml on rsync boilerplate. The description of sync_host_port
option is:
# should be a unique port this sync instance uses on the host to offer the rsync service on
Ok, I will try unison but I think it still make sense to clarify about rsync port.
I am not sure what you mean. You can use any particular port you like - ones which are yet not used of course. You can use 8000, 64000 or 1337 - does not matter, as long no other process binds to that port. What do you think needs clarification on this regard?
I set sync_host_port
to 10872 (and it's free) in docker-sync.yml but the rsync container ignores it and always exposes port 8000.
please show this by pasting your docker-sync.yml and the output of the docker inspect sync-container
i cannot reproduce this
docker-sync.yml:
options:
verbose: true
syncs:
myapp-sync:
src: './'
dest: '/var/www/html'
sync_host_ip: 127.0.0.1
sync_host_port: 10872
$ docker inspect sync-container
[]
Error: No such image, container or task: sync-container
Had exactly the same issue while trying to switch from unison
to rsync
strategy (for test purposes) and it appeared to be my fault — I didn't stop/delete the old unison
based container. After stoping all the app containers (web, db, etc.) and doing:
docker-sync stop
docker-sync clean
I started a new rsync
-based one and everything worked perfectly fine.
Just wanted to leave it here for users coming from Google.
As a suggestion: probably it'd be better to check if there's a container based on a different strategy and if there is — output a friendly error/information message before even trying to use rsync
with the port which is not being listened.
I got the following error:
My docker-sync.yml: