My name is Philipp C. Heckel and I write about nerdy things.

Unison & multiple hosts: “Warning: inconsistent state.”


Linux, Synchronization

Unison & multiple hosts: “Warning: inconsistent state.”


As some of you might know, Unison is this great tool that allows bidirectional synchronisation of two hosts, – no matter which operating system they’re running… Well, at least the well known ones are supported.

Since Unison can also be used to sychronise more than two hosts, it’s perfect for big amounts of data that has to be shared in a team.

A scenario like this is possible and works for me: UserA <-> Server <-> UserB.
But of course, also other users could sync with the server. Unison rocks!

Today, after reinstalling his OS, my friend got the following error message:

The easy solution

Unison keeps archive-files for each pair it synchronises with. One on each host, i.e. one on your local PC (UserA) and one on the server, both stored in a folder called ~/.unison and looking like the files above.

The easiest solution would be to just delete all archive-files on the server as unison suggests. But that would result in a situation where all the other users that sync their files with the server would have to do a slow sync which is extremely slow and sometimes takes more than 20 minutes for large folders (e.g. > 10 GB).

The best solution …

… is to just delete the required archive-files on the server. Pretty easy, that’s how it works:

Log on to the server (assuming that it’s a Linux machine, but it certainly works similar for any other system) and find the relevant archive files:

You should get something like this:

Delete the listed files and it should work like a charm.

3 Comments

  1. fojeda

    Great many thanks!! Got the same problem after fresh ubuntu install. Now it’s solved


  2. moritz

    still worked for me :) under mac os x the relevant archive files are located in: ~/Library/Application\ Support/Unison


  3. Dave

    Under Mac OS the relevant files are at ~/Library/Application\ Support/Unison __until__ one creates a ~/.unison directory. Then Unison prefers this new directory, but fails to look in the old directory. This just happened to me, colonizing a new planet. Once I had landed supplies, and ran my setup scripts to create unison scripts from this new host, I hit this error.