之前開了一個 GCP 的 project 使用 Dialogflow 實作聊天機器人,而現在沒在使用後想刪除專案卻發生了以下錯誤,紀錄最後如何順利刪除專案的過程
錯誤訊息
Unable to delete project “camel-assistant”
Project “camel-assistant” has one or more liens on it to prevent accidental deletion. To delete the project, remove the liens first then try again.
解決方法
-
登入 GCP 並開啟 cloud shell
-
至 project setting 找到對應的
project_id
-
使用以下指令刪除 project 對應的專案
project_id
與資源name
gcloud config set project <your_project_id> # Updated property [core/project]. gcloud alpha resource-manager liens list # NAME: p375338413855-ld903cb93-c270-4d41-baaf-2054bac08cd1 # ORIGIN: You cannot delete this project because it is linked with a Dialogflow agent. Please follow the link to Dialogflow and delete the agent: https://console.dialogflow.com/api-client/#/agent/c70d94b3-7166-4bcd-a501-f654c08fbeb4/ # REASON: Deletion blocked by Dialogflow. gcloud alpha resource-manager liens delete <lien_name> # Deleted [liens/p375338413855-ld903cb93-c270-4d41-baaf-2054bac08cd1].
-
可以直接在 project setting 正常刪除專案了 🎉