Closed Bug 1546627 Opened 5 months ago Closed 4 months ago

Update downloads performed via BITS are not successfully installed if Firefox is closed during the update process

Categories

(Toolkit :: Application Update, defect, P2)

68 Branch
All
Windows
defect

Tracking

()

VERIFIED FIXED
mozilla68
Tracking Status
firefox-esr60 --- unaffected
firefox66 --- unaffected
firefox67 --- unaffected
firefox68 --- verified

People

(Reporter: emilghitta, Assigned: bytesized)

References

(Blocks 1 open bug)

Details

(Keywords: regression)

Attachments

(3 files)

Attached image Bits.gif

Affected versions

  • Firefox 68.0a1 (BuildId:20190423221610)

Unaffected versions

  • Firefox 67.0b12
  • Firefox 66.0.3
  • Firefox 60.6.1 esr

Affected platforms

  • Windows 10 64bit
  • Windows 7 32bit

Unaffected platforms

  • Ubuntu 18.04 64bit
  • macOS 10.12.6

Preconditions

  • Set app.update.BITS.enabled and app.update.log to true
  • We used NetLimiter to simulate a low internet connection and disabled it after step 1.

Steps to reproduce

  1. Launch Firefox in order to start the update download process via BITS.
  2. Close Firefox during the update download process.
  3. Let BITS finish the update download in the background.
  4. Launch Firefox once the update download is completed.
  5. Restart Firefox in order to apply the downloaded update.

Expected result

  • The update download that was performed via BITS is successfully installed after step 5.

Actual result

  • The update download process restarts.
  • The following log was generated:

Step 1:
AUS:SVC Creating Downloader
AUS:SVC Downloader:_canUseBits - Patch is able to use BITS download
AUS:SVC Downloader:downloadUpdate - Starting BITS download with url: https://archive.mozilla.org/pub/firefox/nightly/2019/04/2019-04-23-22-16-10-mozilla-central/firefox-68.0a1.en-US.win64.complete.mar, updateDir: C:\ProgramData\Mozilla\updates\6F193CCC56814779\updates\0, filename: update.mar
AUS:SVC Downloader:downloadUpdate - BITS download running. BITS ID: {A23870A5-D55B-4909-808A-19D073D14456}
AUS:SVC Downloader:onProgress - progress: 8192/51580899
AUS:SVC Downloader:onProgress - progress: 8192/51580899

Step 4:
AUS:SVC Downloader:onStopRequest - attempting to stage update: Nightly 68.0a1

After restarting Firefox (step 5):
US:SVC Downloader:_canUseBits - Patch is able to use BITS download
AUS:SVC Downloader:downloadUpdate - Starting BITS download with url: https://archive.mozilla.org/pub/firefox/nightly/2019/04/2019-04-23-22-16-10-mozilla-central/firefox-68.0a1.en-US.win64.complete.mar, updateDir: C:\ProgramData\Mozilla\updates\6F193CCC56814779\updates\0, filename: update.mar
AUS:SVC Downloader:downloadUpdate - BITS download running. BITS ID: {6E5E18CC-B964-4BE4-AA3E-0E6695750C9B}
AUS:SVC Downloader:onProgress - progress: 4980736/51580899
AUS:SVC Downloader:onProgress - progress: 10223616/51580899
AUS:SVC Downloader:onProgress - progress: 15728640/51580899
AUS:SVC Downloader:onProgress - progress: 21233664/51580899
AUS:SVC Downloader:onProgress - progress: 26476544/51580899
AUS:SVC Downloader:onProgress - progress: 31981568/51580899
AUS:SVC Downloader:onProgress - progress: 37486592/51580899
AUS:SVC Downloader:onProgress - progress: 42729472/51580899
AUS:SVC Downloader:onProgress - progress: 48234496/51580899
AUS:SVC Downloader:onProgress - progress: 51580899/51580899
AUS:SVC Downloader:onStopRequest - downloader: BITS, status: 0
AUS:SVC Downloader:onStopRequest - status: 0, current fail: 0, max fail: 10, retryTimeout: 2000
AUS:SVC Downloader:_verifyDownload called
AUS:SVC Downloader:_verifyDownload downloaded size == expected size.
AUS:SVC Downloader:onStopRequest - setting state to: pending-service
AUS:SVC Downloader:onStopRequest - attempting to stage update: Nightly 68.0a1
AUS:SVC Downloader:_maybeStopActiveNotifications - Failed to decrease status update frequency: BitsError: BitsError {type: 39, action: 5, stage: 2, codeType: none}

Regression range

  • I don’t think that this is a regression.

Additional Information

  • I have attached a screencast for this issue.
  • Please note that this is quite intermittent, we managed to reproduce this issue while going very fast through steps 1 - 5. This seems to have around 7/10 (tries) reproducibility rate.
  • Please note that we managed to trigger the AUS:SVC Downloader:_maybeStopActiveNotifications - Failed to decrease status update frequency: BitsError: BitsError {type: 39, action: 5, stage: 2, codeType: none} error only once.

Hey, I believe that Emil is on PTO right now, but I need some help understanding this bug. Can you confirm that when Firefox is restarted in Step 4, that it is being restarted from the "Restart to update Nightly" button and not in some other way?

Flags: needinfo?(alexandru.trif)

Also, no need to worry about this error:

AUS:SVC Downloader:_maybeStopActiveNotifications - Failed to decrease status update frequency

It's not indicative of a problem.

Attached file log.txt

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

Hey, I believe that Emil is on PTO right now, but I need some help understanding this bug. Can you confirm that when Firefox is restarted in Step 4, that it is being restarted from the "Restart to update Nightly" button and not in some other way?

Hello, yes Emil is on PTO and we had some days off too, sorry for the late response. I can confirm that Firefox is restarted from the "Restart to update" button from Help -> About Nightly. Also doing this very fast makes the issue more likely to reproduce. I tested the update from Firefox (20190423095327). Here are my exact steps for the issue to reproduce more often:

Used the same preconditions from comment 0 and the same steps just adding some notes to them because the issue is more reproducible this way from what I saw:

  1. Launch Firefox in order to start the update download process via BITS.
  2. Close Firefox during the update download process (here I close Firefox without opening something else after I see the BITS process being used from Task manager on Processes tab).
  3. Let BITS finish the update download in the background. (I deactivate NetLimiter and wait for the download to finish)
  4. Launch Firefox once the update download is completed.
  5. Restart Firefox in order to apply the downloaded update (I quickly go to Help -> About Nightly and hit "Restart to update Nightly" button - I have to mention this step is made really fast).
  6. After the restart I go back to Help -> About Nightly and the update process is restarted.

I hope that this information can help because the issue is intermittent but doing this in a fast way and following the steps makes it more reproducible.

I also attached a screen recording and a full log from the browser console that is generated after the update process is restarted via BITS second time(Step 6). If there is other information I can help with please let me know.

Flags: needinfo?(alexandru.trif)
Pushed by ksteuber@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/e978f9960f57
Prevent Firefox from prematurely showing "Restart to Update" on startup r=rstrong
Blocks: 1550799
Flags: needinfo?(ksteuber)
Pushed by ksteuber@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/8096d130b134
Prevent Firefox from prematurely showing "Restart to Update" on startup r=rstrong
Flags: needinfo?(ksteuber)
Status: NEW → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68
Assignee: nobody → ksteuber

This issue is verified when updating from Firefox 68.0a1 (20190512093034) to Firefox 68.0a1 (20190515092556) on Windows 10 x64 and Windows 7 x64. I tried reproducing the issue several times but no additional update download was started after the first one was performed.

Status: RESOLVED → VERIFIED
Regressions: 1552853
Blocks: 1556999
You need to log in before you can comment on or make changes to this bug.