{"record":{"id":"7c89bc24af3ebc93","repo":"influxdata/influxdb","slug":"token-name-already-exists-0","errorCode":null,"errorMessage":"token name already exists, {0}","messagePattern":"token name already exists, (.+?)","errorType":"error_code","errorClass":"CatalogError","httpStatus":null,"severity":"error","filePath":"influxdb3_catalog/src/error.rs","lineNumber":282,"sourceCode":"    #[error(\"failed to parse trigger from {}\", trigger_spec)]\n    ProcessingEngineTriggerSpecParseError { trigger_spec: String },\n\n    #[error(\"last cache size must be greater than 0\")]\n    InvalidLastCacheSize,\n\n    #[error(\"failed to parse trigger from {trigger_spec}{}\", .context.as_ref().map(|context| format!(\": {context}\")).unwrap_or_default())]\n    TriggerSpecificationParseError {\n        trigger_spec: String,\n        context: Option<String>,\n    },\n\n    #[error(\"invalid error behavior {0}\")]\n    InvalidErrorBehavior(String),\n\n    #[error(\"cannot parse token permission, {0}\")]\n    CannotParsePermissionForToken(String),\n\n    #[error(\"token name already exists, {0}\")]\n    TokenNameAlreadyExists(String),\n\n    #[error(\"token hash already exists\")]\n    TokenHashAlreadyExists,\n\n    #[error(\"missing admin token, cannot update\")]\n    MissingAdminTokenToUpdate,\n\n    #[error(\"cannot delete internal db\")]\n    CannotDeleteInternalDatabase,\n\n    #[error(\"cannot modify internal db\")]\n    CannotModifyInternalDatabase,\n\n    #[error(\"tried to stop a node ({node_id}) that is already stopped\")]\n    NodeAlreadyStopped { node_id: Arc<str> },\n\n    #[error(","sourceCodeStart":264,"sourceCodeEnd":300,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/influxdb3_catalog/src/error.rs#L264-L300","documentation":"This error is thrown when attempting to create a new API token whose name collides with an existing token name in the catalog. Token names are unique, and the offending requested name is included in the message.","triggerScenarios":"Calling token-creation APIs (e.g. `create_token`) or the `influxdb3 create token` command with a name that already exists in the catalog.","commonSituations":"Re-running provisioning scripts without changing token names; forgetting a previously created token with the same name; CI pipelines generating tokens with fixed names.","solutions":["Choose a unique token name (the message names the conflicting one)","List existing tokens and delete/rename the old one if it is no longer needed","Make scripted token names unique (timestamp or run ID suffix)","Reuse the existing token's credentials instead of creating a duplicate"],"exampleFix":"// before\ncreate_token(\"ci-token\", permissions)?;\n// after\nlet name = format!(\"ci-token-{}\", chrono::Utc::now().timestamp());\ncreate_token(&name, permissions)?;","handlingStrategy":"try-catch","validationCode":"fn token_name_available(catalog: &Catalog, name: &str) -> bool {\n    !catalog.iter_tokens().any(|t| t.name == name)\n}","typeGuard":null,"tryCatchPattern":"match create_token(name, perms) {\n    Err(CatalogError::TokenNameAlreadyExists(existing)) => {\n        // reuse existing token or pick a new name\n    },\n    r => r,\n}","preventionTips":["Check existing token names before creating","Generate names with run-id/timestamp suffixes in automation","Centralize token creation so names are tracked"],"tags":["catalog","auth","tokens","naming-conflict"],"backgroundTag":"file-already-exists","analyzedSha":"06200ef96ba82c5f6727e5038a83af8e722c6875","analyzedAt":"2026-09-19T12:55:30.003Z","contentChangedAt":"2026-09-19T12:55:30.003Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}