Problem
While running SQL queries using Databricks SQL endpoints, you receive the following error.
[RequestId=<request-id> ErrorClass=STORAGE_CREDENTIAL_DOES_NOT_EXIST.RESOURCE_DOES_NOT_EXIST] Storage Credential ‘UUID’ does not exist.
Cause
The storage credential associated with the Unity Catalog metastore has been deleted.
As a result, any queries or operations relying on access to the root location of the metastore fail with a STORAGE_CREDENTIAL_DOES_NOT_EXIST
error. This impacts all tables, views, or objects within the metastore that depend on that root storage configuration.
Solution
Update the storage credential used by the Unity Catalog metastore to a valid, existing one or add a new credential.
Update the storage credential
First identify the UUID, then make the update using the corresponding APIs.
Identify the UUID of the new storage credential
You need the storage credential’s UUID to update external locations or metastore configurations. Follow the instructions to retrieve a storage credential’s UUID.
- Call the List storage credentials API for your cloud. For details refer to the List credentials (AWS | Azure) API documentation.
- Review the API response. Each storage credential will be listed as an object with fields such as
name
,aws_iam_role
,azure_managed_identity
, andid
.
- Use the name value to locate the
id
field for your desired storage credential. Thisid
is a 32-character string and represents the storage credential’s UUID.
- Copy the UUID.
For example, if your target credential is named Metastore-access-credential
, look for the matching name
in the API response, then copy its corresponding id field.
Update the metastore with the new credential
Once you have the UUID, use the Update a metastore API to assign an updated storage credential to the metastore. For details and instructions, refer to the Update a metastore (AWS | Azure) documentation. Pass the new storage_credential_id
(UUID) into the payload when updating.
Once updated, re-run the SQL queries to confirm that metastore access has been restored and the error no longer appears.
Add a new credential
Use the Create a credential API to create a storage credential, then explicitly update the required resources (like external locations or mount points) to use this new credential.
For details and instructions, refer to the Create a credential (AWS | Azure) API documentation.