bcpierce00 / unison

Unison file synchronizer
GNU General Public License v3.0
3.86k stars 224 forks source link

Both archives missing - unhelpful message? #1003

Closed raymondben closed 4 months ago

raymondben commented 4 months ago
Warning: inconsistent state.  
The archive file is missing on some hosts.
For safety, the remaining copies should be deleted.
  Archive ar7aab... on host [local] is MISSING
  Archive ara549... on host [remote] is MISSING
Please delete archive files as appropriate and try again
or invoke Unison with -ignorearchives flag.

Running again with -ignorearchives solves the problem, but maybe the message needs attention? If both archives are missing, what should be deleted?

This is the first run after both local and remote machines were upgraded/rebuilt: Ubuntu 22.04 (local) 18.04 (remote), unison version 2.53.3 (ocaml 4.14.1) on both local and remote machines (that's an updated version on both local and remote, compared to what was used on the last successful run pre-rebuild).

acolomb commented 4 months ago

Normally, both named files exist on both hosts. So to remove the "remaining" files, just do a rm ar7aab... ara549... in both instances' .unison directory.

raymondben commented 4 months ago

Ah, thanks @acolomb , that makes sense in terms of the message content at least.

There might still have been an issue though, because looking back at my terminal history I can't see that either of those files existed at either end. And now that the sync has completed successfully using the -ignorearchives flag, ar7aab... exists on local but not remote, and vice-versa for ara549.... But since it's now working happily (without the flag) I'll close the issue. Thanks.

tleedjarv commented 4 months ago

Normally, both named files exist on both hosts.

No, only one file per host.

I think this is related to the code for upgrading from 2.48/2.51 archives. Assuming you upgraded from 2.48/2.51, this is what may have happened:

  1. 2.53.3 does not find current archives on either host, so it goes looking for old archives that it could upgrade.
  2. An old archive is found on one of the hosts but not both.
  3. Finding the archive on one of the hosts causes the "inconsistent state" error message to be displayed.
  4. When constructing the error message, the upgradable archives are not taken into account, causing the cryptic error message.

I don't think it deserves a fix as the code is intended to be temporary anyway and may (no, will) soon go away, plus the only consequence is a cryptic error message in a rare one-time situation.

acolomb commented 4 months ago

Oh really? I was under the impression that the state of the other device is saved mutually as well. Did that change or is it just my memory failing? Sorry for the confusion in that case.

tleedjarv commented 4 months ago

I think it has always been the same, only the "local" archive stored on each host.