{"record":{"id":"f0f920f64701d5be","repo":"hyperledger/fabric","slug":"organization-s-not-found","errorCode":null,"errorMessage":"organization %s not found","messagePattern":"organization (.+?) not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/configtxgen/main.go","lineNumber":147,"sourceCode":"\n\t\t\t\tif err := protolator.DeepMarshalJSON(os.Stdout, &ordererext.DynamicOrdererOrgGroup{ConfigGroup: og}); err != nil {\n\t\t\t\t\treturn errors.Wrapf(err, \"malformed org definition for org: %s\", org.Name)\n\t\t\t\t}\n\t\t\t\treturn nil\n\t\t\t}\n\n\t\t\t// Otherwise assume it is an Application OrgGroup, where the encoder is not strict whether anchor peers exist or not\n\t\t\tag, err := encoder.NewApplicationOrgGroup(org)\n\t\t\tif err != nil {\n\t\t\t\treturn errors.Wrapf(err, \"bad org definition for org %s\", org.Name)\n\t\t\t}\n\t\t\tif err := protolator.DeepMarshalJSON(os.Stdout, &peerext.DynamicApplicationOrgGroup{ConfigGroup: ag}); err != nil {\n\t\t\t\treturn errors.Wrapf(err, \"malformed org definition for org: %s\", org.Name)\n\t\t\t}\n\t\t\treturn nil\n\t\t}\n\t}\n\treturn errors.Errorf(\"organization %s not found\", printOrg)\n}\n\nfunc writeFile(filename string, data []byte, perm os.FileMode) error {\n\tdirPath := filepath.Dir(filename)\n\texists, err := dirExists(dirPath)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif !exists {\n\t\terr = os.MkdirAll(dirPath, 0o750)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn os.WriteFile(filename, data, perm)\n}\n\nfunc dirExists(path string) (bool, error) {","sourceCodeStart":129,"sourceCodeEnd":165,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/cmd/configtxgen/main.go#L129-L165","documentation":"In `doPrintOrg` (cmd/configtxgen/main.go:147), after scanning all Organizations in the loaded profile, none matched the name given via `-printOrg`. configtxgen exhausts the org list without finding a case-sensitive match and returns `organization <name> not found`.","triggerScenarios":"Running `configtxgen -printOrg SomeOrg` where SomeOrg does not exactly (case-sensitively) match any org's Name field under Organizations in the configtx.yaml profile, or when configtx.yaml/`FABRIC_CFG_PATH` points at a config that lacks the org entirely.","commonSituations":"Typo in the org name passed to -printOrg; wrong FABRIC_CFG_PATH so a different (default/empty) configtx.yaml is loaded; passing the org's MSP ID instead of its Name; org present in another profile section but not in Organizations.","solutions":["Verify the exact Name field of the org in configtx.yaml and pass it verbatim to -printOrg (match is exact, not fuzzy).","Ensure FABRIC_CFG_PATH points to the directory containing the intended configtx.yaml.","Do not confuse the org's MSP ID (`ID:`) with its `Name:` — -printOrg matches Name.","Run `configtxgen -printBlock` or inspect the profile to confirm the org is listed under Organizations."],"exampleFix":"// before\n$ configtxgen -profile MyProfile -printOrg PeerOrgMSP   // MSP ID, not Name -> not found\n// after\n$ configtxgen -profile MyProfile -printOrg PeerOrg      // matches 'Name: PeerOrg' in configtx.yaml","handlingStrategy":"validation","validationCode":"// Verify the org name exists before calling configtxgen\nimport yaml\ncfg = yaml.safe_load(open('configtx.yaml'))\nnames = [o['Name'] for o in cfg['Organizations']]\nif org_name not in names:\n    raise SystemExit(f\"org '{org_name}' not found; available: {names}\")","typeGuard":null,"tryCatchPattern":"out, err := exec.Command(\"configtxgen\", \"-profile\", profile, \"-printOrg\", orgName).CombinedOutput()\nif err != nil {\n\tif strings.Contains(string(out), \"not found\") {\n\t\treturn fmt.Errorf(\"check -printOrg name matches the 'Name:' field; FABRIC_CFG_PATH=%s; output: %s\", os.Getenv(\"FABRIC_CFG_PATH\"), out)\n\t}\n}","preventionTips":["Copy the org Name exactly from configtx.yaml — matching is case-sensitive and exact.","Set FABRIC_CFG_PATH explicitly to the directory holding your configtx.yaml.","Remember -printOrg takes the org Name, not the MSP ID.","Script org lookups from the parsed YAML instead of hardcoding names."],"tags":["hyperledger-fabric","configtxgen","config","not-found"],"backgroundTag":"resource-not-found","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"}