Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Deleted Space, want to set up again - Error: "a space with this space key already exists"

MJP March 26, 2013

1. I deleted a space.

2. I want to set up a new space (via a default space template) with the same name and the same SPACE KEY as the deleted one.

Confluence throws the error message "A space with this space key already exists".
(as in german language: "Es existiert bereits ein Bereich mit diesem Bereichsschlüssel.)

Note: I deleted the whole space, not only the space home page.

What can I do? The department needs their acronym as space key, I cannot just set any other name.

6 answers

1 accepted

2 votes
Answer accepted
MJP April 3, 2013

I am a little confused at the moment.

When I checked the spaces list on the dashboard one day later, there suddenly my deleted space reappeared.

I am 100% sure that I deleted the space (by the procedure explained in https://confluence.atlassian.com/display/DOC/Deleting+a+Space ).

All we did was flush the caches and wait one day.No messing with the database, no server reboot.

-----------------------

Well, I tried again and was able to successfully delete and set up the space again this time.
No problems with a duplicate space key...

Anyway, I would like to thank you for your help!

1 vote
Gail Stewart
Contributor
March 26, 2013

I have just recently created a jira project, then deleted it and re-created it, so in Jira you can do this.

Isaac Montes
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 26, 2013

You are right I believe that is the way it used to be. I've always had that idea.
Thanks for the update :)

0 votes
Matthew Jaffe
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 8, 2015

I got this error after deleting a project. What I later realized was that, even though I deleted the project, an Agile board for the project somehow stuck around. After I deleted the stray board, all worked as expected.

0 votes
MJP March 26, 2013

I would like to avoid messing with the database.

Just remembered that a restart of the server or flushing the caches might work...
I will try tomorrow.

Isaac Montes
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 26, 2013

Yes, I would defenitly try that before messing with DB.

0 votes
Isaac Montes
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 26, 2013

It's always best practice to create backups before deleting, you might be able to recover the space/space key that way, then go from there.

Another option is to go straight to the database and try to delete all records from that space, (is never recomended to mess with the db, even if you know what you are doing).

REMEMBER ALWAYS BACKUP BEFORE MAKING ANY CHANGES. BACKUP THE ENTIRE DB.

See: How to manually delete a space

If any of these things don't work you might also need to delete the space ID and KEY from the table. Have not tested that so if you try BACKUP!

0 votes
Rodrigo Girardi Adami
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 26, 2013
Hello MJP,

I heard some cases with the same problem that we are facing right now. Basically it seems that the spacekey is stuck in the database, and to fix this problem, we need to run the following SQL query, to see if the space still exist:

SELECT * FROM spaces;

If still exists, you can run a SQL statement to delete. But I highly suggest that you do a full backup of your instance before running any SQL query.

If that doesn't work, you might have to change the space name, due the special character: ü

This should do the trick.

Regards,
Rodrigo
Yogesh Mude
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 28, 2019

HI @Rodrigo Girardi Adami 

I tried to delete the space from db but it gives me below error...

Ran the below Query 

delete from spaces where spaceid = 31391745;

Error:

ERROR: update or delete on table "spaces" violates foreign key constraint "fklmweu06nft59g7mw1i1myorys" on table "content"
DETAIL: Key (spaceid)=(31391745) is still referenced from table "content".
********** Error **********

ERROR: update or delete on table "spaces" violates foreign key constraint "fklmweu06nft59g7mw1i1myorys" on table "content"
SQL state: 23503
Detail: Key (spaceid)=(31391745) is still referenced from table "content".

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events