FirebaseStorage - File at URL is not reachable

Viewed 163

I have the following error :

[firebase_storage/unknown] File at URL: file:///var/mobile/Containers/Data/Application/DABF3DC5-1ABC-4824-B072-DEAC0F37144D/Documents/myappdir/b42e210-62ed-11ec-9430-f940facba-temp_file.mp4 is not reachable. Ensure file URL is not a directory, symbolic link, or invalid url..

I simply would like to know in which situation can I have the following error ?
In other words, which FirebaseStorage method is throwing such error and in what kind of situation ?

Because i have used catchError on all methods in my code and it didn't catch this error but i see it in my crashlytics dashboard (i have registered non fatal errors for my beta testers).

The implementation is :

UploadTask uploadPostFile({required String filePath, required String uid}) {
    Reference reference = FirebaseStorage.instance.ref()
        .child("content/" + uid);
    return reference.putFile(File(filePath));
  }

 Future<String> getDownloadUrl(String uid) {
    return FirebaseInstance.ref()
        .child("content/" + uid)
        .getDownloadURL();
  }

And they are called like this :

await uploadPostFile(filePath: "file_path", uid: "uid").catchError((e) {
            print("upload main video file error : $e");
            return e;
          });;
String fileResult = await getDownloadUrl("uid").catchError((e) {
            print("Download main video file error : $e");
            return e;
          });

This error happens 1 time / 1000 in my beta app version, i simply need to investigate the error in my code that would lead to such behavior so i can fix it.

EDIT :

I am also having this error :

[firebase_storage/unknown] An unknown error occurred, please check the server response.. Error thrown null.

Can it be linked in any way ? The error itself (unknown) doesn't help much to know what this is about...

To get the bounty, please tell me the followings in your answer :

  • The method used by FirebaseStorage to throw this error.
  • The context of this error (upload / download) File at URL that doesn't start by http.
  • Eventually a sample code that would lead to this error, in order to have a use case scenario that would help me understand easily when this happens.
0 Answers
Related