Handle errors for Cloud Storage on Web

Sometimes when you're building an app, things don't go as planned and an error occurs!

When in doubt, check the error handler (or catch() function for Promises), and see what the error message has to say.

If you've checked the error message and have Cloud Storage Security Rules that allow your action, but are still struggling to solve the error, visit our Support page and let us know how we can help.

Handle Error Messages

There are a number of reasons why errors may occur, including the file not existing, the user not having permission to access the desired file, or the user cancelling the file upload.

To properly diagnose the issue and handle the error, here is a full list of all the errors our client will raise, and how they occurred.

CodeReason
storage/unknownAn unknown error occurred.
storage/object-not-foundNo object exists at the specified reference.
storage/bucket-not-foundNo bucket is configured for Cloud Storage
storage/project-not-foundNo project is configured for Cloud Storage
storage/quota-exceededQuota 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. 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, even default buckets.
storage/unauthenticatedUser is unauthenticated, please authenticate and try again.
storage/unauthorizedUser is not authorized to perform the requested action, check your security rules to ensure they are correct.
storage/retry-limit-exceededThe maximum time limit on an operation (upload, download, delete, etc.) has been exceeded. Try uploading again.
storage/invalid-checksumFile on the client does not match the checksum of the file received by the server. Try uploading again.
storage/canceledUser canceled the operation.
storage/invalid-event-nameInvalid event name provided. Must be one of [`running`, `progress`, `pause`]
storage/invalid-urlInvalid URL provided to refFromURL(). Must be of the form: gs://bucket/object or https://firebasestorage.googleapis.com/v0/b/bucket/o/object?token=<TOKEN>
storage/invalid-argumentThe argument passed to put() must be `File`, `Blob`, or `UInt8` Array. The argument passed to putString() must be a raw, `Base64`, or `Base64URL` string.
storage/no-default-bucketNo bucket has been set in your Firebase config's storageBucket property.
storage/cannot-slice-blobCommonly occurs when the local file has changed (deleted, saved again, etc.). Try uploading again after verifying that the file hasn't changed.
storage/server-file-wrong-sizeFile on the client does not match the size of the file received by the server. Try uploading again.