{"record":{"id":"9fd83c1ff85cc650","repo":"hyperledger/fabric","slug":"policy-s-at-path-s-has-unknown-policy-type-v","errorCode":null,"errorMessage":"policy %s at path %s has unknown policy type: %v","messagePattern":"policy (.+?) at path (.+?) has unknown policy type: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"common/policies/policy.go","lineNumber":219,"sourceCode":"\tpolicies := make(map[string]Policy)\n\tfor policyName, configPolicy := range root.Policies {\n\t\tpolicy := configPolicy.Policy\n\t\tif policy == nil {\n\t\t\treturn nil, fmt.Errorf(\"policy %s at path %s was nil\", policyName, path)\n\t\t}\n\n\t\tvar cPolicy Policy\n\n\t\tif policy.Type == int32(cb.Policy_IMPLICIT_META) {\n\t\t\timp, err := NewImplicitMetaPolicy(policy.Value, managers)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, errors.Wrapf(err, \"implicit policy %s at path %s did not compile\", policyName, path)\n\t\t\t}\n\t\t\tcPolicy = imp\n\t\t} else {\n\t\t\tprovider, ok := providers[policy.Type]\n\t\t\tif !ok {\n\t\t\t\treturn nil, fmt.Errorf(\"policy %s at path %s has unknown policy type: %v\", policyName, path, policy.Type)\n\t\t\t}\n\n\t\t\tvar err error\n\t\t\tcPolicy, _, err = provider.NewPolicy(policy.Value)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, errors.Wrapf(err, \"policy %s at path %s did not compile\", policyName, path)\n\t\t\t}\n\t\t}\n\n\t\tpolicies[policyName] = cPolicy\n\n\t\tlogger.Debugf(\"Proposed new policy %s for %s\", policyName, path)\n\t}\n\n\tfor groupName, manager := range managers {\n\t\tfor policyName, policy := range manager.Policies {\n\t\t\tpolicies[groupName+PathSeparator+policyName] = policy\n\t\t}","sourceCodeStart":201,"sourceCodeEnd":237,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/common/policies/policy.go#L201-L237","documentation":"For non-implicit-meta policies, NewManagerImpl looks up the registered provider by policy.Type (e.g. signature type). If no provider is registered for that type code, the policy cannot be built and this error names the type value.","triggerScenarios":"Calling NewManagerImpl with a providers map lacking an entry for the numeric policy.Type stored in config, e.g. a policy with type 1 (signature) but no SignaturePolicy provider registered, or a type introduced by a newer Fabric version than the running code.","commonSituations":"Custom/extension policy types not supported by the bundled managers; version mismatch where config was created by newer Fabric tooling; incorrect Type field written by config generation tools.","solutions":["Register a provider for the policy type in the providers map passed to NewManagerImpl","Change the policy type in config to a supported one (IMPLICIT_META or the signature type with a registered provider)","Align Fabric tooling/runtime versions so the policy type is recognized"],"exampleFix":"// before\nNewManagerImpl(root, \"\", map[int32]Provider{})\n// after\nNewManagerImpl(root, \"\", map[int32]Provider{int32(cb.Policy_SIGNATURE): &cauthdsl.Provider{}})","handlingStrategy":"validation","validationCode":"for _, p := range configPolicies {\n  if _, ok := providers[p.Type]; !ok {\n    return fmt.Errorf(\"no provider registered for policy type %d\", p.Type)\n  }\n}","typeGuard":null,"tryCatchPattern":"mgr, err := policies.NewManagerImpl(root, path, providers)\nif err != nil && strings.Contains(err.Error(), \"unknown policy type\") {\n  return fmt.Errorf(\"register or map the policy type before building the manager: %w\", err)\n}","preventionTips":["Register providers for every policy type your config may contain","Avoid custom policy types unless you also ship a provider","Keep Fabric tooling and runtime versions aligned"],"tags":["hyperledger-fabric","channel-config","policy-provider"],"backgroundTag":"unknown-policy-type","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"}