Page MenuHomePhabricator

Trying to download some extensions results in HTTP 404 Not Found
Closed, ResolvedPublic

Description

Steps to reproduce

  1. Go to Special:ExtensionDistributor/CirrusSearch
  2. Select any version of MediaWiki (1.34 for example) and click the continue button
  3. Yo get a page with instructions.

Problem: After 5 seconds, or clicking the download link, results in a HTTP 404 error page (from nginx).

This happens no matter what MediaWiki version is selected. However, other extensions seems to work fine (for example, Extension:Cite)

Known extensions that are failing:
CirrusSearch
VisualEditor
Echo

Event Timeline

Bugreporter subscribed.

Actually the file is at https://extdist.wmflabs.org/dist/extensions/CirrusSearch-REL1_34-a86e0a5d.tar.gz but the extension redirects to CirrusSearch-REL1_34-a86e0a5.tar.gz

Further digging:

bugreporter@tools-sgebastion-07:~/mediawiki-extensions-CirrusSearch$ git checkout origin/REL1_34
Note: checking out 'origin/REL1_34'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

HEAD is now at **a86e0a5d**... Merge "Drop HHVM support" into REL1_34

Actually git returns eight-digit hash in this repository.

Per https://github.com/git/git/blob/99c33bed562b41de6ce9bd3fd561303d39645048/Documentation/config/core.txt:

core.abbrev::
	Set the length object names are abbreviated to.  If
	unspecified or set to "auto", an appropriate value is
	computed **based on the approximate number of packed objects**
	in your repository, which hopefully is enough for
	abbreviated object names to stay unique for some time.
	The minimum length is 4.

(see also https://github.com/git/git/blob/b744c3af07a15aaeb1b82fab689995fd5528f120/sha1-name.c)

	if (len < 0) {
		unsigned long count = repo_approximate_object_count(r);
		/*
		 * Add one because the MSB only tells us the highest bit set,
		 * not including the value of all the _other_ bits (so "15"
		 * is only one off of 2^4, but the MSB is the 3rd bit.
		 */
		len = msb(count) + 1;
		/*
		 * We now know we have on the order of 2^len objects, which
		 * expects a collision at 2^(len/2). But we also care about hex
		 * chars, not bits, and there are 4 bits per hex. So all
		 * together we need to divide by 2 and round up.
		 */
		len = DIV_ROUND_UP(len, 2);
		/*
		 * For very small repos, we stick with our regular fallback.
		 */
		if (len < FALLBACK_DEFAULT_ABBREV)
			len = FALLBACK_DEFAULT_ABBREV;
	}

The fix:

https://gerrit.wikimedia.org/r/plugins/gitiles/labs/tools/extdist/+/master/nightly.py#176

Replace '--short' with '--short=7'

Change 561088 had a related patch set uploaded (by Gerrit Patch Uploader; owner: Gerrit Patch Uploader):
[labs/tools/extdist@master] Use a constant length of short hash

https://gerrit.wikimedia.org/r/561088

Reedy renamed this task from Trying to download Extension:CirrusSearch resutls in HTTP 404 Not Found to Trying to download Extension:CirrusSearch results in HTTP 404 Not Found.Dec 29 2019, 8:52 PM
DannyS712 renamed this task from Trying to download Extension:CirrusSearch results in HTTP 404 Not Found to Trying to download some extensions results in HTTP 404 Not Found.Dec 30 2019, 3:53 AM
DannyS712 updated the task description. (Show Details)
DannyS712 added a subscriber: Elserolf.
DannyS712 subscribed.

Change 561088 merged by jenkins-bot:
[labs/tools/extdist@master] Use a constant length of short hash

https://gerrit.wikimedia.org/r/561088

Mentioned in SAL (#wikimedia-cloud) [2019-12-31T03:20:05Z] <legoktm> running /usr/bin/python3 /srv/extdist/nightly.py --all in screen on extdist-04 to rebuild tarballs for T241542

Reedy assigned this task to Bugreporter.
Reedy removed a project: Patch-For-Review.