---
# System prepended metadata

title: 合規API Error Code

---

# 合規API Error Code

When a predictable error occurs, the API Server will tend to add an error object in the responding JSON field like: 
```json
"error":{
  "code": 1001, 
  "message": "This project identifier has been taken."},
  "details": {
    "identifier": "taken-project"
  }
```
The `details` field will not exist if no detailed information is supplied.

Here is the table of error codes, where `$somevar` is a field in the `details` object.

|Error Code|English|中文|
|-|-|-|
|Projects|||
|1001|Project identifier `$identifier` has been taken.|專案代號 `$identifier` 已被使用。|
|1002|Project name `$name` is not legal. Project name may only contain lower cases, numbers, dash, and the heading must be an alphabet, trailing character should be alphanumeric, and should be 2 to 225 characters long.|專案代號 `$name` 違反命名規則。專案代號只能使用小寫字母、數字、減號，且頭必須是字母，尾不可為減號，且必須為 2 到 225 個字元。|
|1003|Project id `$project_id` not found.|找不到 ID 為 `$project_id` 的專案。|
|1004|Repository id `$repository_id` not found.|找不到 ID 為 `$repository_id` 的 repo。|
|1005|Project id `$project_id` does not exist in redmine.|ID 為 `$project_id` 的專案不存在於 redmine 中。|
|1006|Unable to delete the version.|無法刪除此版本。|
|1007|Unable to build the release (forced closed issue false).|無法進行版本釋出(強制關閉議題錯誤)。|
|1008|Unable to build the release.|無法進行版本釋出。|
|1009|Plugin Software not found.|插件軟體不存在。|
|1010|Project {$description or $display} `$description` or `$display` contain characters like & or <.|專案描述 or 顯示名稱 `$description` or `$display` 包含 & 或 < 字串。|
|1011|Project owner `$owner_id` role must be PM.|專案擁有者 `$owner_id` 的角色必須為PM。|
|1012|Fixed version status is `$fixed_version_status`.|版本的狀態為 locked/closed，無法新增/編輯議題。|
|Users||
|2001|User id `$user_id` not found.|找不到 ID 為 `$user_id` 的使用者。|
|2002|User name `$name` is not legal. The user name may only contain a-z, A-Z, 0-9, dot, dash, underline, and the heading and trailing character should be alphanumeric and should be 2 to 60 characters long.|使用者名稱 `$name` 違反命名規則。只能使用大寫字母、小寫字母、數字、減號、底線、句點，且頭尾必須是字母或數字，且必須為 2 到 60 個字元。|
|2003|Password is not legal. You can only use a-z, A-Z, 0-9, `!@#$%^&*()_+\|{}[]``~-=\'";:/?.>,<`, and should contain at least an upper case alphabet, a lower case alphabet, and a digit, and is 8 to 20 characters long.|密碼需要為 8 到 20 個字元長，且必須包含至少一個大寫字母，一個小寫字母，以及一個數字。|
|2004|Wrong password or username.|密碼或使用者帳號錯誤。|
|2005|The username or e-mail is already used.|此使用者名稱或電子郵件信箱已有人使用。|
|2006|The user `$user_id` is already in project `$project_id`.|使用者 `$user_id` 已經在專案 `$project_id` 內了。|
|2008|The user `$user_id` in a project, cannot change his role.|使用者 `$user_id` 有在專案內，無法變更其角色。|
|2011|The clusters `$server_name` cannot be attached.| 部屬主機 `$server_name` 無法被存取。|
|Permissions|||
|3001|The user doesn't have permission for this operation.|您的角色沒有權限進行此項操作。|
|3002|You need to be in the project for this operation.|您需要屬於此專案才能進行這項操作。|
|3003|You are not permitted to access another user's data.|您不被允許存取其他使用者的資料。|
|3004|Only PM can set it, please contact PM for assistance.|僅專案經理才可設置，請洽專案經理協助。|
|SampleFile|||
|4001|Cache SampleFile not found.|找不到快取範本檔案。|
|4002|SampleFile not found.|找不到範本檔案。|
|CheckList||
|5001|CheckList `$checklist_id` not found.|找不到查檢表範本 `$checklist_id`|
|5002|CheckListRule can not be edited when CheckList `$checklist_id` is in use.|當查檢表`$checklist_id` 被使用時，查檢表內容將無法被編輯。|
|5003|CheckList `$checklist_id` can not be downloaded when the CheckListRule is empty.|當沒有查檢表內容時，無法下載查檢表`$checklist_id`|
|Company|||
|6001|Already has this company `$company_name` .|公司已存在 `$company_name`|
|6002|Company not found `$company_id` .|找不到此公司 `$company_id`|
|6006|This user is already in the company `$company_id` `$user_id` .| 這個用戶已經加入此公司 `$company_id` `$user_id`|
|6007|This user is company owner in the company. `$company_id` `$user_id` .| 這個用戶是此家公司擁有者 `$company_id` `$user_id`|
|General|||
|7001|This error has no detailed information.|此錯誤不含詳細資訊。|
|7002|Argument `$arg` is incorrect.|參數 `$arg` 輸入錯誤。|
|7003|The indicated resource is not found.|找不到指定的資源。|
|7004|The requested URL is not found on this server. Please check if the path is correct.|找不到指定的網址。請確認你輸入了正確的路徑。|
|7005|Maximum number of `object` is `num`.|`object`的最大數量是`num`。|
|3rd party|||
|8001|`$service_name` error: `$response`|`$service_name` 回報錯誤：`$response`|
|Internal errors|||
|9001|Internal exception: `$type`: `$exception`|內部錯誤：`$type`: `$exception`|
|9003|An unexpected database error has occurred: `$message`|發生未被預期的資料庫錯誤：`$message`|
|9999|An unknown error has occurred.|發生未知錯誤。|