mozilla / MozStumbler

Android Stumbler for Mozilla
http://location.services.mozilla.com
Mozilla Public License 2.0
618 stars 213 forks source link

Failed updates from Github should not crash the stumbler. #1723

Open cascheberg opened 9 years ago

cascheberg commented 9 years ago

@crankycoder Release 1.7.12 offers update to v1.7.14. Then crashes when trying to update:

E/AndroidRuntime﹕ FATAL EXCEPTION: AsyncTask #2
    Process: org.mozilla.mozstumbler, PID: 28156
    java.lang.RuntimeException: An error occured while executing doInBackground()
            at android.os.AsyncTask$3.done(AsyncTask.java:304)
            at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355)
            at java.util.concurrent.FutureTask.setException(FutureTask.java:222)
            at java.util.concurrent.FutureTask.run(FutureTask.java:242)
            at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
            at java.lang.Thread.run(Thread.java:818)
     Caused by: java.lang.reflect.UndeclaredThrowableException
            at $Proxy1.getUrlAsFile(Unknown Source)
            at org.mozilla.mozstumbler.client.Updater.downloadFile(Updater.java:249)
            at org.mozilla.mozstumbler.client.Updater.access$500(Updater.java:32)
            at org.mozilla.mozstumbler.client.Updater$5.doInBackground(Updater.java:208)
            at org.mozilla.mozstumbler.client.Updater$5.doInBackground(Updater.java:204)
            at android.os.AsyncTask$2.call(AsyncTask.java:292)
            at java.util.concurrent.FutureTask.run(FutureTask.java:237)
            at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
            at java.lang.Thread.run(Thread.java:818)
     Caused by: java.lang.reflect.InvocationTargetException
            at java.lang.reflect.Method.invoke(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:372)
            at org.mozilla.mozstumbler.svclocator.DynamicProxy.invoke(DynamicProxy.java:89)
            at java.lang.reflect.Proxy.invoke(Proxy.java:397)
            at $Proxy1.getUrlAsFile(Unknown Source)
            at org.mozilla.mozstumbler.client.Updater.downloadFile(Updater.java:249)
            at org.mozilla.mozstumbler.client.Updater.access$500(Updater.java:32)
            at org.mozilla.mozstumbler.client.Updater$5.doInBackground(Updater.java:208)
            at org.mozilla.mozstumbler.client.Updater$5.doInBackground(Updater.java:204)
            at android.os.AsyncTask$2.call(AsyncTask.java:292)
            at java.util.concurrent.FutureTask.run(FutureTask.java:237)
            at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
            at java.lang.Thread.run(Thread.java:818)
     Caused by: java.io.FileNotFoundException: https://github.com/mozilla/MozStumbler/releases/download/v1.7.14/MozStumbler-v1.7.14.apk
            at com.android.okhttp.internal.http.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:206)
            at com.android.okhttp.internal.http.DelegatingHttpsURLConnection.getInputStream(DelegatingHttpsURLConnection.java:210)
            at com.android.okhttp.internal.http.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:25)
            at org.mozilla.mozstumbler.service.core.http.HttpUtil.getUrlAsFile(HttpUtil.java:116)
            at java.lang.reflect.Method.invoke(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:372)
            at org.mozilla.mozstumbler.svclocator.DynamicProxy.invoke(DynamicProxy.java:89)
            at java.lang.reflect.Proxy.invoke(Proxy.java:397)
            at $Proxy1.getUrlAsFile(Unknown Source)
            at org.mozilla.mozstumbler.client.Updater.downloadFile(Updater.java:249)
            at org.mozilla.mozstumbler.client.Updater.access$500(Updater.java:32)
            at org.mozilla.mozstumbler.client.Updater$5.doInBackground(Updater.java:208)
            at org.mozilla.mozstumbler.client.Updater$5.doInBackground(Updater.java:204)
            at android.os.AsyncTask$2.call(AsyncTask.java:292)
            at java.util.concurrent.FutureTask.run(FutureTask.java:237)
            at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
            at java.lang.Thread.run(Thread.java:818)
Djfe commented 9 years ago

Happened for me as well. And when will the update be available on the playstore?

crankycoder commented 9 years ago

Crap. This is what happens when I don't do a release for months.

Sorry. I've updated the filename - the upgrade should be ok now.

On Thu, Sep 24, 2015 at 3:02 PM, Felix Baumann notifications@github.com wrote:

Happened for me as well. And when will the update be available on the playstore?

— Reply to this email directly or view it on GitHub https://github.com/mozilla/MozStumbler/issues/1723#issuecomment-143020398 .

cascheberg commented 9 years ago

Wouldn't it be good to also catch all exceptions in the updater, so that at least it does not crash if something similar happens again?

crankycoder commented 9 years ago

Yes. I've renamed this bug so that we can track this.