Metastore deletion issues

mbanxp
New Contributor III

Good afternoon,

 

I have an issue with my metastore in North Europe.

All my workspaces got detached:

mbanxp_0-1751622293898.png

If I go to Databricks console, I can see the metastore in North Europe I created.

mbanxp_1-1751621952878.png

However, when I select the metastore in North Europe, I get the following error:

mbanxp_2-1751621985852.png

If I want to create a new metastore in NorthEU I cannot do it because it says there is already one:

mbanxp_3-1751622036461.png

 

How could I solve the issue ? 

Thanks in advance

 

 

 

 

szymon_dybczak
Esteemed Contributor III

Hi @mbanxp ,

Maybe there's some hiccup on UI side. Could you try to use REST API or databricks cli?
You can use following endpoint to list all metastores associated with your account:

Get all metastores associated with an account | Account Metastores API | REST API reference | Databr...

Check if the metastore causing problem is still there, note its metastore_id and then execute following endpoint:

Delete a metastore | Account Metastores API | REST API reference | Databricks on AWS

mbanxp
New Contributor III

Hi @szymon_dybczak ,

I used CLI to get all metastores associated with the account and I got 2 metastores:

mbanxp_0-1751898874337.png

The metastore I want to delete is the first one, and when I tried to delete it by using the following command:

>> databricks metastores delete <metastore_id>

I got the following error:

Error: ~\.databrickscfg does not contain workspace profiles; please create one by running 'databricks configure'

Milica-Panic
Databricks Employee
Databricks Employee
Delete the Metastore through API call. Don't do it if you are not ready to loose your UC!! You can:
  1. open the terminal
  2. install databricks cli
  3. do next commands:
    1. databricks auth login --host https://accounts.azuredatabricks.net/
    2. provide id of your account
    3. databricks account metastores list
    4. get the id of the metastore ( we also can get it from the link at the page of metastore)
    5. databricks account metastores get [metastoreid] -- to check if we found it
    6. databricks account metastores delete [metastoreid]
if you are not able to do this, you can try to delete the metastore assignment first:
  • databricks account metastore-assignments get {workspaceid]
  • databricks account metastore-assignments delete {workspaceid]

https://docs.databricks.com/aws/en/dev-tools/cli/install

sridharplv
Valued Contributor II

I am also facing similar issue @mbanxp . Will keep you posted if i am able to find RCA.

mbanxp
New Contributor III
I solved the issue by deleting all the asignments before deleting the metastore.

1. Access to Databricks CLI and authenticate
2. List metastores
>> databricks account metastores list

3. List wotrkspaces and check assignments
>> databricks account workspaces list
>> databricks account metastore-assignments get <workspace_id>


4. Delete assignments one by one
>> databricks account metastore-assignments delete <workspace_id> <metastore_id>

5. Force deletion of metastore because it still had some catalogs, credentials and different artifacts.
>> databricks account metastores delete <metastore_id> --force

View solution in original post