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

docker-sync start failed - /tmp/supervisor.sock no such file #833

Open
digidycom opened this issue Feb 11, 2023 · 1 comment
Open

docker-sync start failed - /tmp/supervisor.sock no such file #833

digidycom opened this issue Feb 11, 2023 · 1 comment

Comments

@digidycom
Copy link

Problem

When I start docker-sync for the first time after I run docker, I got following error:

docker-sync start
          ok  Starting native_osx for sync my-project-sync
          ok  my-project-sync container not running
          ok  starting my-project-sync container
     command  docker start my-project-sync && docker exec my-project-sync supervisorctl restart unison
my-project-sync
unix:///tmp/supervisor.sock no such file
/Users/martin/.local/share/gem/ruby/2.6.0/gems/docker-sync-1.0.5/lib/docker-sync/sync_strategy/native_osx.rb:105:in `start_container': Start failed (RuntimeError)
	from /Users/martin/.local/share/gem/ruby/2.6.0/gems/docker-sync-1.0.5/lib/docker-sync/sync_process.rb:105:in `start_container'
	from /Users/martin/.local/share/gem/ruby/2.6.0/gems/docker-sync-1.0.5/lib/docker-sync/sync_manager.rb:103:in `block in start_container'
	from /Users/martin/.local/share/gem/ruby/2.6.0/gems/docker-sync-1.0.5/lib/docker-sync/sync_manager.rb:102:in `each'
	from /Users/martin/.local/share/gem/ruby/2.6.0/gems/docker-sync-1.0.5/lib/docker-sync/sync_manager.rb:102:in `start_container'
	from /Users/martin/.local/share/gem/ruby/2.6.0/gems/docker-sync-1.0.5/tasks/sync/sync.thor:181:in `daemonize'
	from /Users/martin/.local/share/gem/ruby/2.6.0/gems/docker-sync-1.0.5/tasks/sync/sync.thor:47:in `start'
	from /Users/martin/.local/share/gem/ruby/2.6.0/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'
	from /Users/martin/.local/share/gem/ruby/2.6.0/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
	from /Users/martin/.local/share/gem/ruby/2.6.0/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'
	from /Users/martin/.local/share/gem/ruby/2.6.0/gems/thor-1.2.1/lib/thor/base.rb:485:in `start'
	from /Users/martin/.local/share/gem/ruby/2.6.0/gems/docker-sync-1.0.5/bin/docker-sync:14:in `<top (required)>'
	from /usr/local/bin/docker-sync:23:in `load'
	from /usr/local/bin/docker-sync:23:in `<main>'

Problem explained

In https://github.com/EugenMayer/docker-sync/blob/main/lib/docker-sync/sync_strategy/native_osx.rb file is executed command docker start product-catalog-sync && docker exec product-catalog-sync supervisorctl restart unison. Because the first command in not fully completed inside docker, supervisor service is not running and execution of second command docker exec product-catalog-sync supervisorctl restart unison fails, afterwards docker-sync command fails. When I execute this commands separately via terminal with the same conditions (docker is freshly started and nothing is running inside docker), everything works ok.

Possible solution

Put some delay in between this two commands or create a routine to detect, that supervisor service is fully started.

Sync strategy

native_osx

your docker-sync.yml

version: "2"
options:
    verbose: true
    notify_terminal: false
syncs:
    my-project-sync:
        src: "../my-project"
        sync_args: ["-perms=0"]
        sync_excludes: [".ci", ".git", ".idea", "var/cache/dev", "var/cache/prod"]
        sync_userid: "$UID"
        sync_groupid: "$GID"
        monit_interval: 10
        monit_high_cpu_cycles: 6

OS

Monterey 12.6.3, docker-sync 1.0.5, docker 4.16.2, docker engine 20.10.22, docker file sharing implementation: gRPC FUSE

@EugenMayer
Copy link
Owner

A PR would be great. I would suggest to wait for the lock file to exist for X time (maybe check every 3s, 15 times) and then, if it still does not exist, bail out

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

No branches or pull requests

2 participants