hnsl / unox

Unison OS X unison-fsmonitor adapter.
101 stars 12 forks source link

ValueError: need more than 2 values to unpack #2

Closed wamatt closed 9 years ago

wamatt commented 9 years ago

So I got unox installed with Unison 2.48.3

matt@mtbook:~/tmp% curl https://raw.githubusercontent.com/jumpstarter-io/unox/master/unox.py -o /usr/local/bin/unison-fsmonitor

Set perms: matt@mtbook:~/tmp% chmod a+x /usr/local/bin/unison-fsmonitor

Installed macfsevents

matt@mtbook:~/tmp%  pip3 install macfsevents
<snip>
Successfully installed macfsevents-0.4

However when I try test it out, using this command matt@mtbook:~/tmp% unison bla1/ bla2/ -repeat watch

It throws an exception:

matt@mtbook:~/tmp% unison bla1/ bla2/ -repeat watch
Contacting server...
Looking for changes
Traceback (most recent call last):
  File "/usr/local/bin/unison-fsmonitor", line 268, in <module>
    main()
  File "/usr/local/bin/unison-fsmonitor", line 224, in main
    [replica, fspath, path] = args
ValueError: need more than 2 values to unpack
Fatal error: File monitoring helper program not running

Am I doing something silly?

hnsl commented 9 years ago

I have only tested unox with my own configuration which has paths. Maybe your configuration doesn't have paths, and the START command doesn't supply that argument in that case. That's probably a bug in unox not following the protocol 100%.

This is how my config looks like:

# Sync roots
root = /Users/hannes/Documents/hostname
root = ssh://hostname//home/hannes

# Paths to sync
path = foo
path = bar
path = baz

# Paths to ignore.
ignore = Name build

# Auto sync non-conflicts.
auto = true
batch = true
repeat = watch
wamatt commented 9 years ago

Ahh ok. Yeah my preference file is just the default (basically empty). I wasn't really planning on using a pref file.

matt@mtbook:~/Library/Application Support/Unison% cat default.prf 
# Unison preferences file
matt@mtbook:~/Library/Application Support/Unison%

I'll try adding paths in and see if that works.

hnsl commented 9 years ago

@wamatt The problem should be fixed now in current master.

wamatt commented 9 years ago

Thanks @hannes-landeholm. New version works like a charm :+1:

On a side note, any idea why it warns about an unknown replica? Safe to ignore?

matt@mtbook:~/tmp% unison bla1/ bla2/ -repeat watch
Contacting server...
Looking for changes
[unox][WARN]: unknown replica: 38cf78cd0c8e30561bfa5395de89878c
Reconciling changes
hnsl commented 9 years ago

Yep, it's safe to ignore. For some reason unison attempts to reset observing a replica before it has started monitoring on it. This is probably a bug in unison but completely harmless.

wamatt commented 9 years ago

thanks!