EugenMayer / docker-sync

Run your application at full speed while syncing your code for development, finally empowering you to utilize docker for development under OSX/Windows/*Linux
GNU General Public License v3.0
3.54k stars 290 forks source link

sh: syntax error: unterminated quoted string leading to 500 internal server error #742

Closed Startouf closed 4 years ago

Startouf commented 4 years ago

Error/Feature Requestion/Docs

Hello, on a fresh install of docker-sync on a new macOS, I have the following error the first time (although it seems to start fine)

me@mymacbook dir % docker-sync start
          ok  Starting native_osx for sync hermes-code
doing initial sync with unison
sh: syntax error: unterminated quoted string
real    0m 0.07s
user    0m 0.05s
sys 0m 0.00s
chown ing file to uid 0
f984991539ef645ade438d416ed9cb46d2053f3ba5d747bf965d4983fd14a500
     success  Sync container started
     success  Starting Docker-Sync in the background

When I try making a docker-sync stop+start, it gives the following error

me@mymacbook dir % docker-sync stop
          ok  Stopping sync container hermes-code
me@mymacbook dir % docker-sync start
          ok  Starting native_osx for sync hermes-code
hermes-code
unison: stopped
error: <class 'xmlrpclib.ProtocolError'>, <ProtocolError for 127.0.0.1/RPC2: 500 Internal Server Error>: file: /usr/lib/python2.7/site-packages/supervisor/xmlrpc.py line: 519
Traceback (most recent call last):
    13: from /Users/cyrilduchon-doris/.gem/ruby/2.6.0/bin/docker-sync:23:in `<main>'
    12: from /Users/cyrilduchon-doris/.gem/ruby/2.6.0/bin/docker-sync:23:in `load'
    11: from /Users/cyrilduchon-doris/.gem/ruby/2.6.0/gems/docker-sync-0.5.14/bin/docker-sync:14:in `<top (required)>'
    10: from /Library/Ruby/Gems/2.6.0/gems/thor-0.20.3/lib/thor/base.rb:466:in `start'
     9: from /Library/Ruby/Gems/2.6.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
     8: from /Library/Ruby/Gems/2.6.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
     7: from /Library/Ruby/Gems/2.6.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
     6: from /Users/cyrilduchon-doris/.gem/ruby/2.6.0/gems/docker-sync-0.5.14/tasks/sync/sync.thor:47:in `start'
     5: from /Users/cyrilduchon-doris/.gem/ruby/2.6.0/gems/docker-sync-0.5.14/tasks/sync/sync.thor:170:in `daemonize'
     4: from /Users/cyrilduchon-doris/.gem/ruby/2.6.0/gems/docker-sync-0.5.14/lib/docker-sync/sync_manager.rb:102:in `start_container'
     3: from /Users/cyrilduchon-doris/.gem/ruby/2.6.0/gems/docker-sync-0.5.14/lib/docker-sync/sync_manager.rb:102:in `each'
     2: from /Users/cyrilduchon-doris/.gem/ruby/2.6.0/gems/docker-sync-0.5.14/lib/docker-sync/sync_manager.rb:103:in `block in start_container'
     1: from /Users/cyrilduchon-doris/.gem/ruby/2.6.0/gems/docker-sync-0.5.14/lib/docker-sync/sync_process.rb:105:in `start_container'
/Users/cyrilduchon-doris/.gem/ruby/2.6.0/gems/docker-sync-0.5.14/lib/docker-sync/sync_strategy/native_osx.rb:109:in `start_container': Start failed (RuntimeError)

When I reset my containers using

docker kill $(docker ps -q)
docker rm $(docker ps -a -q)
docker-sync stop

And I start again, I'm back to square one (error at the beginning with sh: syntax error

Docker Driver

Docker desktop for macOS 2.3.0.3 Tried on system ruby (2.6.0) and ruby 2.6.3 docker-sync (0.5.14)

Sync strategy

native_osx

your docker-sync.yml

version: 2
syncs:
  hermes-code:
    src: './'
    sync_strategy: 'native_osx'
    sync_excludes:
      - 'tmp'
      - '.git'
      - 'coverage'
      - .gitignore'
    watch_excludes:
      - '.*/.git'
      - '.gitignore'
      - 'log'
      - 'docker-*.yml'

OS

macOS Catalina 10.15.5 macbook pro 2019 16-inch

Not sure if it's important, but I am using zsh

Startouf commented 4 years ago

Shame on me, I did not realise the error hinted at a bad quoting in my docker-sync.yml file.

I would like to note, that even after fixing the problem, performing a docker-sync stop + start did NOT fix the issue.

I had to manually

docker kill $(docker ps -q)
docker rm $(docker ps -a -q)

to fix the problem

EDIT : aaah found a ref in the documentation for docker-sync clean I should have done that probably

EugenMayer commented 4 years ago

Great you could solve the issue @Startouf ! I guess we can close the issue here now?