{"record":{"id":"de678a3b9b46f2fa","repo":"hyperledger/fabric","slug":"no-image-provided-and-chaincode-builder-default","errorCode":null,"errorMessage":"No image provided and \"chaincode.builder\" default does not exist","messagePattern":"No image provided and \"chaincode\\.builder\" default does not exist","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/chaincode/platforms/util/utils.go","lineNumber":66,"sourceCode":"// Therefore, this mechanism creates a pipeline consisting of an ephemeral docker\n// container that accepts source code as input, runs some function (e.g. \"go build\"), and\n// outputs the result.  The intention is that this output will be consumed as the basis of\n// a streamlined container by installing the output into a downstream docker-build based on\n// an appropriate minimal image.\n//\n// The input parameters are fairly simple:\n//   - Image:        (optional) The builder image to use or \"chaincode.builder\"\n//   - Cmd:          The command to execute inside the container.\n//   - InputStream:  A tarball of files that will be expanded into /chaincode/input.\n//   - OutputStream: A tarball of files that will be gathered from /chaincode/output\n//     after successful execution of Cmd.\n//\n// -------------------------------------------------------------------------------------------\nfunc DockerBuild(opts DockerBuildOptions, client dcli.APIClient) error {\n\tif opts.Image == \"\" {\n\t\topts.Image = GetDockerImageFromConfig(\"chaincode.builder\")\n\t\tif opts.Image == \"\" {\n\t\t\treturn fmt.Errorf(\"No image provided and \\\"chaincode.builder\\\" default does not exist\")\n\t\t}\n\t}\n\n\tlogger.Debugf(\"Attempting build with options: %s\", opts)\n\n\t// -----------------------------------------------------------------------------------\n\t// Ensure the image exists locally, or pull it from a registry if it doesn't\n\t// -----------------------------------------------------------------------------------\n\t_, err := client.ImageInspect(context.Background(), opts.Image)\n\tif err != nil {\n\t\tlogger.Debugf(\"Image %s does not exist locally, attempt pull\", opts.Image)\n\n\t\tipResp, err := client.ImagePull(context.Background(), opts.Image, dcli.ImagePullOptions{})\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"Failed to pull %s: %s\", opts.Image, err)\n\t\t}\n\t\terr = ipResp.Wait(context.Background())\n\t\tif err != nil {","sourceCodeStart":48,"sourceCodeEnd":84,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/core/chaincode/platforms/util/utils.go#L48-L84","documentation":"util.DockerBuild requires a builder image: either opts.Image or the 'chaincode.builder' core.yaml config key must name a docker image. If both are empty, the function cannot create the ephemeral build container and returns this error immediately.","triggerScenarios":"Calling DockerBuild with opts.Image == \"\" while the peer configuration 'chaincode.builder' is unset or resolves to an empty string.","commonSituations":"Deploying a peer without the chaincode.builder setting and calling platform util code that does not pass an explicit image; stripped-down configs where the default builder was removed.","solutions":["Set chaincode.builder in the peer's core.yaml to a valid builder image","Pass a non-empty opts.Image in DockerBuildOptions","Verify GetDockerImageFromConfig is reading the intended config file","Re-run the build after the image name is provided"],"exampleFix":"// before (core.yaml)\n# chaincode:\n#   builder: hyperledger/fabric-ccenv:latest\n// after (core.yaml)\nchaincode:\n  builder: hyperledger/fabric-ccenv:latest","handlingStrategy":"validation","validationCode":"img := opts.Image\nif img == \"\" {\n    img = viper.GetString(\"chaincode.builder\")\n}\nif img == \"\" {\n    return fmt.Errorf(\"no builder image: set chaincode.builder in core.yaml or pass opts.Image\")\n}","typeGuard":null,"tryCatchPattern":"if err != nil && strings.Contains(err.Error(), \"chaincode.builder\") {\n    return fmt.Errorf(\"configure chaincode.builder (e.g. hyperledger/fabric-ccenv:latest) and retry\")\n}","preventionTips":["Always set chaincode.builder in peer core.yaml","Pass an explicit Image in DockerBuildOptions when calling util.DockerBuild directly","Validate config loading (viper) points at the right core.yaml"],"tags":["docker","configuration","builder-image"],"backgroundTag":"missing-builder-image","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"}