{"record":{"id":"889c9047d19bcb7f","repo":"hyperledger/fabric","slug":"unknown-chaincodetype-s","errorCode":null,"errorMessage":"Unknown chaincodeType: %s","messagePattern":"Unknown chaincodeType: (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/chaincode/platforms/platforms.go","lineNumber":81,"sourceCode":"func NewRegistry(platformTypes ...Platform) *Registry {\n\tplatforms := make(map[string]Platform)\n\tfor _, platform := range platformTypes {\n\t\tif _, ok := platforms[platform.Name()]; ok {\n\t\t\tlogger.Panicf(\"Multiple platforms of the same name specified: %s\", platform.Name())\n\t\t}\n\t\tplatforms[platform.Name()] = platform\n\t}\n\treturn &Registry{\n\t\tPlatforms:     platforms,\n\t\tPackageWriter: PackageWriterWrapper(writeBytesToPackage),\n\t\tDockerBuild:   util.DockerBuild,\n\t}\n}\n\nfunc (r *Registry) GenerateDockerfile(ccType string) (string, error) {\n\tplatform, ok := r.Platforms[ccType]\n\tif !ok {\n\t\treturn \"\", fmt.Errorf(\"Unknown chaincodeType: %s\", ccType)\n\t}\n\n\tvar buf []string\n\n\t// ----------------------------------------------------------------------------------------------------\n\t// Let the platform define the base Dockerfile\n\t// ----------------------------------------------------------------------------------------------------\n\tbase, err := platform.GenerateDockerfile()\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"Failed to generate platform-specific Dockerfile: %s\", err)\n\t}\n\tbuf = append(buf, base)\n\tbuf = append(buf, fmt.Sprintf(`LABEL %s.chaincode.type=\"%s\" \\`, metadata.BaseDockerLabel, ccType))\n\tbuf = append(buf, fmt.Sprintf(`      %s.version=\"%s\"`, metadata.BaseDockerLabel, metadata.Version))\n\t// ----------------------------------------------------------------------------------------------------\n\t// Then augment it with any general options\n\t// ----------------------------------------------------------------------------------------------------\n\t// append version so chaincode build version can be compared against peer build version","sourceCodeStart":63,"sourceCodeEnd":99,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/core/chaincode/platforms/platforms.go#L63-L99","documentation":"The platform Registry.GenerateDockerfile looks up a platform implementation by the given chaincode type string; if no platform is registered for that type, it cannot generate a Dockerfile and returns 'Unknown chaincodeType'. Only registered types (GOLANG, NODE, CAR, JAVA depending on version) are supported.","triggerScenarios":"GenerateDockerBuild calling GenerateDockerfile with a ccType that is not a key of Registry.Platforms — e.g. an unsupported ChaincodeSpec_Type enum value or an empty/garbage type string.","commonSituations":"Submitting chaincode with a misspelled or unsupported type, using a type enabled in a different Fabric version, or custom builds where a platform plugin was not registered in the Registry.","solutions":["Use a supported chaincode language type (e.g. GOLANG or NODE for this registry).","Fix the ChaincodeSpec.Type value in the install/instantiate request.","If using a custom platform, ensure it is registered in the platforms Registry before the build.","Verify Fabric version supports the requested type (e.g. JAVA support depends on version)."],"exampleFix":"// before\nspec.Type = pb.ChaincodeSpec_TYPE_NODE\n// after\nspec.Type = pb.ChaincodeSpec_NODE","handlingStrategy":"validation","validationCode":"const supportedTypes = ['GOLANG', 'NODE', 'CAR', 'JAVA'];\nif (!supportedTypes.includes(spec.Type)) {\n  throw new Error(`Unsupported chaincode type: ${spec.Type}`);\n}","typeGuard":"function isSupportedChaincodeType(type) {\n  return ['GOLANG', 'NODE', 'CAR', 'JAVA'].includes(type);\n}","tryCatchPattern":null,"preventionTips":["Use enum values, not hand-typed strings, for chaincode type","Confirm the requested language is supported by your Fabric version","Register custom platforms before initiating builds","Validate spec type on the client before submit"],"tags":["chaincode","docker","configuration","unsupported-type"],"backgroundTag":"unknown-chaincode-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"}