Closed Bug 1615136 Opened 4 years ago Closed 4 years ago

Firefox Nightly does not update with certain distribution.ini values

Categories

(Toolkit :: Application Update, defect)

75 Branch
defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla75
Tracking Status
firefox-esr68 --- wontfix
firefox73 --- wontfix
firefox74 --- wontfix
firefox75 --- verified

People

(Reporter: carm_carm, Assigned: bytesized)

Details

(Keywords: regression)

Attachments

(2 files)

Attached file distribution.ini

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0

Steps to reproduce:

Install a Firefox nightly from an offline installer that is several days old. DO NOT launch it. Create a distribution.ini file in the correct directory with any values. IN the GLOBAL section leave the id, version and about blank. i.e (included attachment )
[Global]
id=
version=
about=

Launch Firefox Nightly in a new profile.
Go to settings - help - about nightly and try to update. it show as up to date despite being several days old.

Now add something, anything in those values like so:
[Global]
id=Custon-Build
version=0
about=customized for privacy

I have been using the values being blank for about a year, then November/December 2019 Firefox would not update anymore. I tried literally commenting out every other setting until I got to global. Leaving globals' blank causes it to fail update every time

The same setting in release are unaffected and works just fine

Actual results:

Firefox Nightly showed up to date despite having a build date of several days old

Expected results:

Firefox should have found a new build and updated.

Issue has not moved to release 73.0.1 on today's date

Issue HAS moved to release 73.0.1 on today's date - NO way to edit additions/comments

Component: Untriaged → General

Moving to the right bugzilla component, and also ask for a regression range (as it seems based on comment 0 that this may have regressed around Nov/Dec 2019).

Component: General → Application Update
Product: Firefox → Toolkit

I'm taking a look at a Nightly build from long before the problem is said to have started (A 2019-01-01 build, version 66.0a1, downloaded here). And I can definitely see the cause.

This is the update URL format. The last two variables being substituted are read from distribution.ini.
https://aus5.mozilla.org/update/6/%PRODUCT%/%VERSION%/%BUILD_ID%/%BUILD_TARGET%/%LOCALE%/%CHANNEL%/%OS_VERSION%/%SYSTEM_CAPABILITIES%/%DISTRIBUTION%/%DISTRIBUTION_VERSION%/update.xml
This is the update URL I get with no distribution.ini file at all:
https://aus5.mozilla.org/update/6/Firefox/66.0a1/20190101094742/WINNT_x86_64-msvc-x64/en-US/nightly/Windows_NT%2010.0.0.0.18362.657%20(x64)/ISET:SSE4_2,MEM:16192/default/default/update.xml (Link)
And this is the one I get with a distribution.ini with blank Global.id, Global.version, and Global.about values:
https://aus5.mozilla.org/update/6/Firefox/66.0a1/20190101094742/WINNT_x86_64-msvc-x64/en-US/nightly/Windows_NT%2010.0.0.0.18362.657%20(x64)/ISET:SSE4_2,MEM:16192///update.xml (Link)

If you click on the link for each of these update XMLs, you will see that the first URL results in an XML describing an update, while the second URL results in an XML indicating that there are no updates. Since I can reproduce this prior to the stated introduction of the bug, I'm suspicious that this might be the result of a change to the update backend (Balrog). Perhaps it used to handle that second URL nicely but it doesn't any longer?

@bhearsum Do you know if that is a possible explanation for the reported change in behavior?

Flags: needinfo?(bhearsum)

(In reply to Kirk Steuber (he/him) [:bytesized] from comment #4)

I'm taking a look at a Nightly build from long before the problem is said to have started (A 2019-01-01 build, version 66.0a1, downloaded here). And I can definitely see the cause.

This is the update URL format. The last two variables being substituted are read from distribution.ini.
https://aus5.mozilla.org/update/6/%PRODUCT%/%VERSION%/%BUILD_ID%/%BUILD_TARGET%/%LOCALE%/%CHANNEL%/%OS_VERSION%/%SYSTEM_CAPABILITIES%/%DISTRIBUTION%/%DISTRIBUTION_VERSION%/update.xml
This is the update URL I get with no distribution.ini file at all:
https://aus5.mozilla.org/update/6/Firefox/66.0a1/20190101094742/WINNT_x86_64-msvc-x64/en-US/nightly/Windows_NT%2010.0.0.0.18362.657%20(x64)/ISET:SSE4_2,MEM:16192/default/default/update.xml (Link)
And this is the one I get with a distribution.ini with blank Global.id, Global.version, and Global.about values:
https://aus5.mozilla.org/update/6/Firefox/66.0a1/20190101094742/WINNT_x86_64-msvc-x64/en-US/nightly/Windows_NT%2010.0.0.0.18362.657%20(x64)/ISET:SSE4_2,MEM:16192///update.xml (Link)

If you click on the link for each of these update XMLs, you will see that the first URL results in an XML describing an update, while the second URL results in an XML indicating that there are no updates. Since I can reproduce this prior to the stated introduction of the bug, I'm suspicious that this might be the result of a change to the update backend (Balrog). Perhaps it used to handle that second URL nicely but it doesn't any longer?

@bhearsum Do you know if that is a possible explanation for the reported change in behavior?

As far as I know, Balrog has never support a section of an URL being entirely empty like that, and it certainly wasn't ever the intent to. I tried this with an older version of Balrog locally (code from June 2019), and this behaviour still exists at that point. I don't see anything on the Balrog side that would've caused this.

Adding mkaply, because he knows the partner distribution side of things very well.

Flags: needinfo?(bhearsum)

Empty distribution values are invalid and shouldn't have been added to the update URL. my gut says that something changed about how we do URL substitution.

Just to be clear, this only happens in nightly? Not in release?

Might I ask why you have a distribution.ini with empty values?

Bugbug thinks this bug is a regression, but please revert this change in case of error.

Keywords: regression

I just ran a quick check on Firefox 68 and it does blank values for distribution.ini and no updates are available.

I'm checking old nightlies now

I just verified a nightly from mid last year also doesn't show updates.

So if this did regress, something would have changed in balrog.

I don't know whether to mark this as invalid or fix the URL code to handle empty distribution IDs...

I don't know whether empty distribution IDs is something we technically support, but I would like update to be as robust as possible, and this should be a fairly simple change. So I'm going to go ahead and post a patch.

This patch prevents the URL formatter from setting empty values for distribution data. It also prevents any non-url-encoded value from being substituted into the URL.

Assignee: nobody → ksteuber
Pushed by ksteuber@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/353752111b71
Make the Update URL formatter more robust r=mhowell,bhearsum,mkaply
Pushed by cbrindusan@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/16487cdee6ee
Fixed Eslint error on UpdateUtils.jsm. CLOSED TREE

Working on it.

Flags: needinfo?(ksteuber)

I'm removing the URL encoding parts of my patch. I hadn't thought that URL-encoding each part of the path would cause any changes, but it turns out that the %SYSTEM_CAPABILITIES% replacement currently looks like ISET:SSE4_2,MEM:16192, which is not encoded properly. I don't want to make that change here, but I filed Bug 1620327 to address it. In the meantime, I'm going to push a patch that addresses only the issue at hand: the empty distribution values.

Pushed by ksteuber@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/5b935c9b36ab
Make the Update URL formatter more robust r=mhowell,bhearsum,mkaply
Status: UNCONFIRMED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla75

Doesn't sound like we need to worry about backporting this to ESR, but LMK if that's incorrect.

Flags: qe-verify+

Reproduced the initial issue using an old Nightly before the fix and verified that using a nightly build after the fix can update to latest Nightly when using a blank distribution.ini file across platforms (Windows 10 64bit, macOS 10.15 and Ubuntu 18.04 64bit). I also checked that Firefox beta 75 is not affected by this.

Status: RESOLVED → VERIFIED
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: