{"record":{"id":"7550be435054a138","repo":"influxdata/influxdb","slug":"field-family-id-and-name-don-t-exist","errorCode":null,"errorMessage":"field family ID and name don't exist","messagePattern":"field family ID and name don't exist","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"influxdb3_catalog/src/catalog/versions/v2/update.rs","lineNumber":1719,"sourceCode":"                if let Some(ffd) = self.table.field_families.get_by_name(family_name) {\n                    if ffd.fields.len() >= NUM_FIELDS_PER_FAMILY_LIMIT {\n                        return Err(CatalogError::TooManyFields {\n                            field_family: family_name.to_string(),\n                            limit: NUM_FIELDS_PER_FAMILY_LIMIT,\n                        });\n                    }\n                    ffd.id\n                } else {\n                    self.check_field_family_limit()?;\n                    // create a new field family\n                    let id = self.table.field_families.get_and_increment_next_id();\n                    let name = FieldFamilyName::User(family_name.into());\n                    let def = FieldFamilyDefinition::new(id, name.clone());\n\n                    self.table\n                        .field_families\n                        .insert(id, Arc::new(def))\n                        .expect(\"field family ID and name don't exist\");\n\n                    self.field_family_definitions\n                        .push(FieldFamilyDefinitionLog { id, name });\n\n                    id\n                }\n            }\n        };\n\n        let col_id = self.next_legacy_column_id()?;\n        let field_col = {\n            let ffd_arc = self\n                .table\n                .field_families\n                .get_mut_by_id(&ff_id)\n                .expect(\"field family name exists\");\n\n            // Use `Arc::make_mut` because `TableTransaction`s are created via cloning","sourceCodeStart":1701,"sourceCodeEnd":1737,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/influxdb3_catalog/src/catalog/versions/v2/update.rs#L1701-L1737","documentation":"Panic from `.expect(\"field family ID and name don't exist\")` after inserting a new `FieldFamilyDefinition` into `self.table.field_families` in the v2 catalog update code. The insert can only fail if a field family with the same id or name already exists, which the transaction logic rules out by construction (fresh id allocation plus the field-family log). Its presence indicates catalog state inconsistency.","triggerScenarios":"Creating/adding a field family whose generated id or `FieldFamilyName::User(name)` already exists in `table.field_families` — e.g. replaying a create-field-family op twice, or two user field families sharing the same name due to corrupted log entries.","commonSituations":"Catalog WAL replay after crash where the same op is applied twice; user-specified family name colliding with an existing one when the pre-check was skipped in a custom/bypass code path; merged or hand-edited catalog files.","solutions":["Ensure the field family creation op is not duplicated in the catalog log/batch being applied.","Check that user-supplied field family names are checked for existence before creating a new family.","Restore the catalog from a snapshot taken before the duplicate write.","Report to influxdb3 maintainers with the failing batch if reached via supported APIs."],"exampleFix":"// before\nself.table.field_families.insert(id, Arc::new(def)).expect(\"field family ID and name don't exist\");\n// after\nif self.table.field_families.contains_key(&id) {\n    return Err(Error::DuplicateFieldFamily { table: self.table.name.clone(), id });\n}\nself.table.field_families.insert(id, Arc::new(def)).expect(\"field family ID and name don't exist\");","handlingStrategy":"validation","validationCode":"// Check family name/id uniqueness before creating\nif table_def.field_families.values().any(|f| f.name == requested_name) {\n    return existing_family_id; // reuse instead of creating\n}","typeGuard":"fn family_exists(table: &TableDefinition, name: &str) -> bool {\n    table.field_families.values().any(|f| f.name.to_string() == name)\n}","tryCatchPattern":null,"preventionTips":["Look up a field family by name before creating a new one with the same name.","Keep create-field-family ops unique per sequence number in the WAL.","Don't hand-edit catalog files; use the catalog APIs for all changes."],"tags":["influxdb3","catalog","panic","field-family","duplicate-key"],"backgroundTag":"internal-invariant-violation","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"}