firebase / firebase-android-sdk

Firebase Android SDK
https://firebase.google.com
Apache License 2.0
2.23k stars 565 forks source link

Storage - Error while resuming upload #1743

Open anshulg03 opened 4 years ago

anshulg03 commented 4 years ago

[READ] Step 1: Are you in the right place?

Issues filed here should be about bugs in the code in this repository. If you have a general question, need help debugging, or fall into some other category use one of these other channels:

[REQUIRED] Step 2: Describe your environment

[REQUIRED] Step 3: Describe the problem

When resuming an upload after getting back network connectivity the following error shows up.

Steps to reproduce:

What happened? How can we make the problem occur? This could be a description, log/console output, etc.

Relevant Code:

W/NetworkRequest: error sending network request POST null
    java.net.MalformedURLException: no protocol: null
        at java.net.URL.<init>(URL.java:601)
        at java.net.URL.<init>(URL.java:498)
        at java.net.URL.<init>(URL.java:447)
        at com.google.firebase.storage.network.NetworkRequest.createConnection(com.google.firebase:firebase-storage@@19.1.1:316)
        at com.google.firebase.storage.network.NetworkRequest.performRequestStart(com.google.firebase:firebase-storage@@19.1.1:246)
        at com.google.firebase.storage.network.NetworkRequest.performRequest(com.google.firebase:firebase-storage@@19.1.1:270)
        at com.google.firebase.storage.network.NetworkRequest.performRequest(com.google.firebase:firebase-storage@@19.1.1:286)
        at com.google.firebase.storage.internal.ExponentialBackoffSender.sendWithExponentialBackoff(com.google.firebase:firebase-storage@@19.1.1:103)
        at com.google.firebase.storage.internal.ExponentialBackoffSender.sendWithExponentialBackoff(com.google.firebase:firebase-storage@@19.1.1:62)
        at com.google.firebase.storage.UploadTask.sendWithRetry(com.google.firebase:firebase-storage@@19.1.1:467)
        at com.google.firebase.storage.UploadTask.recoverStatus(com.google.firebase:firebase-storage@@19.1.1:355)
        at com.google.firebase.storage.UploadTask.shouldContinue(com.google.firebase:firebase-storage@@19.1.1:317)
        at com.google.firebase.storage.UploadTask.run(com.google.firebase:firebase-storage@@19.1.1:221)
        at com.google.firebase.storage.StorageTask.lambda$getRunnable$7(com.google.firebase:firebase-storage@@19.1.1:1072)
        at com.google.firebase.storage.StorageTask$$Lambda$12.run(Unknown Source:2)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:919)
ashwinraghav commented 4 years ago

Thanks for reporting @anshulg03 . Are you able to consistently repro the issue ? Is there a sample project you have that we can try out ?

anshulg03 commented 4 years ago

Yes whenever I test the app for an unstable network by turning the data connectivity on and off while the upload is in progress, I am facing this issue.

The error keeps on appearing until I kill the app.

I will try and write a short snippet to reproduce the issue.

schmidt-sebastian commented 3 years ago

@anshulg03 The Upload URL that is used to resume the upload is extracted from the HTTP header that was sent to us last: https://github.com/firebase/firebase-android-sdk/blob/e95f91e64c79206549302e9f37341534c29f58af/firebase-storage/src/main/java/com/google/firebase/storage/UploadTask.java#L273

Are you behind a Proxy that may adjust these values?

anshulg03 commented 3 years ago

@anshulg03 The Upload URL that is used to resume the upload is extracted from the HTTP header that was sent to us last:

https://github.com/firebase/firebase-android-sdk/blob/e95f91e64c79206549302e9f37341534c29f58af/firebase-storage/src/main/java/com/google/firebase/storage/UploadTask.java#L273

Are you behind a Proxy that may adjust these values?

Nope, there is no proxy. @schmidt-sebastian