{"record":{"id":"01a1b845045a1f2d","repo":"influxdata/influxdb","slug":"resource-with-id-id-already-exists","errorCode":null,"errorMessage":"{resource} with id {id} already exists","messagePattern":"(.+?) with id (.+?) already exists","errorType":"exception","errorClass":"RepositoryError","httpStatus":null,"severity":"error","filePath":"influxdb3_catalog/src/repository.rs","lineNumber":23,"sourceCode":"\nuse std::cmp::Ordering;\nuse std::sync::Arc;\n\nuse ahash::RandomState as AHashBuilder;\nuse influxdb3_id::{CatalogId, SerdeVecMap};\n\nuse crate::CatalogError;\nuse crate::catalog::BiHashMap;\nuse crate::resource::CatalogResource;\n\n/// Error returned by [`Repository`] operations.\n///\n/// Carries the resource label (from [`CatalogResource::CATEGORY`]) and the\n/// offending `id` so the error message is self-identifying without requiring\n/// callers to add context.\n#[derive(thiserror::Error)]\npub enum RepositoryError<I: CatalogId> {\n    #[error(\"{resource} with id {id} already exists\")]\n    AlreadyExists { resource: &'static str, id: I },\n\n    #[error(\"{resource} with name '{name}' already exists\")]\n    AlreadyExistsByName {\n        resource: &'static str,\n        name: String,\n    },\n\n    #[error(\"{resource} with id {id} not found\")]\n    NotFound { resource: &'static str, id: I },\n\n    #[error(\"{resource} with name '{name}' not found\")]\n    NotFoundByName {\n        resource: &'static str,\n        name: String,\n    },\n}\n","sourceCodeStart":5,"sourceCodeEnd":41,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/influxdb3_catalog/src/repository.rs#L5-L41","documentation":"RepositoryError::AlreadyExists, a validation conflict returned by catalog Repository create/insert operations when an entity with the given id is already registered; `resource` carries the human-readable category (e.g. \"database\", \"table\") and `id` the offending key.","triggerScenarios":"Thrown at influxdb3_catalog/src/repository.rs:23 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check for the existing resource before creating, or use get-or-create semantics","Generate a fresh unique id instead of reusing a deterministic one","If the duplicate is expected, treat it as idempotent success"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}