{"record":{"id":"bef1c1e8c4dae43e","repo":"hyperledger/fabric","slug":"could-not-determine-whether-chaincode-install-pack","errorCode":null,"errorMessage":"could not determine whether chaincode install package '%s' exists","messagePattern":"could not determine whether chaincode install package '(.+?)' exists","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/chaincode/persistence/persistence.go","lineNumber":188,"sourceCode":"\t}\n\n\tif err := s.ReadWriter.WriteFile(s.Path, ccInstallPkgFileName, ccInstallPkg); err != nil {\n\t\terr = errors.Wrapf(err, \"error writing chaincode install package to %s\", ccInstallPkgFilePath)\n\t\tlogger.Error(err.Error())\n\t\treturn \"\", err\n\t}\n\n\treturn packageID, nil\n}\n\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","sourceCodeStart":170,"sourceCodeEnd":206,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/core/chaincode/persistence/persistence.go#L170-L206","documentation":"Store.Load wraps errors from ReadWriter.Exists when it cannot determine whether the package file exists. This is not 'package not found' (that returns CodePackageNotFoundErr) — it means the existence check itself failed, typically an OS-level path/stat error.","triggerScenarios":"Calling Load(packageID) (e.g. during chaincode build/launch) when the filepath stat underlying Exists fails: path too long, permission denied on a parent directory, or I/O error.","commonSituations":"Directory permissions broken mid-flight; storage backend error on network volumes; packageID containing characters producing an invalid/overlong filename via CCFileName.","solutions":["Fix filesystem permissions on the chaincodes directory path","Retry Load after storage recovers if the error is transient I/O","Verify the packageID is a valid hash and resolves to a sane filename","If the package truly may be absent, handle CodePackageNotFoundErr separately from this wrap"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if _, err := os.Stat(filepath.Join(storePath, filename)); err != nil && !os.IsNotExist(err) { return fmt.Errorf(\"stat failed: %w\", err) }","typeGuard":null,"tryCatchPattern":"pkg, err := store.Load(packageID)\nif err != nil {\n  var nf *persistence.CodePackageNotFoundErr\n  if errors.As(err, &nf) { /* reinstall */ }\n  return fmt.Errorf(\"existence check failed: %w\", err)\n}","preventionTips":["Ensure parent dirs of the store are traversable (x bit) by the peer user","Keep packageIDs as produced by the library (valid hashes)","Monitor storage backend health"],"tags":["filesystem","io","fabric","lifecycle"],"backgroundTag":"stat-failed","analyzedSha":"2736b63f8fd5932511d56fe68b7039d15977f7f6","analyzedAt":"2026-09-04T08:52:36.465Z","contentChangedAt":"2026-09-04T08:52:36.465Z","schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}