"Project key is already used", but I cannot find it
Hello, I am trying to duplicate a project and have set a new project key "NEW_KEY" for the copy. When I try this I get the following error:
Project key NEW_KEY is already used. Please check that you have not already imported this project.
Since the message states the project already exists I tried accessing it (via the URL /projects/NEW_KEY). This gave me the message below. I do not believe I am missing permissions as I have admin rights so I think there is something going wrong.
I cannot delete the project via the API because it cannot find the project using the key, but I also cannot create a project with the key because that gives me the first error message saying the key is already in use.
Is there a way for me to delete this key and create the project still? Many thanks to anyone who might be able to help out!
Operating system used: Windows
Answers
-
Turribeach Dataiku DSS Core Designer, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023 Posts: 2,112 Neuron
There are a couple of things that could be going on here:
- Project Keys are case sensitive. You are doing some case changes to the project key. Use the correct case for your project key. If in doubt check your [dss data dir]/config/projects folder in the DSS machine
- You think you are an admin but you actually are not. Or you are using an API key in your API calls which is not an admin. Check if you are really an admin. The code below will only work if you are an admin or are using an Admin API key:
import dataiku
client = dataiku.api_client()
client.list_global_api_keys(as_type='listitems') -
Thanks for the response. The code you provided does not give an error but returns an empty list, does this mean I am not using an admin API key? If so how do you specify an admin API key?
Regarding the case sensitivity, how do you know if my project key has the incorrect case? If I search for the project in the project overview it does not show up, and this search seems to be case-insensitive. This could still be because of admin permissions though -
Turribeach Dataiku DSS Core Designer, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023 Posts: 2,112 Neuron
If you can run the code snippet then you are an admin. Have you checked your [dss data dir]/config/projects folder in the DSS machine? This will give you the correct case of the project key. You can also check all project keys using this code snippet:
import dataiku client = dataiku.api_client() project_keys = client.list_project_keys() for project_key in project_keys: print(project_key)
-
In that case I can confirm I am indeed an admin. I used the code to print all project_keys and the NEW_KEY is not listed there. Since I cannot create a project using that key I assume something is going wrong. I imagine I do not have a way to drop this project key via the API, what do you think?
If so the only option might be deleting it by removing the folder within the DSS machine, would that be correct?