{"record":{"id":"07c31c792e41cc95","repo":"hyperledger/fabric","slug":"builder-s-release-failed","errorCode":null,"errorMessage":"builder '%s' release failed","messagePattern":"builder '(.+?)' release failed","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/container/externalbuilder/externalbuilder.go","lineNumber":328,"sourceCode":"\t}\n\n\treturn nil\n}\n\n// Release runs the `release` script.\nfunc (b *Builder) Release(buildContext *BuildContext) error {\n\trelease := filepath.Join(b.Location, \"bin\", \"release\")\n\n\t_, err := exec.LookPath(release)\n\tif err != nil {\n\t\tb.Logger.Debugf(\"Skipping release step for '%s' as no release binary found\", buildContext.CCID)\n\t\treturn nil\n\t}\n\n\tcmd := b.NewCommand(release, buildContext.BldDir, buildContext.ReleaseDir)\n\terr = b.runCommand(cmd)\n\tif err != nil {\n\t\treturn errors.Wrapf(err, \"builder '%s' release failed\", b.Name)\n\t}\n\n\treturn nil\n}\n\n// runConfig is serialized to disk when launching.\ntype runConfig struct {\n\tCCID        string `json:\"chaincode_id\"`\n\tPeerAddress string `json:\"peer_address\"`\n\tClientCert  string `json:\"client_cert\"` // PEM encoded client certificate\n\tClientKey   string `json:\"client_key\"`  // PEM encoded client key\n\tRootCert    string `json:\"root_cert\"`   // PEM encoded peer chaincode certificate\n\tMSPID       string `json:\"mspid\"`\n}\n\nfunc newRunConfig(ccid string, peerConnection *ccintf.PeerConnection, mspid string) runConfig {\n\tvar tlsConfig ccintf.TLSConfig\n\tif peerConnection.TLSConfig != nil {","sourceCodeStart":310,"sourceCodeEnd":346,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/core/container/externalbuilder/externalbuilder.go#L310-L346","documentation":"The external builder's release script exited non-zero. The script bin/release was found via LookPath and run with the build and release dirs, and its failure aborts the release phase for this chaincode.","triggerScenarios":"Builder.Release() runs <builder>/bin/release with BldDir and ReleaseDir arguments; the script returns non-zero, is missing, or is not executable.","commonSituations":"Release script cannot write connection.json to the release directory (permissions/disk full); script has a bug; builder only supports chaincode-as-a-service and release steps misconfigured.","solutions":["Run bin/release manually with the same bld/release dir arguments to see the root cause","Ensure bin/release exists and is executable","Check the release directory is writable and has free disk space; fix the script"],"exampleFix":"// before\n#!/bin/sh\ncp $3/connection.json $2\n// after\n#!/bin/sh\nset -eu\ncp \"$1/connection.json\" \"$2/connection.json\"","handlingStrategy":"try-catch","validationCode":"releaseBin := filepath.Join(builderPath, \"bin\", \"release\")\nif info, err := os.Stat(releaseBin); err != nil || info.Mode()&0o111 == 0 {\n    return fmt.Errorf(\"builder %s missing executable bin/release\", builderPath)\n}","typeGuard":null,"tryCatchPattern":"err := builder.Release(ctx)\nif err != nil {\n    log.Errorf(\"release failed: %v; check %s writes connection.json to release dir\", err, releaseDir)\n}","preventionTips":["Verify the release script produces connection.json in the release dir during testing","Ensure the peer process has write access to the release directory","Use set -eu in release scripts to fail fast with a clear failing line"],"tags":["external-builder","release-failure","subprocess","chaincode"],"backgroundTag":"builder-script-failed","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"}