darcs

Issue 2439 failure upgrading darcs-1.0 repository

Title failure upgrading darcs-1.0 repository
Priority bug Status given-up
Milestone Resolved in
Superseder Nosy List Serware, gh, stevenj.mit
Assigned To gh
Topics Darcs2, Hashed, UI

Created on 2015-02-19.08:25:43 by stevenj.mit, last changed 2020-08-01.08:56:17 by bfrk.

Files
File name Uploaded Type Edit Remove
unnamed stevenj.mit, 2015-02-19.08:25:41 text/html
Messages
msg18168 (view) Author: stevenj.mit Date: 2015-02-19.08:25:41
I have a Darcs 1.0 repository, and am getting the following error when I try to upgrade it using darcs 2.8.1 on Debian GNU/Linux x86_64 or on MacOS 10.10.2 using darcs 2.8.4:

$ darcs optimize --upgrade
Checking repository in case of corruption...
WARNING: Doing a one-time conversion of pristine format.
This may take a while. The new format is backwards-compatible.
darcs: _darcs/hashed_inventory: openBinaryFile: does not exist (No such file or directory)

          Type: darcs
        Format: darcs-1.0
          Root: /home/stevenj/cvs/harminv
      Pristine: PlainPristine
         Cache: thisrepo:/home/stevenj/cvs/harminv, cache:/home/stevenj/.darcs/cache
        Author: stevenj@alum.mit.edu
   Num Patches: 130

Googling this error message turns up several other darcs bug issues that were previously reported, but all of them were supposedly fixed some time ago.  You can find a tarball of the repository at http://jdj.mit.edu/~stevenj/harminv.tgz <http://jdj.mit.edu/~stevenj/harminv.tgz> and my darcs exact-version on MacOS is listed below.

Thanks!

$ ../darcs --exact-version
darcs compiled on Jun 18 2013, at 14:11:37

Context:

[TAG 2.8.4
Ganesh Sittampalam <ganesh@earth.li>**20130127231845
 Ignore-this: d032f69540341ecfd5858fce7aee1457
] 

[Resolve issue2155: Expurgate the non-functional annotate --xml-output option
Dave Love <fx@gnu.org>**20130127231835
 Ignore-this: eb03207031e75687968091d56fb008f8
 backported from HEAD by Ganesh Sittampalam <ganesh@earth.li>
] 

[Resolve issue2155: Expurgate the non-functional annotate --xml-output option
Dave Love <fx@gnu.org>**20130120121739
 Ignore-this: 8a9ce6409a50b71cd0d2fdabbc181b1a
 backported from HEAD by Ganesh Sittampalam <ganesh@earth.li>
] 

[note dependency bumps in NEWS
Ganesh Sittampalam <ganesh@earth.li>**20130120170310
 Ignore-this: 48cf181c89ec1b69fc6e9e701734ff19
] 

[bump version to 2.8.4
Ganesh Sittampalam <ganesh@earth.li>**20130120154856
 Ignore-this: 2f2542e9825b66cda3a0a17275b5e311
] 

[resolve issue2199: getMatchingTag needs to commute for dirty tags
Ganesh Sittampalam <ganesh@earth.li>**20121218191024
 Ignore-this: 947252cd8e084b793044aff564f0462d
 backported from HEAD
] 

[accept issue2199: darcs get --tag gets too much
Ganesh Sittampalam <ganesh@earth.li>**20120528164525
 Ignore-this: 8c138a80c294e6181a3ef9250593fa31
] 

[constrain haskeline version on old GHC
Ganesh Sittampalam <ganesh@earth.li>**20130119234432
 Ignore-this: 8af00cc3d3c1ad223a8b35712c06bae
] 

[Add option -a to darcs changes in Setup.lhs
Ben Franksen <ben.franksen@online.de>**20120811195807
 Ignore-this: f23d2e558f7248fec8d07b0391d9a7e8
 
 Some (potential) contributors (like me) have 'changes interactive'
 in their ~/.darcs/defaults and then wonder why their build hangs.
] 

[add copyright notices for the imported haskeline code
Ganesh Sittampalam <ganesh@earth.li>**20130119163610
 Ignore-this: afcdc8048f8b3233fa17d3ab0c9c311f
 licence/copyright taken from haskeline 0.6.4.7:
 BSD3, copyright Judah Jacobson
] 

[import encoding code from haskeline: switch over
Ganesh Sittampalam <ganesh@earth.li>**20130118231907
 Ignore-this: b423a92ba93e74520d0578ac21aceab3
] 

[import encoding code from haskeline: source files
Ganesh Sittampalam <ganesh@earth.li>**20130118225947
 Ignore-this: c2d1e228fa4cce3e66e90a14fa2f3200
] 

[import encoding code from haskeline: cabal file changes
Ganesh Sittampalam <ganesh@earth.li>**20130118070642
 Ignore-this: d2ed13887d0c547cb7498bd5a2aef46f
] 

[import encoding code from haskeline: Setup.lhs changes
Ganesh Sittampalam <ganesh@earth.li>**20130115181040
 Ignore-this: 31ccdca76001bff769464fb7a8e574e9
] 

[ROLLBACK: conditionally use bytestring-handle
Ganesh Sittampalam <ganesh@earth.li>**20130111213829
 Ignore-this: d3c18b61f765bdfcb574b4977185197b
 It doesn't skip invalid byte sequences when decoding so breaks on 
 repositories with non-UTF8 encoded metadata.
] 

[bump network dependency
Ganesh Sittampalam <ganesh@earth.li>**20130111184607
 Ignore-this: 54e55fa09793008d55572b6acad1a7b8
] 

[add some comments about "nearby" darcs, and print out the one that was found
Ganesh Sittampalam <ganesh@earth.li>**20130111211817
 Ignore-this: 57385f3248fc539435ed9de069a40bd5
 backported from HEAD
] 

[make darcs-test look "nearby" for a darcs exe to use
Ganesh Sittampalam <ganesh@earth.li>**20130111211445
 Ignore-this: d952cf330c0d9510c5c973dd41b191e0
 backported from HEAD
] 

[need different path separator on Windows
Ganesh Sittampalam <ganesh@earth.li>**20121219191221
 Ignore-this: 42c7ba1e46f5b6b600d23838e5a162cb
] 

[test for issue2286: make sure we can read repos with non-UTF8 metadata
Ganesh Sittampalam <ganesh@earth.li>**20130102222735
 Ignore-this: adc6165d5d5d991383ebf0e6547f7bf4
] 

[We can use chcp to switch encodings on Windows
Ganesh Sittampalam <ganesh@earth.li>**20130101122254
 Ignore-this: bc115467e31e144694a33e43dca3fb6c
 This means that the tests that require different encodings can run.
] 

[Find latin9 locale on OS X too
Michael Hendricks <michael@ndrix.org>**20120420202408
 Ignore-this: c87db3b97312234ed2380d2ca11a8ca0
 
 Most Linux systems describe latin9 as "iso885915".  OS X
 describes it with "ISO8859-15".  The new regex catches both.
] 

[windows test fix: replace shell script with a Haskell program
Ganesh Sittampalam <ganesh@earth.li>**20121231224332
 Ignore-this: de01ab8647e7d62c18d8c266d514b054
] 

[unsetting DARCS_TEST_PREFS_DIR in utf8 test doesn't seem to be necessary
Ganesh Sittampalam <ganesh@earth.li>**20130101120246
 Ignore-this: ed74710d8b358b920d742e86a7f008d8
 
 It was causing problems on Windows because getAppUserDataDirectory
 still returns the normal user directory.
 
 It also means that the repository type choice isn't picked up.
] 

[improve diagnostics when utf8 test fails
Ganesh Sittampalam <ganesh@earth.li>**20121231224600
 Ignore-this: 63db587bc36f8826c66dc6913a4fdb2d
] 

[need to do case-insensitive comparison on Windows
Ganesh Sittampalam <ganesh@earth.li>**20121228214823
 Ignore-this: ef309d4aef22e87d5c3da3222926af0e
] 

[update NEWS
Ganesh Sittampalam <ganesh@earth.li>**20121216202654
 Ignore-this: aef3e47204a4157504f90554ffc3a327
] 

[conditionally use bytestring-handle instead of haskeline for encoding
Ganesh Sittampalam <ganesh@earth.li>**20121216201745
 Ignore-this: fd758796b689d090d01e003e660e405
 This is transitional because we need to support GHC 6.10: we can switch
 over to bytestring-handle unconditionally on HEAD.
] 

[bump deps for GHC 7.6/latest hackage
Ganesh Sittampalam <ganesh@earth.li>**20121216201543
 Ignore-this: 77829b074a4bff635a421879bdd04be0
] 

[conditionally support tar 0.4
Ganesh Sittampalam <ganesh@earth.li>**20121216201014
 Ignore-this: 8eff0330e6af196727bdd736ef31db25
] 

[recent test-framework seems to require Typeable
Ganesh Sittampalam <ganesh@earth.li>**20121216175601
 Ignore-this: a8cce6b69984bfc2335b5c19688950b3
] 

[stop using Prelude.catch
Ganesh Sittampalam <ganesh@earth.li>**20121216163240
 Ignore-this: b4bfc48775b3337f8f7ebe275be1a058
 
 backported from HEAD
] 

[import constructors of C types to deal with a GHC change
Ganesh Sittampalam <ganesh@earth.li>**20120401132500
 Ignore-this: ab7cf2fb5e9a2494c14fe7394200da9b
] 

[TAG 2.8.3
Ganesh Sittampalam <ganesh@earth.li>**20121104174910
 Ignore-this: 3198f6deecf3d1b44df6e05a2657d9ca
] 

Compiled with:

HTTP-4000.2.8
array-0.4.0.1
base-4.6.0.1
bytestring-0.10.0.2
containers-0.5.0.0
directory-1.2.0.1
extensible-exceptions-0.1.1.4
filepath-1.3.0.1
hashed-storage-0.5.10
haskeline-0.7.0.3
html-1.0.1.2
mmap-0.5.8
mtl-2.1.2
network-2.4.1.2
old-time-1.1.0.1
parsec-3.1.3
process-1.1.0.2
random-1.0.1.1
regex-compat-0.95.1
tar-0.4.0.1
terminfo-0.3.2.5
text-0.11.3.1
unix-2.6.0.1
utf8-string-0.3.7
vector-0.10.0.1
zlib-0.5.4.1
Attachments
msg18169 (view) Author: ganesh Date: 2015-02-19.18:39:06
The root cause is actually that your repository is invalid, but darcs is unhelpfully hiding this from 
you. With darcs 2.5, darcs check reports:

[ganesh@paxton:~/temp/harminv]$ ~/darcs/branch-2.5/dist/build/darcs/darcs check
Error! Duplicate patch name:
Sat May 15 07:14:20 CEST 2004  stevenj
  * copyright year updates

darcs failed:  Duplicate patches found.

Trying to "darcs get" it with a variety of darcs versions also fails in a variety of different ways.

I can try to recover a valid repository if that would help, but the result might be incompatible with 
other branches of the same repository. I'm also looking at improving the error message in this case.
msg18200 (view) Author: ganesh Date: 2015-02-21.13:02:13
Here's a repaired repo:

http://urchin.earth.li/~ganesh/temp/harminv-repaired.tgz

I think a couple of things had gone wrong: the inventory was somehow 
listing the same patch twice, and one of the patches had been 
recorded against the wrong baseline and was trying to change 2004 to 
2005 in the copyright line in harminv.1 when the previous value was 
actually 2000.

The repaired repository is also converted to hashed format, though 
it should be possible to make an old-fashioned one by pulling into a 
new repo with darcs-2.5 if you need that.
msg22343 (view) Author: bfrk Date: 2020-08-01.08:56:15
The old (pre-hashed) repo format can be easily corrupted which seems 
to be what has happened here.
History
Date User Action Args
2015-02-19 08:25:43stevenj.mitcreate
2015-02-19 18:39:08ganeshsetmessages: + msg18169
2015-02-21 13:02:15ganeshsetmessages: + msg18200
2016-01-09 00:56:14imzsetpriority: not-our-bug
topic: + Darcs2, UI, Hashed
nosy: + Serware
2017-07-31 02:10:01ghsetassignedto: gh
nosy: + gh
2020-08-01 08:56:17bfrksetpriority: not-our-bug -> bug
status: unknown -> given-up
messages: + msg22343