{"record":{"id":"54d8e4aef2141399","repo":"hyperledger/fabric","slug":"unexpected-chaincode-spec-type-s-54d8e4","errorCode":null,"errorMessage":"unexpected chaincode spec type: %s","messagePattern":"unexpected chaincode spec type: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/handlers/validation/builtin/v13/lscc_validation_logic.go","lineNumber":397,"sourceCode":"\t\tif (!ac.PrivateChannelData() && len(lsccArgs) > 5) ||\n\t\t\t(ac.PrivateChannelData() && len(lsccArgs) > 6) {\n\t\t\treturn policyErr(fmt.Errorf(\"Wrong number of arguments for invocation lscc(%s): received %d\", lsccFunc, len(lsccArgs)))\n\t\t}\n\n\t\tcdsArgs, err := protoutil.UnmarshalChaincodeDeploymentSpec(lsccArgs[1])\n\t\tif err != nil {\n\t\t\treturn policyErr(fmt.Errorf(\"GetChaincodeDeploymentSpec error %s\", err))\n\t\t}\n\n\t\tif cdsArgs == nil || cdsArgs.ChaincodeSpec == nil || cdsArgs.ChaincodeSpec.ChaincodeId == nil ||\n\t\t\tcap.Action == nil || cap.Action.ProposalResponsePayload == nil {\n\t\t\treturn policyErr(fmt.Errorf(\"VSCC error: invocation of lscc(%s) does not have appropriate arguments\", lsccFunc))\n\t\t}\n\n\t\tswitch cdsArgs.ChaincodeSpec.Type.String() {\n\t\tcase \"GOLANG\", \"NODE\", \"JAVA\", \"CAR\":\n\t\tdefault:\n\t\t\treturn policyErr(fmt.Errorf(\"unexpected chaincode spec type: %s\", cdsArgs.ChaincodeSpec.Type.String()))\n\t\t}\n\n\t\t// validate chaincode name\n\t\tccName := cdsArgs.ChaincodeSpec.ChaincodeId.Name\n\t\t// it must comply with the lscc.ChaincodeNameRegExp\n\t\tif !lscc.ChaincodeNameRegExp.MatchString(ccName) {\n\t\t\treturn policyErr(errors.Errorf(\"invalid chaincode name '%s'\", ccName))\n\t\t}\n\n\t\t// it can't match the name of one of the system chaincodes\n\t\tif _, in := systemChaincodeNames[ccName]; in {\n\t\t\treturn policyErr(errors.Errorf(\"chaincode name '%s' is reserved for system chaincodes\", ccName))\n\t\t}\n\n\t\t// validate chaincode version\n\t\tccVersion := cdsArgs.ChaincodeSpec.ChaincodeId.Version\n\t\t// it must comply with the lscc.ChaincodeVersionRegExp\n\t\tif !lscc.ChaincodeVersionRegExp.MatchString(ccVersion) {","sourceCodeStart":379,"sourceCodeEnd":415,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/core/handlers/validation/builtin/v13/lscc_validation_logic.go#L379-L415","documentation":"Returned by ValidateLSCCInvocation when the deployment spec's chaincode spec type is not one of GOLANG, NODE, JAVA, or CAR. VSCC rejects deploys of chaincodes whose runtime type is unrecognized by the network's validation logic.","triggerScenarios":"Thrown at core/handlers/validation/builtin/v13/lscc_validation_logic.go:397 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set a supported ChaincodeSpec.Type when packaging","Use a platform-supported language value in the deploy spec"],"exampleFix":null,"handlingStrategy":"validation","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"}