{"record":{"id":"16b3ac4113648559","repo":"hyperledger/fabric","slug":"no-dockerbuilder-cannot-build","errorCode":null,"errorMessage":"no DockerBuilder, cannot build","messagePattern":"no DockerBuilder, cannot build","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/container/container.go","lineNumber":117,"sourceCode":"\n\tif r.ExternalBuilder != nil {\n\t\t// for now, the package ID we retrieve from the FS is always the ccid\n\t\t// the chaincode uses for registration\n\t\t_, mdBytes, codeStream, err := r.PackageProvider.GetChaincodePackage(ccid)\n\t\tif err != nil {\n\t\t\treturn errors.WithMessage(err, \"failed to get chaincode package for external build\")\n\t\t}\n\t\tdefer codeStream.Close()\n\n\t\tinstance, err = r.ExternalBuilder.Build(ccid, mdBytes, codeStream)\n\t\tif err != nil {\n\t\t\treturn errors.WithMessage(err, \"external builder failed\")\n\t\t}\n\t}\n\n\tif instance == nil {\n\t\tif r.DockerBuilder == nil {\n\t\t\treturn errors.New(\"no DockerBuilder, cannot build\")\n\t\t}\n\t\tmetadata, _, codeStream, err := r.PackageProvider.GetChaincodePackage(ccid)\n\t\tif err != nil {\n\t\t\treturn errors.WithMessage(err, \"failed to get chaincode package for docker build\")\n\t\t}\n\t\tdefer codeStream.Close()\n\n\t\tinstance, err = r.DockerBuilder.Build(ccid, metadata, codeStream)\n\t\tif err != nil {\n\t\t\treturn errors.WithMessage(err, \"docker build failed\")\n\t\t}\n\t}\n\n\tr.mutex.Lock()\n\tdefer r.mutex.Unlock()\n\tif r.containers == nil {\n\t\tr.containers = map[string]Instance{}\n\t}","sourceCodeStart":99,"sourceCodeEnd":135,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/core/container/container.go#L99-L135","documentation":"The BuildRegistry Build method reached the end of its external-builder loop without producing an instance, so it falls back to the legacy Docker build path. If no DockerBuilder is configured on the registry, there is no way to build the chaincode, and this error is thrown.","triggerScenarios":"Calling Build(ccid) for a package whose chaincode type matches no configured external builder (or all external builders failed/did not emit a connection.json), while r.DockerBuilder == nil — e.g. Docker build support not wired into the registry (docker build disabled in configuration).","commonSituations":"Using external builders only (no Docker) but installing a package type (e.g. golang/node/java legacy type) with no matching external builder; external builder 'name' mismatch with the package type; DockerBuilder omitted when constructing the BuildRegistry; fabric release where docker chaincode build was removed/disabled.","solutions":["Configure/install an external builder whose package type matches the installed chaincode package.","Provide a DockerBuilder to the BuildRegistry (wire it in peer construction) if you rely on legacy docker chaincode builds.","Repackage the chaincode using a type supported by your configured external builders (e.g. ccenv-based or CAAS type).","Check peer log lines above the error for 'external builder failed' to see why the builder did not produce an instance, and fix that builder."],"exampleFix":"// before: registry without docker support building a legacy package\nregistry := container.NewBuildRegistry(pkgProvider, nil, builders...)\n\n// after: wire a DockerBuilder as fallback\nregistry := container.NewBuildRegistry(pkgProvider, dockerProvider, builders...)","handlingStrategy":"validation","validationCode":"// pre-flight: confirm some builder can handle this package type\npkgType := getPackageType(ccid)\nmatched := false\nfor _, b := range externalBuilders {\n\tif b.Matches(pkgType) { matched = true; break }\n}\nif !matched && dockerBuilder == nil {\n\treturn errors.Errorf(\"package type %s has no builder configured\", pkgType)\n}","typeGuard":"func canBuild(r *BuildRegistry, ccid string) bool {\n\treturn r.DockerBuilder != nil || r.externalBuilderMatches(ccid)\n}","tryCatchPattern":"instance, err := registry.Build(ccid)\nif err != nil {\n\tif strings.Contains(err.Error(), \"no DockerBuilder\") {\n\t\treturn errors.WithMessage(err,\n\t\t\t\"install an external builder for this package type or enable docker builds\")\n\t}\n\treturn err\n}","preventionTips":["Match installed package types to configured external builders in core.yaml","Wire a DockerBuilder into the BuildRegistry if legacy docker chaincode builds are needed","Repackage chaincode with a supported builder type (e.g. CAAS) when docker builds are disabled","Check 'external builder failed' log lines to fix builder outputs (bld/ + connection.json)"],"tags":["chaincode","build","external-builder","hyperledger-fabric","docker"],"backgroundTag":"no-builder-configured","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"}