Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
A volte, quando crei un'app, le cose non vanno come previsto e si verifica un errore.
In caso di dubbi, controlla il gestore degli errori (o la funzione catch() per le promesse)
e vedi cosa dice il messaggio di errore.
Se hai controllato il messaggio di errore e disponi di Cloud Storage Security Rules che consentono la tua azione, ma hai ancora difficoltà a risolvere l'errore, visita la nostra pagina di assistenza e comunicaci come possiamo aiutarti.
Gestire i messaggi di errore
Esistono diversi motivi per cui potrebbero verificarsi errori, tra cui l'assenza del file,
l'utente non dispone dell'autorizzazione per accedere al file desiderato o
l'utente ha annullato il caricamento del file.
Per diagnosticare correttamente il problema e gestire l'errore, ecco un elenco completo di
tutti gli errori che il nostro client genererà e come si sono verificati.
Codice
Motivo
storage/unknown
Si è verificato un errore sconosciuto.
storage/object-not-found
Non esiste alcun oggetto nel riferimento specificato.
storage/bucket-not-found
Nessun bucket configurato per Cloud Storage
storage/project-not-found
Nessun progetto è configurato per Cloud Storage
storage/quota-exceeded
La quota del bucket Cloud Storage è stata superata. Se hai scelto il piano tariffario Spark, valuta l'upgrade al piano tariffario Blaze con pagamento a consumo. Se hai già scelto il piano tariffario Blaze, contatta l'assistenza Firebase.
L'utente non è autenticato. Esegui l'autenticazione e riprova.
storage/unauthorized
L'utente non è autorizzato a eseguire l'azione richiesta. Controlla le regole di sicurezza per assicurarti che siano corrette.
storage/retry-limit-exceeded
Il limite di tempo massimo per un'operazione (caricamento, download, eliminazione e così via)
è stato superato. Prova a caricarlo di nuovo.
storage/invalid-checksum
Il file sul client non corrisponde al checksum del file ricevuto dal server. Prova a caricarlo di nuovo.
storage/canceled
L'utente ha annullato l'operazione.
storage/invalid-event-name
Il nome dell'evento fornito non è valido. Deve essere uno dei seguenti valori:
[`running`, `progress`, `pause`]
storage/invalid-url
L'URL fornito a refFromURL() non è valido. Deve essere nel formato:
gs://bucket/object o https://firebasestorage.googleapis.com/v0/b/bucket/o/object?token=<TOKEN>
storage/invalid-argument
L'argomento passato a put() deve essere `File`, `Blob` o
`UInt8` Array. L'argomento passato a putString() deve essere
una stringa non elaborata, "Base64" o "Base64URL".
storage/no-default-bucket
Nessun bucket è stato impostato nella proprietà
storageBucket della configurazione Firebase.
storage/cannot-slice-blob
Si verifica spesso quando il file locale è stato modificato (eliminato, salvato di nuovo,
ecc.). Prova a caricare di nuovo il file dopo aver verificato che non sia
stato modificato.
storage/server-file-wrong-size
Il file sul client non corrisponde alle dimensioni del file ricevuto dal
server. Prova a caricarlo di nuovo.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Mancano le informazioni di cui ho bisogno","missingTheInformationINeed","thumb-down"],["Troppo complicato/troppi passaggi","tooComplicatedTooManySteps","thumb-down"],["Obsoleti","outOfDate","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Problema relativo a esempi/codice","samplesCodeIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 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. |"]]