Unable to upload image to Firebase Storage

Step 0: Are you in the right place?

  • For issues or feature requests related to the code in this repository
    file a Github issue.

    • If this is a feature request please use the Feature Request template.
  • For general technical questions, post a question on StackOverflow
    with the firebase tag.
  • For general (non-iOS) Firebase discussion, use the firebase-talk
    google group.
  • For backend issues, console issues, and other non-SDK help that does not fall under one
    of the above categories, reach out to
    Firebase Support.
  • Once you’ve read this section and determined that your issue is appropriate for
    this repository, please delete this section.

[REQUIRED] Step 1: Describe your environment

  • Xcode version: 12.4
  • Firebase SDK version: 7.7.0
  • Installation method: CocoaPods
  • Firebase Component: Storage

[REQUIRED] Step 2: Describe the problem

Unable to upload image to Firebase Storage, I am receiving an error message, “An unknown error occurred, please check the server response.”

Prior to this, my app was working perfectly fine, I was able to upload images to multiple references within Storage as well and simultaneously uploading data to Realtime Database. Now after revisiting the app after a day off I am unable to upload images to Storage. Through error handling, I am only getting this error message from the Storage side. I haven’t changed any code prior to getting this message nor did I update the pod (previously I was working with Firebase 7.4.0 but have now since updated to 7.7.0), I also did not change any security rules or settings prior to the error message.

Steps to reproduce:

Uploading an image to Storage resulting in an unknown error.

Relevant Code:

    imageReference.putData(imageData, metadata: nil) { [weak self] metadata, error in
        guard error == nil else {
            print("FAILED TO UPLOAD IMAGE TO STORAGE \(error?.localizedDescription)")

2 thoughts on “Unable to upload image to Firebase Storage

  1. Hey, we recently just started seeing this in a production app, along with intermittent “unauthenticated” errors. Admittedly, I am coming from react-native-firebase but we learned that turning off WiFi actually solved the issue (which led me to this Github issue, which led me to search this repo for more info and finding your issue).

    Not sure if it’s related to the WiFi security issue, though. Have you tried turning off wifi and attempting to upload again?

  2. @shemishe what internet provider do you use? The only report I’ve gotten was in San Francisco using Sonic Internet (and turning off WiFi worked in their case).

    I’m sending in a message to Sonic support and linking this Github issue. It appears Comcast resolved this issue on their side last year.

    Also tagging @justkd-google and @morganchen12 as they appear to be representing Firebase in the aforementioned thread. I’m sure a swift resolution will be much more probable if Google/Firebase can contact Sonic. Thanks in advance!

    (Edit: My Sonic support request # is 6307581 if there’s any value in trying to reference/group together)