Closed Bug 1853693 Opened 2 years ago Closed 1 year ago

hg source code clone error "stream ended unexpectedly" every time

Categories

(Developer Services :: Mercurial: hg.mozilla.org, defect)

defect

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: dan, Unassigned)

Details

Steps to reproduce:

hg clone https://hg.mozilla.org/mozilla-central source/

Actual results:

abort: stream ended unexpectedly (got 3706 bytes, expected 32768)

Expected results:

source code should have downloaded

I have tried varying:

  • OS - Debian 11/12, Ubuntu 22.04, Gentoo
  • hg version 6.x, most recent being 6.3.2
  • networks, including from a fast datacentre

Same result every time. I notice this stackexchange thread on the same topic: https://stackoverflow.com/questions/74776818/error-while-cloning-thunderbirds-mercurial-repository , and other reports of identical behaviour.

It would be interesting to know if anyone, anywhere has been able to do a fresh clone of the source in relatively recent times.

The Bugbug bot thinks this bug should belong to the 'DevTools::Debugger' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Debugger
Product: Firefox → DevTools
Component: Debugger → Untriaged
Product: DevTools → Firefox

I meant to post in the full output:

applying clone bundle from https://hg.cdn.mozilla.net/mozilla-central/00a58b9e2816bf27636b2173104f7981e429adc9.zstd-max.hg
adding changesets
adding manifests                                                                                                                                  
adding file changes                                                                                                                               
transaction abort!                                                                                                                                
rollback completed
abort: stream ended unexpectedly  (got 3706 bytes, expected 32768)

The number 3706 varies.

(In reply to Robert Longson [:longsonr] from comment #3)

Have you tried downloading a bundle instead? https://firefox-source-docs.mozilla.org/contributing/vcs/mercurial_bundles.html

Yes, it worked thanks, and I can hg update.

That does not address the original problem, although it does get me going for now. What other network condition could I change to make hg clone work?

Within the mozilla-central checkout I was able to do hg clone https://hg.mozilla.org/comm-central comm/ successfully. Which suggests it has to do with size.

Moving this to Developer Services > Mercurial: hg.mozilla.org component to allow our engineers to examine it more closely. If this is not the right component, please move it to a more appropriate one. Thanks!

Component: Untriaged → Mercurial: hg.mozilla.org
Product: Firefox → Developer Services
Version: Firefox 117 → unspecified

This is reproducible in every environment I have tried, and I have anecdotal evidence of others having the same problem, so I went looking for git trees since at least for me hg fails in all cases. I discovered that the maintainer of the git mirror of mozilla-central has retired, but Firefox engineering maintain the gecko-dev mirror and it is synched several times a day.

The following git equivalent to hg works every time for me:

git clone https://github.com/mozilla/gecko-dev
cd gecko-dev/
git clone https://github.com/mozilla/releases-comm-central
mv releases-comm-central/ comm
echo 'ac_add_options --enable-project=comm/mail' > mozconfig
./mach build
./mach run

(In reply to Dan Shearer from comment #8)

The following git equivalent to hg works every time for me:

[...]

This doesn't solve my problem btw, because presumably once I have fixed the bug that is annoying me I will need hg to contribute my fix. But at least I can now use the code.

I'm able to clone the repo myself. Try using the latest version of Mercurial. You can also try adding --stream to the command, like hg clone --stream https://hg.mozilla.org/mozilla-central, and seeing if that works.

Usually when this problem is encountered it is due to unstable internet connection. If you're able to follow the Mercurial bundles procedure from comment 3, you shouldn't need to clone the source. Downloading and unpacking a bundle is a replacement for running hg clone and is the usual workaround we suggest when having network problems cloning directly. You can pull in the latest changes after setting up the bundle with hg pull.

(In reply to Dan Shearer from comment #9)

This doesn't solve my problem btw, because presumably once I have fixed the bug that is annoying me I will need hg to contribute my fix. But at least I can now use the code.

If you prefer Git we support it for contributions as well. I'm not entirely sure about using it for Thunderbird.

Status: UNCONFIRMED → RESOLVED
Closed: 1 year ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.