{"record":{"id":"71e7d10d8c662ea5","repo":"hyperledger/fabric","slug":"failed-obtaining-information-about-s-version-s","errorCode":null,"errorMessage":"failed obtaining information about %s, version %s","messagePattern":"failed obtaining information about (.+?), version (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/common/ccprovider/ccprovider.go","lineNumber":225,"sourceCode":"\t\t// Skip directories, we're only interested in normal files\n\t\tif f.IsDir() {\n\t\t\tcontinue\n\t\t}\n\t\t// A chaincode file name is of the type \"name.version\"\n\t\t// We're only interested in the name.\n\t\t// Skip files that don't adhere to the file naming convention of \"A.B\"\n\t\ti := strings.Index(f.Name(), \".\")\n\t\tif i == -1 {\n\t\t\tccproviderLogger.Info(\"Skipping\", f.Name(), \"because of missing separator '.'\")\n\t\t\tcontinue\n\t\t}\n\t\tccName := f.Name()[:i]      // Everything before the separator\n\t\tccVersion := f.Name()[i+1:] // Everything after the separator\n\n\t\tccPackage, err := ccFromPath(ccName+\":\"+ccVersion, dir, cifs.GetHasher)\n\t\tif err != nil {\n\t\t\tccproviderLogger.Warning(\"Failed obtaining chaincode information about\", ccName, ccVersion, \":\", err)\n\t\t\treturn nil, errors.Wrapf(err, \"failed obtaining information about %s, version %s\", ccName, ccVersion)\n\t\t}\n\n\t\tchaincodes = append(chaincodes, chaincode.InstalledChaincode{\n\t\t\tName:    ccName,\n\t\t\tVersion: ccVersion,\n\t\t\tHash:    ccPackage.GetId(),\n\t\t})\n\t}\n\tccproviderLogger.Debug(\"Returning\", chaincodes)\n\treturn chaincodes, nil\n}\n\n// ccInfoFSStorageMgr is the storage manager used either by the cache or if the\n// cache is bypassed\nvar ccInfoFSProvider = &CCInfoFSImpl{GetHasher: factory.GetDefault()}\n\n// ccInfoCache is the cache instance itself\nvar ccInfoCache = NewCCInfoCache(ccInfoFSProvider)","sourceCodeStart":207,"sourceCodeEnd":243,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/core/common/ccprovider/ccprovider.go#L207-L243","documentation":"After listing the install directory, ListInstalledChaincodes parses each 'name:version' file back into a chaincode package via ccFromPath. If a package file cannot be unmarshaled/validated, the failure is wrapped as 'failed obtaining information about <name>, version <version>'. It means one installed package file is corrupt or not a valid chaincode package.","triggerScenarios":"A file in the install directory named 'name:version' fails ccFromPath — truncated/corrupted package bytes, a file written by a different Fabric version, or a manually created/misnamed file whose name parses as name:version but whose content is not a package.","commonSituations":"Disk full during install left a truncated package; operator copied files between peers with mismatched Fabric versions; leftover junk files containing ':' in the chaincodes directory.","solutions":["Identify the offending package file from the wrapped error and reinstall it with 'peer chaincode install'","Remove the corrupt 'name:version' file from the chaincodes directory if the chaincode is no longer needed","Verify all peers run the same Fabric version and packages were not hand-copied between versions","Validate the file content manually before re-listing installed chaincodes"],"exampleFix":"// before\n$ rm nothing  # ignoring the corrupt file\n// after\n$ peer chaincode install mycc.1.0.pkg   # reinstall the corrupt package\n# or: rm /var/hyperledger/production/chaincodes/badcc:1.0","handlingStrategy":"validation","validationCode":"// pre-scan for files that fail to parse before calling the API\nfor _, f := range files {\n    if _, err := ccprovider.GetCCPackage(readBytes(f), cifs.GetHasher); err != nil {\n        log.Printf(\"corrupt package file %s: %v\", f.Name(), err)\n    }\n}","typeGuard":"func looksLikeNameVersion(fname string) bool {\n    i := strings.IndexByte(fname, ':')\n    return i > 0 && i < len(fname)-1\n}","tryCatchPattern":"chaincodes, err := ccprovider.ListInstalledChaincodes()\nif err != nil {\n    if strings.Contains(err.Error(), \"failed obtaining information about\") {\n        // extract name/version from the message and quarantine that file\n        return quarantineCorruptPackage(err)\n    }\n    return err\n}","preventionTips":["Only install packages via official CLI/SDK, never hand-crafted files","Keep Fabric versions identical across peers","Ensure adequate disk space during installs to avoid truncation","Periodically validate packages instead of failing at list time"],"tags":["hyperledger-fabric","chaincode","corrupt-file","unmarshal"],"backgroundTag":"corrupt-chaincode-package","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"}