Closed Bug 896735 Opened 11 years ago Closed 10 years ago

App update fails if Download folder doesn't exist

Categories

(Firefox for Android Graveyard :: General, defect)

ARM
Android
defect
Not set
normal

Tracking

(firefox34 fixed, firefox35 fixed, fennec33+)

RESOLVED FIXED
Firefox 35
Tracking Status
firefox34 --- fixed
firefox35 --- fixed
fennec 33+ ---

People

(Reporter: mossop, Assigned: esawin)

Details

Attachments

(1 file)

For a few days I've been unable to update Fennec I suspect because a few days ago I deleted the Download folder from my sdcard because it was full of junk. Attempting to update gives the following in logcat:

07-22 15:12:03.695 I/UpdateService(18838): next update will be at: Mon Jul 22 19:12:03 PDT 2013
07-22 15:12:03.705 I/UpdateService(18838): openning connection with url: https://aus2.mozilla.org/update/4/Fennec/25.0a1/20130720030214/Android_arm-eabi-gcc3/en-US/nightly/4.2.2/default/default/25.0a1/update.xml
07-22 15:12:04.085 D/dalvikvm(18838): GC_CONCURRENT freed 412K, 5% free 8921K/9364K, paused 3ms+2ms, total 27ms
07-22 15:12:04.385 I/UpdateService(18838): update available, buildID = 20130722030226
07-22 15:12:04.385 I/UpdateService(18838): downloading update package
07-22 15:12:04.395 I/UpdateService(18838): openning connection with url: http://ftp.mozilla.org/pub/mozilla.org/mobile/nightly/2013/07/2013-07-22-03-02-26-mozilla-central-android/fennec-25.0a1.multi.android-arm.apk
07-22 15:12:04.625 E/UpdateService(18838): failed to download update:
07-22 15:12:04.625 E/UpdateService(18838): java.io.FileNotFoundException: /storage/emulated/0/Download/fennec-25.0a1.multi.android-arm.apk: open failed: ENOENT (No such file or directory)
07-22 15:12:04.625 E/UpdateService(18838):      at libcore.io.IoBridge.open(IoBridge.java:416)
07-22 15:12:04.625 E/UpdateService(18838):      at java.io.FileOutputStream.<init>(FileOutputStream.java:88)
07-22 15:12:04.625 E/UpdateService(18838):      at java.io.FileOutputStream.<init>(FileOutputStream.java:73)
07-22 15:12:04.625 E/UpdateService(18838):      at org.mozilla.gecko.updater.UpdateService.downloadUpdatePackage(UpdateService.java:430)
07-22 15:12:04.625 E/UpdateService(18838):      at org.mozilla.gecko.updater.UpdateService.startUpdate(UpdateService.java:240)
07-22 15:12:04.625 E/UpdateService(18838):      at org.mozilla.gecko.updater.UpdateService.onHandleIntent(UpdateService.java:118)
07-22 15:12:04.625 E/UpdateService(18838):      at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
07-22 15:12:04.625 E/UpdateService(18838):      at android.os.Handler.dispatchMessage(Handler.java:99)
07-22 15:12:04.625 E/UpdateService(18838):      at android.os.Looper.loop(Looper.java:137)
07-22 15:12:04.625 E/UpdateService(18838):      at android.os.HandlerThread.run(HandlerThread.java:60)
07-22 15:12:04.625 E/UpdateService(18838): Caused by: libcore.io.ErrnoException: open failed: ENOENT (No such file or directory)
07-22 15:12:04.625 E/UpdateService(18838):      at libcore.io.Posix.open(Native Method)
07-22 15:12:04.625 E/UpdateService(18838):      at libcore.io.BlockGuardOs.open(BlockGuardOs.java:110)
07-22 15:12:04.625 E/UpdateService(18838):      at libcore.io.IoBridge.open(IoBridge.java:400)
07-22 15:12:04.625 E/UpdateService(18838):      ... 9 more
I just manually recreated the Download folder and tapped to retry and it is now downloading and applying the update.
This should track now that we are looking at doing our own updates in some cases.
tracking-fennec: --- → ?
Assignee: nobody → snorp
tracking-fennec: ? → 33+
Assignee: snorp → scleymans
Assignee: scleymans → snorp
Assignee: snorp → esawin
OS: Windows 7 → Android
Hardware: x86_64 → ARM
Status: NEW → ASSIGNED
Attachment #8497725 - Flags: review?(snorp)
Comment on attachment 8497725 [details] [diff] [review]
download-path-create.patch

Review of attachment 8497725 [details] [diff] [review]:
-----------------------------------------------------------------

nice :)
Attachment #8497725 - Flags: review?(snorp) → review+
It's not really worth wasting cycles on Try for this.
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/8292582e4c69
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 35
Comment on attachment 8497725 [details] [diff] [review]
download-path-create.patch

Approval Request Comment
[Feature/regressing bug #]: Fennec update service
[User impact if declined]: Updates can fail to download, outdated Fennec versions can pose security risks
[Describe test coverage new/current, TBPL]: Local testing, has been on Nightly for a few days
[Risks and why]: Very low - patch only creates a download folder, if it does not exist
[String/UUID change made/needed]: none
Attachment #8497725 - Flags: approval-mozilla-beta?
Attachment #8497725 - Flags: approval-mozilla-aurora?
Comment on attachment 8497725 [details] [diff] [review]
download-path-create.patch

Update for release are managed with the Google Play services. I will let ride the train with aurora.

By the way, for curiosity, we always have permissions on android to create Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS) ?
Attachment #8497725 - Flags: approval-mozilla-beta?
Attachment #8497725 - Flags: approval-mozilla-beta-
Attachment #8497725 - Flags: approval-mozilla-aurora?
Attachment #8497725 - Flags: approval-mozilla-aurora+
The reason this is tracking 33 is we are planning on offering single locale builds using this update mechanism to release users. The work to set up the update channels is in bug 1019724
(In reply to Sylvestre Ledru [:sylvestre] from comment #9)
> Comment on attachment 8497725 [details] [diff] [review]
> download-path-create.patch
> 
> Update for release are managed with the Google Play services. I will let
> ride the train with aurora.
Please see previous comment.

> By the way, for curiosity, we always have permissions on android to create
> Environment.getExternalStoragePublicDirectory(Environment.
> DIRECTORY_DOWNLOADS) ?
Writing (to) directories obtained via getExternalStoragePublicDirectory does not require additional permissions, it is advised in the docs: https://developer.android.com/reference/android/os/Environment.html#getExternalStoragePublicDirectory%28java.lang.String%29 .

Writing (to) directories obtained via getExternalStorageDirectory requires the WRITE_EXTERNAL_STORAGE permission, which we acquire.
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: