1

I have a file server running Raspbian and a workstation running Ubuntu MATE 16.04. I use Unison to keep my home directory in sync. I’ve set it up to use a SSH connection.

The workstation runs Unison 2.48; the server has multiple versions (including 2.48). I’ve successfully propagated a couple of changes from the workstation to the server that way.

Now I’ve changed a file on the server. Unison looks for changes and correctly suggests updating the local copy with the file from the server.

However, when I click Go, I get the following error:

Fatal error

Lost connection with the server.

Unison settings are as follows:

# Unison preferences
label = Home dir
root = /home/me
root = ssh://me@fileserver//srv/file/me
sshargs = -C
addversionno = true
dontchmod = true
perms = 0
path = Documents
path = Pictures

General configuration problems (missing Unison version on server, wrong path etc.) are unlikely as changes are being detected and I have synchronized data various times (always workstation to server). It’s just the server-to-workstation scenario that fails.

I decided to “sacrifice” my edits to the new file and chose to replace the server version with the outdated local one. Surprisingly, that sync run completed successfully—everything works unless there are changes on the server side.

What’s happening here?

2
  • 1
    I wonder if the problem could be with the underlying SSH connection. What do the following commands do? ssh me@fileserver head -c 100k /dev/urandom | wc -c and head -c 100k /dev/urandom | ssh me@fileserver wc -c Commented Jan 15, 2017 at 22:14
  • Both show 102400. That looks to me like the SSH connection isn’t the problem.
    – user149408
    Commented Jan 19, 2017 at 23:47

5 Answers 5

3

We also had this problem - we found a solution that worked for us, which was to install Unison on the other end - reference: https://ubuntuforums.org/showthread.php?t=1733811

2
  • That’s the setup I had all along. Unison is installed on both ends, and the two installations are communicating over an SSH link.
    – user149408
    Commented Dec 6, 2018 at 15:23
  • 1
    We suspect that your Fatal error is Unison failing on your server, due to the multiple versions, and because every action works except for propagating a changed file from the server; have you tried uninstalling all but the latest stable version of Unison, @user149408? Also, this question of yours is nearly two years old; are you still living with the problem? Commented Dec 7, 2018 at 18:53
1

I had the same issue but then with an vagrant environment and i already had installed unison on both side.

The fix was easy just vagrant halt and vagrant up fixed is for me

0

I think here is a solution:

NB- this is usually because the option PermitUserEnvironment in /etc/sshd_config is set to 'no' (for example, MacOSX ships with this set to NO). You should be able to set it to 'yes' and things will be golden. https://alliance.seas.upenn.edu/~bcpierce/wiki/?n=Main.UnisonFAQTroubleshooting

But only on my machine sshd_config is placed under /etc/ssh

1
  • The FAQ gives this as the reason for the connection failing completely. However, in my case the initial connection is successful—I can list changes, and even upload local changes—it is just pulling remote changes which fails. I’ll give it a try and report back.
    – user149408
    Commented Feb 20, 2017 at 15:21
0

I had the exact same problem (with Mint 18.2 KDE Edition). I appears that the version of Unison compiled for this version of Linux Mint is the problem. Using the Unison from Debian repository solved the problem.

I downloaded the package "unison-gtk_2.48.3-1_amd64.deb" from Debian packages repository, and install the new binary by hand (extracting the files at the correct places) and using Debian alternative to let the Mint Unison and the Debian Unison co-exist. There may be a smarter way to install a Debian package on Mint, but this was a fast proof-of-concept.

0

Generally, “lost connection with the server” indicates that either the remote Unison process OR ssh exited with an error. (Since Unison needs to be compatible with different SSH implementations, getting more granular information out of it would be very complex to implement.)

Current versions of Unison (since at least 2.52) should display all error messages from the server, also in the GUI. On versions that do not, run:

unison <profile> -ui text

This will launch the text UI and attempt sync. You should get some output like the following:

Contacting server...
(...)
Fatal error: Lost connection with the server

The lines between the first and the last one shown here are the output from the remote Unison process. They will give an indication of what went wrong.

In my case, as far as I remember, the remote Unison process crashed due to data corruption on the server disk.

You must log in to answer this question.

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