hyperledger/fabric · error

failed obtaining information about %s, version %s

Error message

failed obtaining information about %s, version %s

What it means

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.

Source

Thrown at core/common/ccprovider/ccprovider.go:225

		// Skip directories, we're only interested in normal files
		if f.IsDir() {
			continue
		}
		// A chaincode file name is of the type "name.version"
		// We're only interested in the name.
		// Skip files that don't adhere to the file naming convention of "A.B"
		i := strings.Index(f.Name(), ".")
		if i == -1 {
			ccproviderLogger.Info("Skipping", f.Name(), "because of missing separator '.'")
			continue
		}
		ccName := f.Name()[:i]      // Everything before the separator
		ccVersion := f.Name()[i+1:] // Everything after the separator

		ccPackage, err := ccFromPath(ccName+":"+ccVersion, dir, cifs.GetHasher)
		if err != nil {
			ccproviderLogger.Warning("Failed obtaining chaincode information about", ccName, ccVersion, ":", err)
			return nil, errors.Wrapf(err, "failed obtaining information about %s, version %s", ccName, ccVersion)
		}

		chaincodes = append(chaincodes, chaincode.InstalledChaincode{
			Name:    ccName,
			Version: ccVersion,
			Hash:    ccPackage.GetId(),
		})
	}
	ccproviderLogger.Debug("Returning", chaincodes)
	return chaincodes, nil
}

// ccInfoFSStorageMgr is the storage manager used either by the cache or if the
// cache is bypassed
var ccInfoFSProvider = &CCInfoFSImpl{GetHasher: factory.GetDefault()}

// ccInfoCache is the cache instance itself
var ccInfoCache = NewCCInfoCache(ccInfoFSProvider)

View on GitHub (pinned to 2736b63f8f)

Solutions

  1. Identify the offending package file from the wrapped error and reinstall it with 'peer chaincode install'
  2. Remove the corrupt 'name:version' file from the chaincodes directory if the chaincode is no longer needed
  3. Verify all peers run the same Fabric version and packages were not hand-copied between versions
  4. Validate the file content manually before re-listing installed chaincodes

Example fix

// before
$ rm nothing  # ignoring the corrupt file
// after
$ peer chaincode install mycc.1.0.pkg   # reinstall the corrupt package
# or: rm /var/hyperledger/production/chaincodes/badcc:1.0
Defensive patterns

Strategy: validation

Validate before calling

// pre-scan for files that fail to parse before calling the API
for _, f := range files {
    if _, err := ccprovider.GetCCPackage(readBytes(f), cifs.GetHasher); err != nil {
        log.Printf("corrupt package file %s: %v", f.Name(), err)
    }
}

Type guard

func looksLikeNameVersion(fname string) bool {
    i := strings.IndexByte(fname, ':')
    return i > 0 && i < len(fname)-1
}

Try / catch

chaincodes, err := ccprovider.ListInstalledChaincodes()
if err != nil {
    if strings.Contains(err.Error(), "failed obtaining information about") {
        // extract name/version from the message and quarantine that file
        return quarantineCorruptPackage(err)
    }
    return err
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of hyperledger/fabric@2736b63f8f (2026-09-04). Data as JSON: /api/errors/71e7d10d8c662ea5. Report an issue: GitHub.