{"record":{"id":"cb1cdf17c58f8f58","repo":"risingwavelabs/risingwave","slug":"fail-to-convert-version-hint-from-utf8-to-string","errorCode":null,"errorMessage":"Fail to convert version_hint from utf8 to string: {}","messagePattern":"Fail to convert version_hint from utf8 to string: (.+?)","errorType":"error_code","errorClass":"iceberg::Error(ErrorKind::DataInvalid)","httpStatus":null,"severity":"error","filePath":"src/connector/src/connector_common/iceberg/storage_catalog.rs","lineNumber":162,"sourceCode":"            .map_err(|err| {\n                Error::new(\n                    ErrorKind::DataInvalid,\n                    format!(\"check if version hint exist failed: {}\", err.as_report()),\n                )\n            })\n    }\n\n    /// Read version hint of table.\n    ///\n    /// `table_path`: relative path of table dir under warehouse root.\n    async fn read_version_hint(&self, table_path: &str) -> Result<i32> {\n        let content = self\n            .file_io\n            .new_input(format!(\"{table_path}/metadata/version-hint.text\").as_str())?\n            .read()\n            .await?;\n        let version_hint = String::from_utf8(content.to_vec()).map_err(|err| {\n            Error::new(\n                ErrorKind::DataInvalid,\n                format!(\n                    \"Fail to convert version_hint from utf8 to string: {}\",\n                    err.as_report()\n                ),\n            )\n        })?;\n\n        version_hint\n            .parse()\n            .map_err(|_| Error::new(ErrorKind::DataInvalid, \"parse version hint failed\"))\n    }\n\n    pub fn file_io(&self) -> &FileIO {\n        &self.file_io\n    }\n\n    fn table_path(&self, table: &TableIdent) -> String {","sourceCodeStart":144,"sourceCodeEnd":180,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/connector_common/iceberg/storage_catalog.rs#L144-L180","documentation":"When no metadata/version-hint.text check succeeds, the catalog reads that file's bytes and converts them to a UTF-8 string to get the current version number. If the bytes are not valid UTF-8, the read fails wrapped as DataInvalid with this message.","triggerScenarios":"read_version_hint loads <table_path>/metadata/version-hint.text via file_io and String::from_utf8 fails because the object contains binary data, an unexpected compression, or a corrupt/truncated write — reached from commit_table or load_table.","commonSituations":"Corrupted upload to the object store (partial/mangled version-hint.text); another tool writing the hint as UTF-16 or gzip; manual edits to metadata files.","solutions":["Inspect version-hint.text in the table's metadata/ directory and rewrite it as plain ASCII/UTF-8 containing only the version number.","Restore the file from a known-good backup or let the writer engine (e.g. Spark/Flink) rewrite the table metadata.","Check what process wrote the file — disable compression or non-UTF-8 encodings in that tool."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// pre-check: fetch version-hint.text and confirm it decodes as UTF-8 text\n// curl -s <storage>/db/table/metadata/version-hint.text | file -  => should be 'ASCII text'","typeGuard":null,"tryCatchPattern":"// Rust caller pattern\nmatch catalog.load_table(\"db.table\").await {\n    Err(e) if e.to_string().contains(\"Fail to convert version_hint from utf8\") => {\n        // repair/rewrite version-hint.text as UTF-8, then retry\n    }\n    other => other?,\n}","preventionTips":["Never edit metadata files by hand or upload them with compression/UTF-16.","Verify uploads to metadata/ with checksums after writer jobs run.","Restrict write access to table metadata directories to the writer engine only."],"tags":["iceberg","encoding","object-store","metadata"],"backgroundTag":"invalid-argument-format","analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}