6

I have installed unison 2.48.4 on three machines, two running Linux Mint 17 and one Linux Mint 18. I sync via SSH.

The two 17's sync with no problem. However the 18 cannot sync with either of the other two. The list of potential transfers is generated but when I press "GO" I get the following:

Fatal error: Server: Fatal error during unmarshaling (input 
  value: bad bigarray kind), possibly because client and server 
  have been compiled with different versions of the Ocaml compiler.

I get the same message when I use the graphical or the command-line version of unison client. Also when I try unison 2.48.3 on the client side, which makes me believe it is the difference in the mint version (17 vs 18) which creates the problem.

I haven't compiled anything myself, just installed from the repos or downloaded deb packages.

3 Answers 3

3

The Unison protocol is version-specific. Version N can't talk to version M with M ≠ N.

Debian (and derivatives: Ubuntu, Mint, …) provides a unison-all package which despite the name contains some recent-but-not-latest versions of Unison, not all past versions. I haven't checked but I'd expect unison-all on Mint 18 to contain the version that's on Mint 17.

Alternatively, you can install all the versions of Unison that you use anywhere by copying them to /usr/local/bin or ~/bin in the machine that you use as your Unison hub. The unison-NN.NN binary only depends on the standard library so it works on any 21th century non-embedded Linux without having to install anything extra. That's what I do. You do need to remember to update this binary when a bug fix comes out.

Unless you arrange to run the same version of Unison everywhere, you'll need to tell it to invoke the matching version on the remote side by putting addversionno = true in your profile(s).

1
  • I tried unison-all but didn't work. The second idea is very good, I will keep in mind for a more permanent solution. For now I did something along the same lines. Thanks! Commented Sep 14, 2016 at 18:32
1

Yeah, I've seen this error before. In addition to having the same versions of Unison running, those Unison binaries also (sometimes) have to have been compiled with the same version of OCaml. Also there is some other error I've seen when Unison is compiled with OCaml version >4, but I don't recall the specifics of that.

So your options are either:

  1. Do as Gilles says and copy the binaries from one machine to the others.

  2. Download, compile, and install the correct version of OCaml (I've had to use 3.12.1), and use that to compile and install Unison from source.

1
  • 1
    Thanks a lot! I did something similar to 1, downloaded and installed the same .deb on all computers and it worked. The version I had installed from software sources on Mint 17 said 2.48.4 but apparently it was not the same as that in the .deb file. Commented Sep 14, 2016 at 15:54
0

In order to use Unison across a network, both ends need to run the same version built with the same version of the OCaml compiler. This is probably what is causing your issues, as it typically results in the message you are seeing. Most likely, each Unison binary was built with the OCaml version which is available in the distro’s repositories.

More recent Unison versions (starting with 2.40) are available as binary downloads from the project itself. Starting with 2.51.3, they even offer builds with different OCaml versions. Grab the one you want and deploy it to both of your machines, which ensures you are running the same on both ends.

Or you can downgrade the Mint 18 machine to the Unison package that shipped with Mint 17—grab the .deb for Mint 17 from the repositories and install it with dpkg. (Did a similar trick on Ubuntu; it should work on most distros as Unison has no dependencies other than libc.)

In order to prevent the updater from undoing your changes on its next run, put the package on hold:

sudo apt-mark hold unison-gtk

(If you decide to upgrade in the future, re-running this command with unhold will undo this, allowing the package to be upgraded again.)

You may have to delete your Unison cache—~/.unison/ar* and ~/.unison/fp*—on both ends.

On the long run, the team are working on getting rid of the OCaml version dependency (as I understand issue #375, the dev is just waiting for the next release to merge his changes). We might get to enjoy this as soon as version 2.52 or 2.53. They also have plans to introduce interoperability between different Unison versions, as long as the wire protocol remains unchanged (#407), but that might take a little longer.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .