hg repo corruption: ".hgsubstate is corrupt in revision ..."

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

hg repo corruption: ".hgsubstate is corrupt in revision ..."

apjanke-floss
Hi, Octave maintainers,

I'm having a bit of trouble with the GNU Octave Hg repo. I'm unable to
push copies of it to my private Bitbucket account.

When examining a freshly cloned repo with "hg verify", it reports
corruption in the .hgsubstate file. This is consistent - each time I
re-clone the repo, it still shows up as corrupt.

Have any of you encountered this?

Cheers,
Andrew

[~/tmp/octave-repo-test]
$ hg clone http://hg.savannah.gnu.org/hgweb/octave/
destination directory: octave
requesting all changes
adding changesets
adding manifests
adding file changes
added 25708 changesets with 170525 changes to 13875 files
new changesets 22412e3a4641:39fd627b2c5d
updating to bookmark @
cloning subrepo gnulib from http://hg.octave.org/gnulib
requesting all changes
adding changesets
adding manifests
adding file changes
added 19691 changesets with 127883 changes to 11419 files (+17 heads)
new changesets cb836a3f733e:a9f7397854f5
3210 files updated, 0 files merged, 0 files removed, 0 files unresolved
[~/tmp/octave-repo-test]
$ cd octave
[~/tmp/octave-repo-test/octave]
$ hg verify
checking changesets
checking manifests
crosschecking files in changesets and manifests
checking files
13729 files, 25708 changesets, 170525 total revisions
checking subrepo links
.hgsubstate is corrupt in revision ecf0c6bca0c9
.hgsubstate is corrupt in revision e0fb702a62a4
.hgsubstate is corrupt in revision 1398901839b6
.hgsubstate is corrupt in revision 5f0bb45e615c
.hgsubstate is corrupt in revision bb5790c5e713
.hgsubstate is corrupt in revision d584f90d2c47
.hgsubstate is corrupt in revision eb29a53834af
.hgsubstate is corrupt in revision e8ef57b7bd2a
.hgsubstate is corrupt in revision df86157a4912
.hgsubstate is corrupt in revision 12b60f3b1394
.hgsubstate is corrupt in revision 97cb9286919c
.hgsubstate is corrupt in revision c952f1e35e50
.hgsubstate is corrupt in revision 55f88d2236b6
.hgsubstate is corrupt in revision 572a707408b2
.hgsubstate is corrupt in revision 06bd3610f76e
.hgsubstate is corrupt in revision 43aa8d583b02
.hgsubstate is corrupt in revision 8e9f2cfa114d
.hgsubstate is corrupt in revision e8eca6031695
.hgsubstate is corrupt in revision 3fd857c284fe
.hgsubstate is corrupt in revision 56983afe80d5
.hgsubstate is corrupt in revision ef62fc21b2d9
.hgsubstate is corrupt in revision c2afeeb35f4d
.hgsubstate is corrupt in revision de3a318128f2
.hgsubstate is corrupt in revision 7c14e3e6fc6b
.hgsubstate is corrupt in revision b07e0cb83704
.hgsubstate is corrupt in revision 6c5b6c0ab528
.hgsubstate is corrupt in revision a132d206a36a
.hgsubstate is corrupt in revision acb7c0e6c317
.hgsubstate is corrupt in revision 017f0b2e6933
.hgsubstate is corrupt in revision 79baa37fde7a
.hgsubstate is corrupt in revision 181319fb0c8b
.hgsubstate is corrupt in revision e40ae983288f
.hgsubstate is corrupt in revision f7f1a2d4e9c8
15889: repository /Users/janke/tmp/octave-repo-test/octave/gnulib-hg not
found
15890: repository /Users/janke/tmp/octave-repo-test/octave/gnulib-hg not
found
15892: repository /Users/janke/tmp/octave-repo-test/octave/gnulib-hg not
found
15905: repository /Users/janke/tmp/octave-repo-test/octave/gnulib-hg not
found
16032: repository /Users/janke/tmp/octave-repo-test/octave/gnulib-hg not
found
16038: repository /Users/janke/tmp/octave-repo-test/octave/gnulib-hg not
found
16039: repository /Users/janke/tmp/octave-repo-test/octave/gnulib-hg not
found
16081: repository /Users/janke/tmp/octave-repo-test/octave/gnulib-hg not
found
16240: repository /Users/janke/tmp/octave-repo-test/octave/gnulib-hg not
found
16358: repository /Users/janke/tmp/octave-repo-test/octave/gnulib-hg not
found
17277: repository /Users/janke/tmp/octave-repo-test/octave/gnulib-hg not
found
17840: repository /Users/janke/tmp/octave-repo-test/octave/gnulib-hg not
found
19106: repository /Users/janke/tmp/octave-repo-test/octave/gnulib-hg not
found
19818: repository /Users/janke/tmp/octave-repo-test/octave/gnulib-hg not
found
21166: repository /Users/janke/tmp/octave-repo-test/octave/gnulib-hg not
found
21479: repository /Users/janke/tmp/octave-repo-test/octave/gnulib-hg not
found
21544: repository /Users/janke/tmp/octave-repo-test/octave/gnulib-hg not
found
21820: repository /Users/janke/tmp/octave-repo-test/octave/gnulib-hg not
found
21834: repository /Users/janke/tmp/octave-repo-test/octave/gnulib-hg not
found
[~/tmp/octave-repo-test/octave]
$ hg --version
Mercurial Distributed SCM (version 4.6.2)

Reply | Threaded
Open this post in threaded view
|

Re: hg repo corruption: ".hgsubstate is corrupt in revision ..."

Mike Miller-4
On Tue, Jul 31, 2018 at 15:23:11 -0400, Andrew Janke wrote:
> I'm having a bit of trouble with the GNU Octave Hg repo. I'm unable to push
> copies of it to my private Bitbucket account.
>
> When examining a freshly cloned repo with "hg verify", it reports corruption
> in the .hgsubstate file. This is consistent - each time I re-clone the repo,
> it still shows up as corrupt.
>
> Have any of you encountered this?

This looks like it has to do with the gnulib subrepo, which has changed
a few times over the hg history. I see the same errors with 'hg verify'.

You haven't shown the 'hg push' error, but it probably also has to do
with the subrepo. You might try using the subpaths rewrite configuration
to work around this. I used to have the following in my ~/.hgrc, before
we changed gnulib to an absolute URL.

    [subpaths]
    .*/gnulib-hg = http://www.octave.org/hg/octave/gnulib-hg

I would try the following configuration today, to override the
historical URLs of both 'gnulib' and 'gnulib-hg':

    [subpaths]
    .*/gnulib = http://hg.octave.org/gnulib
    .*/gnulib-hg = http://hg.octave.org/gnulib

--
mike

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: hg repo corruption: ".hgsubstate is corrupt in revision ..."

apjanke-floss


On 7/31/18 3:45 PM, Mike Miller wrote:

> On Tue, Jul 31, 2018 at 15:23:11 -0400, Andrew Janke wrote:
>> I'm having a bit of trouble with the GNU Octave Hg repo. I'm unable to push
>> copies of it to my private Bitbucket account.
>>
>> When examining a freshly cloned repo with "hg verify", it reports corruption
>> in the .hgsubstate file. This is consistent - each time I re-clone the repo,
>> it still shows up as corrupt.
>>
>> Have any of you encountered this?
>
> This looks like it has to do with the gnulib subrepo, which has changed
> a few times over the hg history. I see the same errors with 'hg verify'.
>
> You haven't shown the 'hg push' error, but it probably also has to do
> with the subrepo. You might try using the subpaths rewrite configuration
> to work around this. I used to have the following in my ~/.hgrc, before
> we changed gnulib to an absolute URL.
>
>      [subpaths]
>      .*/gnulib-hg = http://www.octave.org/hg/octave/gnulib-hg
>
> I would try the following configuration today, to override the
> historical URLs of both 'gnulib' and 'gnulib-hg':
>
>      [subpaths]
>      .*/gnulib = http://hg.octave.org/gnulib
>      .*/gnulib-hg = http://hg.octave.org/gnulib
>

Sorry I dropped this thread back when. I'm picking up this issue again
because I'd like to be able to use the DVCS features of Hg with Octave,
sharing my forked repo between multiple machines I work on, and sharing
public branches with y'all.

Here's the hg push failure. There are no useful diagnostics in it.

[octave] $ cat .hg/hgrc
[paths]
default = https://hg.savannah.gnu.org/hgweb/octave
bitbucket = ssh://[hidden email]/apjanke/octave-fresh-01
[octave] $ hg push bitbucket
pushing to ssh://[hidden email]/apjanke/octave-fresh-01
no changes made to subrepo gnulib since last push to
http://hg.octave.org/gnulib
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: transaction abort!
remote: rollback completed
remote: received spurious file revlog entry
abort: push failed on remote
[octave] $

`hg push --verbose` adds a lot more progress info, but the error message
is the same.

Adding the [subpaths] entry didn't do anything to change the error.

Anyone have any other ideas?

Cheers,
Andrew

Reply | Threaded
Open this post in threaded view
|

Re: hg repo corruption: ".hgsubstate is corrupt in revision ..."

Mike Miller-4
On Thu, Mar 28, 2019 at 01:15:09 -0400, Andrew Janke wrote:
> Sorry I dropped this thread back when. I'm picking up this issue again
> because I'd like to be able to use the DVCS features of Hg with Octave,
> sharing my forked repo between multiple machines I work on, and sharing
> public branches with y'all.

Sure.

I don't know how well versed you are in Hg, but one big difference with
Git is that branches are permanent, like SVN. Use bookmarks instead, the
effect is roughly similar to Git topic branches.

> Here's the hg push failure. There are no useful diagnostics in it.
>
> [octave] $ cat .hg/hgrc
> [paths]
> default = https://hg.savannah.gnu.org/hgweb/octave
> bitbucket = ssh://[hidden email]/apjanke/octave-fresh-01
> [octave] $ hg push bitbucket
> pushing to ssh://[hidden email]/apjanke/octave-fresh-01
> no changes made to subrepo gnulib since last push to
> http://hg.octave.org/gnulib
> searching for changes
> remote: adding changesets
> remote: adding manifests
> remote: adding file changes
> remote: transaction abort!
> remote: rollback completed
> remote: received spurious file revlog entry
> abort: push failed on remote

Ok, I tried the same thing with a fresh new repository on Bitbucket. I
get a slightly different error after it looks like it has pushed
manifests and files

    remote: Connection to bitbucket.org closed by remote host.
    abort: stream ended unexpectedly (got 0 bytes, expected 4)

So I tried bisecting, first once, then twice, and I finally got a
successful push by pushing the first ¼ of the revisions on the default
branch

    hg push -r d5d6a670f137 new

I kept pushing ¼ at a time and got the whole history pushed in 4 batches
of ~6500 changesets each, plus one more for stray side branches

    hg push --new-branch -r 2e4252228f73 new
    hg push --new-branch -r 6cfbf412a2c3 new
    hg push --new-branch -r @ new
    hg push --force -r "public()" new
    hg push -B @ new

If you try that, maybe you'll have better luck pushing the whole history
in batches. Maybe Bitbucket can't handle the size of our repository all
at once? Maybe it has a post-receive hook that is timing out on such a
huge number of changesets? I really don't know.

I have to say after a few years of using Hg on Bitbucket off and on,
it's really not pleasant. I've found quite a few rough edges. Enough to
make me not want to use it for collaboration again.

--
mike

Reply | Threaded
Open this post in threaded view
|

Re: hg repo corruption: ".hgsubstate is corrupt in revision ..."

apjanke-floss
On 3/28/19 3:15 AM, Mike Miller wrote:

 > I don't know how well versed you are in Hg, but one big difference with
 > Git is that branches are permanent, like SVN. Use bookmarks instead, the
 > effect is roughly similar to Git topic branches.

Did not know that. I'll read up on Hg bookmarks.

> So I tried bisecting, first once, then twice, and I finally got a
> successful push by pushing the first ¼ of the revisions on the default
> branch
>
>      hg push -r d5d6a670f137 new

Cool! What was the code you used to do the bisecting? I'm working on a
similar thing, and my solution in progress is rather ungainly.
https://github.com/apjanke/rebuild-octave-repo

> I kept pushing ¼ at a time and got the whole history pushed in 4 batches
> of ~6500 changesets each, plus one more for stray side branches
>
>      hg push --new-branch -r 2e4252228f73 new
>      hg push --new-branch -r 6cfbf412a2c3 new
>      hg push --new-branch -r @ new
>      hg push --force -r "public()" new
>      hg push -B @ new
 >
> If you try that, maybe you'll have better luck pushing the whole history
> in batches. Maybe Bitbucket can't handle the size of our repository all
> at once? Maybe it has a post-receive hook that is timing out on such a
> huge number of changesets? I really don't know.

Ha! It worked! Thank you!

> I have to say after a few years of using Hg on Bitbucket off and on,
> it's really not pleasant. I've found quite a few rough edges. Enough to
> make me not want to use it for collaboration again.

Are there any better options for Hg? I"m not up for hosting my own
publicly-visible repo.

Thanks for figuring out how to fix this for me! This will make my Octave
work easier.

Cheers,
Andrew

Reply | Threaded
Open this post in threaded view
|

Re: hg repo corruption: ".hgsubstate is corrupt in revision ..."

Mike Miller-4
On Thu, Mar 28, 2019 at 03:49:28 -0400, Andrew Janke wrote:
> Did not know that. I'll read up on Hg bookmarks.

Cool. I have plenty of other tips, for Git users and in general. Should
probably write those up somewhere.

> Cool! What was the code you used to do the bisecting? I'm working on a
> similar thing, and my solution in progress is rather ungainly.
> https://github.com/apjanke/rebuild-octave-repo

For this specifically, I first found the count of revisions from start
to the @ bookmark with

    $ hg log -r "::@" -T . | wc -c
    26302

Then I just divided by 4 and got the revision IDs with

    $ hg log -r "::@" -T "{node|short}\n" | sed -n '6575p; 13151p; 19726p;'
    d5d6a670f137
    2e4252228f73
    6cfbf412a2c3

By default "hg log -r <range>" lists oldest-first, so I pushed these in
order. I also used "hg log -r <rev>" to spot check and make sure they
were all on the default branch, but that may not matter.

> Are there any better options for Hg? I"m not up for hosting my own
> publicly-visible repo.

Unfortunately Bitbucket is the best that I know of. I do still use it
for hosting my own copies of Octave, a few Forge packages, Hg itself.

Bitbucket is fine for hosting your own personal repo. You should
definitely look into Hg Evolve, and maybe enable the

    [x] This is a non-publishing repository

setting on Bitbucket.

I'm just warning that I've hit a few pain points when doing true
distributed development on Bitbucket with forks, PRs, rebasing works in
progress, and so on. I should probably write these up somewhere too.

It's just a shame that Hg is as powerful as Git, but there aren't any
really compelling collaborative hosting platforms out there that come
close to GitLab or GitHub.

--
mike