2

I have two computers one running Ubuntu 19.04 and another running Ubuntu 20.04. I synchronize them both with a server at my workplace running CentOS 7.7.1908 using unison. My Ubuntu 19.04 machine is running Unison 2.48.4. My Ubuntu 20.04 machine is running 2.48.4. The server at work is running Unison 2.48.15.

The Ubuntu 19.04 machine synchronizes with server with no problem. Before I had upgraded to 20.04 that machine running 19.10 synchronized with the server fine. Now in Ubuntu 20.04 it can successfully scan the files but the moment I try to synchronize with "Go" it crashes with error

Unison failed: Uncaught exception Failure("input_value: ill-formed message")

Raised at file "/opt/unison-2.48.15v4/src/lwt/lwt.ml", line 135, characters 6-13

Called from file "list.ml", line 85, characters 12-15

Called from file "/opt/unison-2.48.15v4/src/lwt/lwt.ml", line 31, characters 2-37

Called from file "/opt/unison-2.48.15v4/src/lwt/lwt.ml" (inlined), line 83, characters 17-46

Called from file "/opt/unison-2.48.15v4/src/lwt/generic/lwt_unix_impl.ml", line 55, characters 6-23

Called from file "/opt/unison-2.48.15v4/src/lwt/generic/lwt_unix_impl.ml", line 147, characters 6-40

Called from file "/opt/unison-2.48.15v4/src/main.ml", line 202, characters 6-24

Called from file "/opt/unison-2.48.15v4/src/main.ml", line 131, characters 4-9

I thought this might be a similar issue to John Clements' post but I built an entirely new unison profile to synchronize a new directory containing a single empty text file. I assume that this means there were no previous relevant archives to cause the problem as John deduced. I have also run unison with the -ignorearchives directive and I get the same error.

Community
  • 1
  • 1

2 Answers2

1

This would be more a comment than an answer, but I am not allowed to comment yet, so I'll post it like an answer:

Have you tried this answer?

https://unix.stackexchange.com/questions/583058/unison-and-version-compiler-conflicts/583377#583377

It really solved my long standing problems because of the incompatibility among different versions of Unison, or even the very same version being built with different versions of OCaml.

Snapd is installed in Ubuntu by default, but I think you need to install it in CentOS first. According to this

https://snapcraft.io/docs/installing-snap-on-centos

You have to issue these commands in a terminal

sudo yum install snapd
sudo systemctl enable --now snapd.socket

and then proceed like in the answer quoted above.

EDIT: If you don't have access to one of the machines, the Unisons you install are not guaranteed to be compatible. In this case you can try different snap "channels". For Unison, see:

https://snapcraft.io/unison-jz

On the top-right corner you can find the different versions.

You can also issue:

snap info unison-jz

In your case it would be the beta, so

sudo snap install --channel=beta --devmode unison-jz

Since the server does not have unison-jz installed, DO NOT add the "servercmd" line to your unison profile.

If this version of unison-jz is not compatible with the one in your CentOS machine, I'm afraid you'll have to compile from source like here.

How to use unison across OS X and linux? Fatal error due to ocaml version

zasjls
  • 46
  • 3
  • I do not have root privileges on the CentOS machine. But I do on my Ubuntu machines. Do you think I can find a snap to install on my Ubuntu machines that matches the both the Unison and OCaml versions from the CentOS machine? How can I find the version of OCaml that the CentOS' unison was compiled with? – brett stevens May 22 '20 at 18:14
  • Stable verions of snaps update themselves once installed. Most recent is 2.51.2. Sometimes beta or edge versions are kept. In this case there is a beta that could suit your needs. I'm editing the answer above to complete this – zasjls May 23 '20 at 08:03
  • As for figuring out the version of OCaml that Unison was compiled with, recent versions of Unison show it at the bottom of their window when you open it, but older ones don't. I'm not aware of an easy way to tell. If your Unison comes from the distribution repos, usually has been compiled with OCaml's version in those repos, but not always... – zasjls May 23 '20 at 08:28
  • OK, I have installed unison-jz via snap on the two machines I am root on as a test. But now I get the error > [remote] Shell connection: ssh (ssh, -l, user, server, -e, none, -C, /snap/bin/unison-jz.unison, -ui, text, -server) > Some error in create_session child > [remote_emit+] grab: EOF > Lost connection with the server – brett stevens May 26 '20 at 19:23
1

You can manually install the same version on both hosts:

# remove the current version
sudo apt purge unison

# for the command line version:
wget http://ftp.fr.debian.org/debian/pool/main/u/unison/unison_2.48.4-1+b1_amd64.deb
sudo dpkg -i unison_2.48.4-1+b1_amd64.deb

# for the gui version:
wget http://ftp.fr.debian.org/debian/pool/main/u/unison/unison-gtk_2.48.4-1+b1_amd64.deb
sudo dpkg -i unison-gtk_2.48.4-1+b1_amd64.deb

# make sure the current version is not updated
sudo apt install aptitude
sudo aptitude hold unison

Make sure to delete all fp* files from ~/.unison

I took this from: https://askubuntu.com/a/1235089/917854

I am using this with a Kubuntu 20.04 client and a Ubuntu 18.04 server (both using the command line version). I had the same problem before.

Bug tracker: https://bugs.launchpad.net/ubuntu/+source/unison/+bug/1875475

  • I am not root on the CentOS server at work, but I was able to find a .deb at that site that worked with the version on the server (I think that means it was compiled with same version of OCaml) so I have installed that on both my machines and am back in synchronization! Thanks. – brett stevens May 27 '20 at 20:35
  • I recoemend preventing unison from being updated: `echo "unison-gtk hold" | dpkg --set-selections` – brett stevens May 29 '20 at 13:41
  • thanks a lot, that did the trick (on linux mint 19.3 vs linux mint 20) – farvardin Aug 31 '20 at 12:23