Skip to content

🐛 [firebase_storage] [firebase_storage/unknown] Firebase Storage: An unknown error occurred, please check the error payload for server response. (storage/unknown) #10760

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Patrick386 opened this issue Apr 11, 2023 · 3 comments
Labels
closed-by-bot resolution: no-response Customer did not respond after some time. Stale Issue with no recent activity type: bug Something isn't working

Comments

@Patrick386
Copy link

Flutter Web:

If you cancel while uploading a file to cloud storage, you may see the following error.
The file will be uploaded successfully if you do not click the cancel or resume button.
The reason is unknown.

Error
[firebase_storage/unknown] Firebase Storage: An unknown error occurred, please check the error payload for server response. (storage/unknown)

The rule settings for firebase cloud storage are as follows:

rules_version = '2';
service firebase.storage {
match /b/{bucket}/o {
match /{allPaths=**} {
allow read: if true;
allow write: if request.auth != null;
}}}

Cloud Storage:
Add "[email protected]

https://stackoverflow.com/questions/70052479/firebase-storage-an-unknown-error-occurred-please-check-the-error-payload-for

Code:

 Reference firebaseStorage = FirebaseStorage.instance.ref();
  UploadTask? uploadTask;

  Future<String?> goUpload({String? contentType, required String filePath,  Uint8List? bytes}) async {

    Reference storageFileRef = firebaseStorage.child(filePath);
    final SettableMetadata metadata = SettableMetadata(
        contentType: contentType,
        customMetadata: {'picked-file-path': filePath});

    if (kIsWeb) {
      uploadTask = storageFileRef.putData(bytes!, metadata);
    } else {
      uploadTask = storageFileRef.putFile(io.File(filePath), metadata);
    }

    try {
      await uploadTask;
     String downLoadUri = await uploadTask!.snapshot.ref.getDownloadURL();

     return downLoadUri;

    } on RepositoryException catch (e) {
      value = value.copyWith(error: e.message);
    }
    return null;
  }

Ui

LoadingProgress(
            icon: FluentIcons.pause_12_regular,
            onPressed: () => controller.pause(),  //  pause() async =>await uploadTask?.pause();
          );
[√] Flutter (Channel stable, 3.7.10, on Microsoft Windows [Version 10.0.19045.2728], locale ko-KR)
    • Flutter version 3.7.10 on channel stable at C:\Dev\flutter                                  
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 4b12645012 (7 days ago), 2023-04-03 17:46:48 -0700
    • Engine revision ec975089ac
    • Dart version 2.19.6       
    • DevTools version 2.20.1   

[X] Windows Version (Unable to confirm if installed Windows version is 10 or greater)

[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)     
    • Android SDK at C:\Users\SintPatrick\AppData\Local\Android\sdk
    • Platform android-30, build-tools 30.0.3
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 11.0.12+7-b1504.28-7817840)    
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.4.5)        
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community       
    • Visual Studio Community 2022 version 17.4.33403.182
    • Windows 10 SDK version 10.0.19041.0

[√] Android Studio (version 2021.2)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.12+7-b1504.28-7817840)

[√] IntelliJ IDEA Ultimate Edition (version 2022.2)
    • IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA 2022.2.2
    • Flutter plugin version 72.1.3
    • Dart plugin version 222.4167.21

[√] VS Code (version 1.75.0)
    • VS Code at C:\Users\SintPatrick\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.58.0

[√] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.19045.2728]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 112.0.5615.49
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 112.0.1722.34

[√] HTTP Host Availability
    • All required HTTP hosts are available
@Patrick386 Patrick386 added Needs Attention This issue needs maintainer attention. type: bug Something isn't working labels Apr 11, 2023
@darshankawar darshankawar added the triage Issue is currently being triaged. label Apr 11, 2023
@darshankawar
Copy link

@Patrick386
Do you get any error code with the log ? If so, it would be helpful to provide here.
Also check if this is relevant with your case.

firebase/firebase-js-sdk#5848 (comment)

@darshankawar darshankawar added blocked: customer-response Waiting for customer response, e.g. more information was requested. and removed Needs Attention This issue needs maintainer attention. labels Apr 11, 2023
@google-oss-bot google-oss-bot added the Stale Issue with no recent activity label Apr 20, 2023
@google-oss-bot
Copy link

Hey @Patrick386. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

@google-oss-bot
Copy link

Since there haven't been any recent updates here, I am going to close this issue.

@Patrick386 if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.

@darshankawar darshankawar added resolution: no-response Customer did not respond after some time. and removed blocked: customer-response Waiting for customer response, e.g. more information was requested. triage Issue is currently being triaged. labels May 2, 2023
@firebase firebase locked and limited conversation to collaborators Jun 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
closed-by-bot resolution: no-response Customer did not respond after some time. Stale Issue with no recent activity type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants