{"record":{"id":"ff8b1d4f4da99092","repo":"influxdata/influxdb","slug":"error-converting-max-columns-per-table-0","errorCode":null,"errorMessage":"Error converting max_columns_per_table: {0}","messagePattern":"Error converting max_columns_per_table: (.+?)","errorType":"exception","errorClass":"ProtoV1AnyWithStorageError","httpStatus":null,"severity":"error","filePath":"core/data_types/src/lib.rs","lineNumber":476,"sourceCode":"            max_columns_per_table: value.max_columns_per_table.get_i32(),\n            partition_template: value.partition_template.as_proto().cloned(),\n            size_bytes: value.size_bytes,\n            table_count: value.table_count as i32,\n            deleted_at: value.deleted_at.map(google::Timestamp::from),\n        }\n    }\n}\n\n/// Errors converting from a catalog_storage proto v1 NamespaceWithStorage or TableWithStorage to\n/// [`NamespaceWithStorage`] or [`TableWithStorage`].\n#[derive(Debug, Error)]\npub enum ProtoV1AnyWithStorageError {\n    /// invalid value for MaxTables\n    #[error(\"Error converting max_tables: {0}\")]\n    MaxTables(ServiceLimitError),\n\n    /// invalid value for MaxColumnsPerTable\n    #[error(\"Error converting max_columns_per_table: {0}\")]\n    MaxColumnsPerTable(ServiceLimitError),\n\n    /// invalid value for PartitionTemplate\n    #[error(\"Error converting partition_template: {0}\")]\n    PartitionTemplate(ValidationError),\n}\n\nimpl TryFrom<catalog_storage_proto::NamespaceWithStorage> for NamespaceWithStorage {\n    type Error = ProtoV1AnyWithStorageError;\n\n    /// We require fallible conversion because generated protobuf structs can carry any i32\n    /// value for `max_tables` and `max_columns_per_table`, which is larger than the domain\n    /// `MaxTables` and `MaxColumnsPerTable` can represent (i.e. 0..=i32::MAX).\n    /// The `partition_template` can also be invalid.\n    fn try_from(value: catalog_storage_proto::NamespaceWithStorage) -> Result<Self, Self::Error> {\n        let max_tables =\n            MaxTables::try_from(value.max_tables).map_err(ProtoV1AnyWithStorageError::MaxTables)?;\n        let max_columns_per_table = MaxColumnsPerTable::try_from(value.max_columns_per_table)","sourceCodeStart":458,"sourceCodeEnd":494,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/core/data_types/src/lib.rs#L458-L494","documentation":"ProtoV1AnyWithStorageError::MaxColumnsPerTable is raised during conversion of a catalog-storage proto v1 NamespaceWithStorage/TableWithStorage when the max_columns_per_table field fails conversion into the ServiceLimit-bounded internal type — the stored value violates the column-count service limit.","triggerScenarios":"Converting a v1 proto whose max_columns_per_table is outside the accepted ServiceLimit range or otherwise invalid for the internal type.","commonSituations":"Namespace settings from an older or external writer with unsupported column limits; corrupted or hand-modified protos; limit policy changes between releases invalidating stored values.","solutions":["Correct the proto's max_columns_per_table to a value within the ServiceLimit range","Re-write the catalog storage object with valid limit values","Verify version compatibility between the data writer and the converting library version"],"exampleFix":"// before (proto)\nmax_columns_per_table: 0 // invalid\n// after\nmax_columns_per_table: 200 // valid service-limit value","handlingStrategy":"validation","validationCode":"fn max_columns_valid(v: i64, limit: i64) -> bool {\n    v > 0 && v <= limit\n}","typeGuard":null,"tryCatchPattern":"let ns = NamespaceWithStorage::try_from(proto).map_err(|e| match e {\n    ProtoV1AnyWithStorageError::MaxColumnsPerTable(src) => anyhow!(\"bad max_columns_per_table: {}\", src),\n    other => anyhow!(other),\n})?;","preventionTips":["Validate column limits against current ServiceLimit rules before persisting protos","Keep limit configuration consistent across services that write catalog data","Test proto round-trips for namespace/table settings in CI"],"tags":["rust","protobuf","catalog","conversion"],"backgroundTag":"value-out-of-range","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"}