Page MenuHomePhabricator

Shallow clones fail with errors: git clone --depth 1 fails with error: RPC failed; result=22, HTTP code = 500
Closed, ResolvedPublic

Description

$ git clone --depth 1 https://gerrit.wikimedia.org/r/p/mediawiki/core.git

fails with error:

RPC failed; result=22, HTTP code = 500

Related bugs and mailing list posts:

Tested (not working) with git versions 1.7.1, 1.7.9.2, 1.7.9.6.

If the --depth option really crashes the git server, then sending this command could be possibly used for a DoS attack -> That's why I set severity to major.

Should your server's memory size be increased ?


Version: unspecified
Severity: major

Details

Reference
bz35949

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 12:17 AM
bzimport added projects: Gerrit, Upstream.
bzimport set Reference to bz35949.
bzimport added a subscriber: Unknown Object (MLST).

If this is indeed issue 769, I suspect it will be fixed by the 2.3 upgrade (since they upgraded JGit to 1.1).

We can test again then.

And for the record, it doesn't *crash* gerrit. It hits an exception that's logged and it fails for the user, but it doesn't *crash*

(In reply to comment #2)

And for the record, it doesn't *crash* gerrit. It hits an exception that's
logged and it fails for the user, but it doesn't *crash*

Thanks for investigating this in the logs, and for reporting!

Works for me with the 2.3 upgrade:

$ git clone --depth 1 https://gerrit.wikimedia.org/r/p/mediawiki/core.git test-shallow-clone
Cloning into 'test-shallow-clone'...
remote: Counting objects: 31773, done
remote: Finding sources: 100% (31773/31773)
remote: Total 31773 (delta 12783), reused 16435 (delta 12783)
Receiving objects: 100% (31773/31773), 291.11 MiB | 1.82 MiB/s, done.
Resolving deltas: 100% (12783/12783), done.

Marking FIXED.

Hmmmm, strange is my following observation (each clone into a fresh directory):

git clone ssh://<username>@gerrit.wikimedia.org:29418/mediawiki/core.git
du -h .

> 178 MB

git clone --depth 1 ssh://<username>@gerrit.wikimedia.org:29418/mediawiki/core.git
du -h .

> 360 MB [sic]

> Shallow clone needs 360 MB ??? I am puzzled.

some more examples, where shallow clones are smaller:

git clone git://gitorious.org/owncloud/owncloud.git ==> 39M

git clone --depth 1 git://gitorious.org/owncloud/owncloud.git ==> 34M

git clone https://github.com/Pita/etherpad-lite.git ==> 4,8M

git clone --depth 1 https://github.com/Pita/etherpad-lite.git ==> 2,6M