{"record":{"id":"762072651667442b","repo":"hyperledger/fabric","slug":"not-a-valid-hasheddatans-s","errorCode":null,"errorMessage":"not a valid hashedDataNs [%s]","messagePattern":"not a valid hashedDataNs \\[(.+?)\\]","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/ledgerutil/identifytxs/identifytxs.go","lineNumber":488,"sourceCode":"\tif e.BlockNum == v.searchBlockLimit && e.TxNum == v.searchTxLimit {\n\t\terr = inputKeyMap.close(v)\n\t\tif err != nil {\n\t\t\treturn false, err\n\t\t}\n\t\tdelete(inputKeyMap, k)\n\t\t// Check if all keys have reached their height limit\n\t\tif len(inputKeyMap) == 0 {\n\t\t\treturn true, nil\n\t\t}\n\t}\n\treturn false, nil\n}\n\n// Exctracts namespace from snapshot namespace concatenation\nfunc decodeHashedNs(hashedDataNs string) (string, string, error) {\n\tstrs := strings.Split(hashedDataNs, nsJoiner+hashDataPrefix)\n\tif len(strs) != 2 {\n\t\treturn \"\", \"\", errors.Errorf(\"not a valid hashedDataNs [%s]\", hashedDataNs)\n\t}\n\treturn strs[0], strs[1], nil\n}\n","sourceCodeStart":470,"sourceCodeEnd":492,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/internal/ledgerutil/identifytxs/identifytxs.go#L470-L492","documentation":"decodeHashedNs expects a hashed namespace string of the form <namespace><nsJoiner>hashDataPrefix<hash-part>, concatenated by the snapshot private-data hashing logic. Splitting on that joiner must yield exactly two parts; otherwise the string is not a valid hashed namespace and the error is thrown.","triggerScenarios":"generateRecordsMap encountering a records-map key (hashedDataNs) that does not contain the expected separator+hash prefix — e.g. a plain (non-hashed) namespace, a differently formatted key, or corrupted/truncated input file data.","commonSituations":"Feeding the tool a records/verify output produced by a different Fabric version with different namespace concatenation, hand-edited JSON, or a mismatched collection config that changed how hashed namespaces were written.","solutions":["Confirm the input files were produced by the same Fabric version and tooling as verify/identifytxs","Do not modify the records JSON manually; regenerate it from the original snapshot","Ensure the namespace in question is actually a private/collection namespace and not a public one","Inspect the failing hashedDataNs value in the input file for missing separators or corruption"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"func looksLikeHashedNs(ns string, joiner, prefix string) bool {\n\tparts := strings.Split(ns, joiner+prefix)\n\treturn len(parts) == 2 && parts[1] != \"\"\n}","typeGuard":"func isHashedDataNs(s string) bool {\n\treturn strings.Count(s, nsJoiner+hashDataPrefix) == 1\n}","tryCatchPattern":"ns, hashPart, err := decodeHashedNs(key)\nif err != nil {\n\tlog.Warnf(\"skipping non-hashed namespace key %q\", key)\n\tcontinue\n}","preventionTips":["Only feed records files generated by the matching Fabric version","Never hand-edit snapshot/records JSON keys","Check that the key actually belongs to a private data collection namespace before decoding"],"tags":["hyperledger-fabric","namespace","parsing","snapshot"],"backgroundTag":"invalid-namespace-format","analyzedSha":"2736b63f8fd5932511d56fe68b7039d15977f7f6","analyzedAt":"2026-09-04T08:52:36.465Z","contentChangedAt":"2026-09-04T08:52:36.465Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}