Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Czasami podczas tworzenia aplikacji coś idzie nie tak i występuje błąd.
W razie wątpliwości sprawdź moduł obsługi błędów (lub funkcję catch() w przypadku obietnic) i zobacz, co mówi komunikat o błędzie.
Jeśli po sprawdzeniu komunikatu o błędzie masz Cloud Storage Security Rules, które umożliwiają wykonanie działania, ale nadal nie możesz rozwiązać problemu, odwiedź naszą stronę pomocy i daj nam znać, jak możemy Ci pomóc.
Obsługa komunikatów o błędach
Błędy mogą wystąpić z różnych powodów, np. z powodu braku pliku, braku uprawnień użytkownika do dostępu do wybranego pliku lub anulowania przesyłania pliku przez użytkownika.
Aby prawidłowo zdiagnozować problem i obsłużyć błąd, zapoznaj się z pełną listą wszystkich błędów, które może zgłosić nasz klient, oraz z informacjami o tym, jak one powstają.
Kod
Przyczyna
storage/unknown
Wystąpił nieznany błąd.
storage/object-not-found
W określonym odwołaniu nie ma obiektu.
storage/bucket-not-found
Nie skonfigurowano zasobnika dla: Cloud Storage
storage/project-not-found
Nie skonfigurowano projektu dla Cloud Storage
storage/quota-exceeded
Przekroczono limit w przypadku zasobnika Cloud Storage. Jeśli korzystasz z abonamentu Spark, rozważ przejście na abonament Blaze z płatnością za wykorzystanie. Jeśli korzystasz już z abonamentu Blaze, skontaktuj się z zespołem pomocy Firebase.
Ważne: od 1 października 2025 r. do korzystania z Cloud Storage, nawet z domyślnych zasobników, będzie wymagany abonament Blaze.
storage/unauthenticated
Użytkownik nie jest uwierzytelniony. Uwierzytelnij się i spróbuj ponownie.
storage/unauthorized
Użytkownik nie ma uprawnień do wykonania żądanej czynności. Sprawdź reguły zabezpieczeń, aby upewnić się, że są prawidłowe.
storage/retry-limit-exceeded
Maksymalny limit czasu operacji (przesyłania, pobierania, usuwania itp.)
został przekroczony. Spróbuj przesłać jeszcze raz.
storage/invalid-checksum
Plik na komputerze klienta nie jest zgodny z sumą kontrolną pliku otrzymanego przez serwer. Spróbuj przesłać jeszcze raz.
storage/canceled
Operacja anulowana przez użytkownika.
storage/invalid-event-name
Podano nieprawidłową nazwę zdarzenia. Musi to być jedna z tych wartości: [`running`, `progress`, `pause`]
storage/invalid-url
Nieprawidłowy adres URL przekazany do refFromURL(). Musi mieć format:
gs://bucket/object lub https://firebasestorage.googleapis.com/v0/b/bucket/o/object?token=<TOKEN>
storage/invalid-argument
Argument przekazywany do funkcji put() musi być tablicą `File`, `Blob` lub `UInt8`. Argument przekazywany do funkcji putString() musi być ciągiem znaków w formacie surowym, `Base64` lub `Base64URL`.
storage/no-default-bucket
W konfiguracji Firebase nie ustawiono żadnego zasobnika w właściwości storageBucket.
storage/cannot-slice-blob
Zwykle występuje, gdy lokalny plik został zmieniony (usunięty, ponownie zapisany itp.). Spróbuj przesłać plik ponownie po sprawdzeniu, czy nie uległ zmianie.
storage/server-file-wrong-size
Plik na urządzeniu klienta nie jest zgodny z rozmiarem pliku otrzymanego przez serwer. Spróbuj przesłać jeszcze raz.
[[["Łatwo zrozumieć","easyToUnderstand","thumb-up"],["Rozwiązało to mój problem","solvedMyProblem","thumb-up"],["Inne","otherUp","thumb-up"]],[["Brak potrzebnych mi informacji","missingTheInformationINeed","thumb-down"],["Zbyt skomplikowane / zbyt wiele czynności do wykonania","tooComplicatedTooManySteps","thumb-down"],["Nieaktualne treści","outOfDate","thumb-down"],["Problem z tłumaczeniem","translationIssue","thumb-down"],["Problem z przykładami/kodem","samplesCodeIssue","thumb-down"],["Inne","otherDown","thumb-down"]],["Ostatnia aktualizacja: 2025-09-05 UTC."],[],[],null,["\u003cbr /\u003e\n\nSometimes when you're building an app, things don't go as planned and an\nerror occurs!\n\nWhen in doubt, check the error handler (or `catch()` function for Promises),\nand see what the error message has to say.\n| **Note:** By default, a Cloud Storage for Firebase bucket requires Firebase Authentication to perform any action on the bucket's data or files. You can change your Firebase Security Rules for Cloud Storage to [allow unauthenticated access for specific situations](/docs/storage/security/rules-conditions#public). However, for most situations, we strongly recommend [restricting access and setting up robust security rules](/docs/storage/security/get-started) (especially for production apps). Note that if you use Google App Engine and have a default Cloud Storage bucket with a name format of `*.appspot.com`, you may need to consider [how your security rules impact access to App Engine files](/docs/storage/gcp-integration#security-rules-and-app-engine-files).\n\nIf you've checked the error message and have Cloud Storage Security Rules that allow your\naction, but are still struggling to solve the error, visit our\n[Support page](/support) and let us know how we can help.\n\nHandle Error Messages\n\nThere are a number of reasons why errors may occur, including the file\nnot existing, the user not having permission to access the desired file, or the\nuser cancelling the file upload.\n\nTo properly diagnose the issue and handle the error, here is a full list of\nall the errors our client will raise, and how they occurred.\n\n| Code | Reason |\n|----------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `storage/unknown` | An unknown error occurred. |\n| `storage/object-not-found` | No object exists at the specified reference. |\n| `storage/bucket-not-found` | No bucket is configured for Cloud Storage |\n| `storage/project-not-found` | No project is configured for Cloud Storage |\n| `storage/quota-exceeded` | Quota on your Cloud Storage bucket has been exceeded. If you're on the Spark pricing plan, consider upgrading to the [pay-as-you-go Blaze pricing plan](/pricing). If you're already on the Blaze pricing plan, reach out to Firebase Support. **Important** : Starting October 1, 2025, the [Blaze pricing plan will be *required* to use Cloud Storage](/docs/storage/faqs-storage-changes-announced-sept-2024), even default buckets. |\n| `storage/unauthenticated` | User is unauthenticated, please authenticate and try again. |\n| `storage/unauthorized` | User is not authorized to perform the requested action, check your security rules to ensure they are correct. |\n| `storage/retry-limit-exceeded` | The maximum time limit on an operation (upload, download, delete, etc.) has been exceeded. Try uploading again. |\n| `storage/invalid-checksum` | File on the client does not match the checksum of the file received by the server. Try uploading again. |\n| `storage/canceled` | User canceled the operation. |\n| `storage/invalid-event-name` | Invalid event name provided. Must be one of \\[```running```, ```progress```, ```pause```\\] |\n| `storage/invalid-url` | Invalid URL provided to `refFromURL()`. Must be of the form: gs://bucket/object or https://firebasestorage.googleapis.com/v0/b/bucket/o/object?token=\\<TOKEN\\\u003e |\n| `storage/invalid-argument` | The argument passed to `put()` must be \\`File\\`, \\`Blob\\`, or \\`UInt8\\` Array. The argument passed to `putString()` must be a raw, \\`Base64\\`, or \\`Base64URL\\` string. |\n| `storage/no-default-bucket` | No bucket has been set in your Firebase config's `storageBucket` property. |\n| `storage/cannot-slice-blob` | Commonly occurs when the local file has changed (deleted, saved again, etc.). Try uploading again after verifying that the file hasn't changed. |\n| `storage/server-file-wrong-size` | File on the client does not match the size of the file received by the server. Try uploading again. |"]]