{"record":{"id":"7f83ee6a45cdf464","repo":"hyperledger/fabric","slug":"error-reading-chaincode-install-package-at-s","errorCode":null,"errorMessage":"error reading chaincode install package at %s","messagePattern":"error reading chaincode install package at (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/chaincode/persistence/persistence.go","lineNumber":198,"sourceCode":"\n// Load loads a persisted chaincode install package bytes with\n// the given packageID.\nfunc (s *Store) Load(packageID string) ([]byte, error) {\n\tccInstallPkgPath := filepath.Join(s.Path, CCFileName(packageID))\n\n\texists, err := s.ReadWriter.Exists(ccInstallPkgPath)\n\tif err != nil {\n\t\treturn nil, errors.Wrapf(err, \"could not determine whether chaincode install package '%s' exists\", packageID)\n\t}\n\tif !exists {\n\t\treturn nil, &CodePackageNotFoundErr{\n\t\t\tPackageID: packageID,\n\t\t}\n\t}\n\n\tccInstallPkg, err := s.ReadWriter.ReadFile(ccInstallPkgPath)\n\tif err != nil {\n\t\terr = errors.Wrapf(err, \"error reading chaincode install package at %s\", ccInstallPkgPath)\n\t\treturn nil, err\n\t}\n\n\treturn ccInstallPkg, nil\n}\n\n// Delete deletes a persisted chaincode.  Note, there is no locking,\n// so this should only be performed if the chaincode has already\n// been marked built.\nfunc (s *Store) Delete(packageID string) error {\n\tccInstallPkgPath := filepath.Join(s.Path, CCFileName(packageID))\n\treturn s.ReadWriter.Remove(ccInstallPkgPath)\n}\n\n// CodePackageNotFoundErr is the error returned when a code package cannot\n// be found in the persistence store\ntype CodePackageNotFoundErr struct {\n\tPackageID string","sourceCodeStart":180,"sourceCodeEnd":216,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/core/chaincode/persistence/persistence.go#L180-L216","documentation":"Store.Load successfully confirmed the package file exists but ReadWriter.ReadFile failed reading it; the error is wrapped with 'error reading chaincode install package at %s'. The launch/build of the chaincode fails.","triggerScenarios":"Calling Load(packageID) when the file exists per Exists() but open/read fails: permission change between check and read, corrupted storage, truncated file on a full disk.","commonSituations":"File perms altered by backup/restore tooling; partially written package after an earlier disk-full save; NFS stale handle on network storage.","solutions":["Fix read permissions on the package file/dir for the peer user","Re-install the chaincode package (peer lifecycle chaincode install) to rewrite a corrupt/truncated file","Check storage health (disk errors, NFS state) in the wrapped cause","Restore from backup if the package was damaged by admin tooling"],"exampleFix":"// before (corrupt file)\n$ peer lifecycle chaincode queryinstalled  # works, but build fails\n// after\n$ peer lifecycle chaincode install repaired-pkg.tgz","handlingStrategy":"validation","validationCode":"p := filepath.Join(storePath, persistence.CCFileName(packageID))\nf, err := os.Open(p); if err != nil { return err }; defer f.Close()\nif _, err := io.ReadFull(f, make([]byte, 1)); err != nil { return fmt.Errorf(\"unreadable: %w\", err) }","typeGuard":null,"tryCatchPattern":"pkg, err := store.Load(packageID)\nif err != nil && strings.Contains(err.Error(), \"error reading chaincode install package\") {\n  // repair by re-installing the package\n}","preventionTips":["Avoid manual file manipulation inside the chaincodes directory","Re-install packages after backup restores","Keep peer user ownership on package files"],"tags":["filesystem","read-failed","fabric","chaincode"],"backgroundTag":"file-read-failed","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"}