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:
1 2 3 4 5 6 |
Warning: inconsistent state. The archive file is missing on some hosts. For safety, the remaining copies should be deleted. Archive are96968da50882488164ef52510703a8e on host <UserAs-local-hostname> is MISSING Archive ar664775fc717afcf6cc46edbc47d25641 on ... |
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:
1 2 3 |
ssh mysyncuser@mysyncserver.com cd ~/.unison fgrep '//UserAs-local-hostname/' ar* |
You should get something like this:
1 |
Binary file ar664775fc717afcf6cc46edbc47d25641 matches |
Delete the listed files and it should work like a charm.
Great many thanks!! Got the same problem after fresh ubuntu install. Now it’s solved
still worked for me :) under mac os x the relevant archive files are located in: ~/Library/Application\ Support/Unison
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.