{"record":{"id":"2eb67113ce7c265f","repo":"hyperledger/fabric","slug":"fabric-cfg-path-s-does-not-exist","errorCode":null,"errorMessage":"FABRIC_CFG_PATH %s does not exist","messagePattern":"FABRIC_CFG_PATH (.+?) does not exist","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/config/config.go","lineNumber":98,"sourceCode":"\nconst OfficialPath = \"/etc/hyperledger/fabric\"\n\n// ----------------------------------------------------------------------------------\n// InitViper()\n// ----------------------------------------------------------------------------------\n// Performs basic initialization of our viper-based configuration layer.\n// Primary thrust is to establish the paths that should be consulted to find\n// the configuration we need.  If v == nil, we will initialize the global\n// Viper instance\n// ----------------------------------------------------------------------------------\nfunc InitViper(v *viper.Viper, configName string) error {\n\taltPath := os.Getenv(\"FABRIC_CFG_PATH\")\n\tif altPath != \"\" {\n\t\t// If the user has overridden the path with an envvar, its the only path\n\t\t// we will consider\n\n\t\tif !dirExists(altPath) {\n\t\t\treturn fmt.Errorf(\"FABRIC_CFG_PATH %s does not exist\", altPath)\n\t\t}\n\n\t\tAddConfigPath(v, altPath)\n\t} else {\n\t\t// If we get here, we should use the default paths in priority order:\n\t\t//\n\t\t// *) CWD\n\t\t// *) /etc/hyperledger/fabric\n\n\t\t// CWD\n\t\tAddConfigPath(v, \"./\")\n\n\t\t// And finally, the official path\n\t\tif dirExists(OfficialPath) {\n\t\t\tAddConfigPath(v, OfficialPath)\n\t\t}\n\t}\n","sourceCodeStart":80,"sourceCodeEnd":116,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/core/config/config.go#L80-L116","documentation":"Raised during InitViper when the configured FABRIC_CFG_PATH directory does not exist on disk (the alternative branch reports a non-directory). It means viper cannot be pointed at a real config directory, so core.yaml and peers' configuration cannot be located — typically FABRIC_CFG_PATH is unset in a non-default install or points to a wrong/typo'd path.","triggerScenarios":"Thrown at core/config/config.go:98 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set FABRIC_CFG_PATH to a valid directory containing the config files","Create the directory and supply a core.yaml","Fall back to the official path /etc/hyperledger/fabric"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}