{"record":{"id":"672e0590b7f3c21e","repo":"hyperledger/fabric","slug":"failed-to-deserialize-values","errorCode":null,"errorMessage":"failed to deserialize values","messagePattern":"failed to deserialize values","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"common/channelconfig/application.go","lineNumber":44,"sourceCode":"\tACLs         *pb.ACLs\n\tCapabilities *cb.Capabilities\n}\n\n// ApplicationConfig implements the Application interface\ntype ApplicationConfig struct {\n\tapplicationOrgs map[string]ApplicationOrg\n\tprotos          *ApplicationProtos\n}\n\n// NewApplicationConfig creates config from an Application config group\nfunc NewApplicationConfig(appGroup *cb.ConfigGroup, mspConfig *MSPConfigHandler) (*ApplicationConfig, error) {\n\tac := &ApplicationConfig{\n\t\tapplicationOrgs: make(map[string]ApplicationOrg),\n\t\tprotos:          &ApplicationProtos{},\n\t}\n\n\tif err := DeserializeProtoValuesFromGroup(appGroup, ac.protos); err != nil {\n\t\treturn nil, errors.Wrap(err, \"failed to deserialize values\")\n\t}\n\n\tif !ac.Capabilities().ACLs() {\n\t\tif _, ok := appGroup.Values[ACLsKey]; ok {\n\t\t\treturn nil, errors.New(\"ACLs may not be specified without the required capability\")\n\t\t}\n\t}\n\n\tvar err error\n\tfor orgName, orgGroup := range appGroup.Groups {\n\t\tac.applicationOrgs[orgName], err = NewApplicationOrgConfig(orgName, orgGroup, mspConfig)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\treturn ac, nil\n}","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/common/channelconfig/application.go#L26-L62","documentation":"NewApplicationConfig deserializes each protobuf value in the Application config group via DeserializeProtoValuesFromGroup; any unmarshal failure for the application's embedded protos (policies, capabilities, ACLs, etc.) is wrapped as 'failed to deserialize values'.","triggerScenarios":"Building channel configuration through NewChannelConfig (or an anonymous config update handler) where a value under the Application group is corrupt, of the wrong proto type, or was serialized with an incompatible schema.","commonSituations":"Channel config blocks written by mismatched Fabric versions; manually edited configtx bytes; corrupted orderer-delivered blocks; a value registered under an ApplicationGroup key that does not match the expected message type.","solutions":["Inspect the wrapped error to find which proto key failed, then regenerate the channel configuration (configtxgen) with matching tooling versions","Ensure all Fabric peers/orderers producing config are on compatible versions","Validate application group values (Capabilities, ACLs, policies) with the same proto definitions before submitting config updates"],"exampleFix":"// before\nappGroup.Values[ACLsKey] = []byte(\"acls=read:true\") // not a proto message\n// after\nacls := &pb.ACLs{Resources: map[string]*pb.APIResource{\"read\": {PolicyRef: \"Admins\"}}}\nappGroup.Values[ACLsKey] = protoutil.MarshalOrPanic(acls)","handlingStrategy":"validation","validationCode":"for key, val := range appGroup.Values {\n    if len(val.Value) == 0 {\n        return fmt.Errorf(\"application group value %q is empty\", key)\n    }\n    // optionally probe-decode each key with its expected message type before NewChannelConfig\n}","typeGuard":null,"tryCatchPattern":"ac, err := NewApplicationConfig(appGroup, mspMgr)\nif err != nil {\n    if strings.Contains(err.Error(), \"failed to deserialize values\") {\n        return fmt.Errorf(\"corrupt application config group (check Fabric versions / regenerate configtx): %w\", err)\n    }\n    return err\n}","preventionTips":["Generate channel config exclusively with configtxgen matching the runtime version","Never manually edit serialized config proto bytes","Validate the full channel config by round-tripping through the channelconfig bundle before submission"],"tags":["channel-config","protobuf","unmarshal","hyperledger-fabric"],"backgroundTag":"proto-unmarshal-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"}