{"record":{"id":"36244aed20096045","repo":"influxdata/influxdb","slug":"field-family-name-exists","errorCode":null,"errorMessage":"field family name exists","messagePattern":"field family name exists","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"influxdb3_catalog/src/catalog/versions/v2/update.rs","lineNumber":1735,"sourceCode":"                        .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\n            // `TableDefinition`s.\n            let ffd = Arc::make_mut(ffd_arc);\n            let id = FieldIdentifier::new(ffd.id, ffd.fields.get_and_increment_next_id());\n            let field_col = Arc::new(FieldColumn::new(id, col_id, name.as_ref(), data_type));\n            ffd.fields\n                .insert(id.1, Arc::clone(&field_col))\n                .expect(\"field does not exist\");\n            field_col\n        };\n        self.table.field_count += 1;\n\n        let col_def = ColumnDefinition::Field(Arc::clone(&field_col));\n        self.table\n            .columns\n            .insert(col_def.clone())\n            .expect(\"no duplicate column\");","sourceCodeStart":1717,"sourceCodeEnd":1753,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/influxdb3_catalog/src/catalog/versions/v2/update.rs#L1717-L1753","documentation":"Panic from `.expect(\"field family name exists\")` on `self.table.field_families.get_mut_by_id(&ff_id)` while adding a field column in the v2 catalog update path. Unlike the other expects, this one is a lookup: it fires when the field family id given to add_field_column is NOT present in the table. The caller (or the preceding auto-family allocation step) is expected to have guaranteed the family exists.","triggerScenarios":"Calling add_field_column with an ff_id that was never inserted into `table.field_families`, or referencing a field family that was dropped/renamed between allocating the id and using it; also possible if the auto-field-family id points at a family missing from the map.","commonSituations":"Partially applied catalog batches where the family definition op failed but field-add ops remain; catalogs restored from snapshots where field_families were not fully loaded; custom code passing stale family ids.","solutions":["Verify the ff_id comes from an existing family — re-fetch the family id via the table's field_families rather than caching it.","Rebuild the table definition from the full catalog log so the field-family definition op is applied before field-add ops.","Restore the catalog from a consistent snapshot.","If triggered by the auto field family path, check that auto_field_family always points to a valid family id."],"exampleFix":"// before\nlet ffd_arc = self.table.field_families.get_mut_by_id(&ff_id).expect(\"field family name exists\");\n// after\nlet ffd_arc = self.table.field_families.get_mut_by_id(&ff_id)\n    .ok_or_else(|| Error::FieldFamilyNotFound { table: self.table.name.clone(), id: ff_id })?;","handlingStrategy":"validation","validationCode":"// Confirm the family id is live before adding a field to it\nif table_def.field_families.get_by_id(&ff_id).is_none() {\n    return Err(\"field family missing; re-fetch id from table definition\");\n}","typeGuard":"fn family_is_present(table: &TableDefinition, id: &FieldFamilyId) -> bool {\n    table.field_families.get_by_id(id).is_some()\n}","tryCatchPattern":null,"preventionTips":["Always fetch ff_id fresh from the table definition; never cache it across transactions.","Apply family-definition ops before field-add ops when replaying logs.","Verify auto_field_family points to a family present in field_families."],"tags":["influxdb3","catalog","panic","field-family","missing-entity"],"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"}