{"record":{"id":"64eb3fb72e93a888","repo":"hyperledger/fabric","slug":"unknown-msp-type-s","errorCode":null,"errorMessage":"unknown MSP type '%s'","messagePattern":"unknown MSP type '(.+?)'","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"msp/configbuilder.go","lineNumber":165,"sourceCode":"\t\t\tbccspConfig.SW.FileKeystore.KeyStorePath == \"\" {\n\t\t\tbccspConfig.SW.FileKeystore = &factory.FileKeystoreOpts{KeyStorePath: keystoreDir}\n\t\t}\n\t}\n\n\treturn bccspConfig\n}\n\n// GetLocalMspConfigWithType returns a local MSP\n// configuration for the MSP in the specified\n// directory, with the specified ID and type\nfunc GetLocalMspConfigWithType(dir string, bccspConfig *factory.FactoryOpts, ID, mspType string) (*msp.MSPConfig, error) {\n\tswitch mspType {\n\tcase ProviderTypeToString(FABRIC):\n\t\treturn GetLocalMspConfig(dir, bccspConfig, ID)\n\tcase ProviderTypeToString(IDEMIX):\n\t\treturn idemix.GetIdemixMspConfig(dir, ID)\n\tdefault:\n\t\treturn nil, errors.Errorf(\"unknown MSP type '%s'\", mspType)\n\t}\n}\n\nfunc GetLocalMspConfig(dir string, bccspConfig *factory.FactoryOpts, ID string) (*msp.MSPConfig, error) {\n\tsigncertDir := filepath.Join(dir, signcerts)\n\tkeystoreDir := filepath.Join(dir, keystore)\n\tbccspConfig = SetupBCCSPKeystoreConfig(bccspConfig, keystoreDir)\n\n\terr := factory.InitFactories(bccspConfig)\n\tif err != nil {\n\t\treturn nil, errors.WithMessage(err, \"could not initialize BCCSP Factories\")\n\t}\n\n\tsigncert, err := getPemMaterialFromDir(signcertDir)\n\tif err != nil {\n\t\treturn nil, errors.Wrapf(err, \"could not load signing certificate from directory %s\", signcertDir)\n\t} else if len(signcert) == 0 {\n\t\treturn nil, errors.Errorf(\"no signing certificate found in directory %s\", signcertDir)","sourceCodeStart":147,"sourceCodeEnd":183,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/msp/configbuilder.go#L147-L183","documentation":"GetLocalMspConfigWithType builds local MSP config for a named provider type ('fabric', 'idemix'). This error means the configured mspType is not one of the known provider types, so no config builder exists for it.","triggerScenarios":"Calling GetLocalMspConfigWithType(dir, bccspConfig, ID, mspType) with a type string other than ProviderTypeToString(FABRIC) ('fabric') or ProviderTypeToString(IDEMIX) ('idemix') — e.g. via InitCrypto with a misconfigured msp.provider value.","commonSituations":"Setting CORE_LEDGER_STATE... or msp config 'mspType' to 'bccsp', 'softhsm', or a typo like 'fabrik'; copying config from a plugin example without registering a custom provider.","solutions":["Set the MSP type to 'fabric' (or 'idemix') in your config/env and retry","Check ProviderTypeToString output in this version — match case and spelling exactly","If using a custom BCCSP provider, configure it under bccsp config, not the MSP type","Upgrade or patch the library if you need a provider type it does not support"],"exampleFix":"// before\nmspConfig, err := GetLocalMspConfigWithType(dir, bccsp, \"Org1\", \"bccsp\")\n// after\nmspConfig, err := GetLocalMspConfigWithType(dir, bccsp, \"Org1\", \"fabric\")","handlingStrategy":"validation","validationCode":"const allowed = map[string]bool{\"fabric\": true, \"idemix\": true}\nif !allowed[strings.ToLower(mspType)] {\n    return fmt.Errorf(\"unsupported MSP type %q; use \\\"fabric\\\" or \\\"idemix\\\"\", mspType)\n}","typeGuard":"func isKnownMSPType(t string) bool { return t == \"fabric\" || t == \"idemix\" }","tryCatchPattern":"cfg, err := GetLocalMspConfigWithType(dir, bccsp, id, mspType)\nif err != nil && strings.Contains(err.Error(), \"unknown MSP type\") {\n    return fmt.Errorf(\"config mspType=%q invalid; expected fabric|idemix\", mspType)\n}","preventionTips":["Use the ProviderTypeToString constants instead of raw strings","Keep msp.provider values in sync with the library version you build against","Validate config files (YAML/JSON) against the fabric schema before deploy","Add a startup config sanity check listing accepted MSP types"],"tags":["msp","configuration","invalid-argument"],"backgroundTag":"invalid-config-value","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"}