{"record":{"id":"0bcb3986e8a6e311","repo":"hyperledger/fabric","slug":"get-params-docker-image-failed","errorCode":null,"errorMessage":"get params docker image failed","messagePattern":"get params docker image failed","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/chaincode/platforms/platforms.go","lineNumber":140,"sourceCode":"\t// ----------------------------------------------------------------------------------------------------\n\t// First stream out our static inputFiles\n\t// ----------------------------------------------------------------------------------------------------\n\tfor name, data := range inputFiles {\n\t\terr = r.PackageWriter.Write(name, data, tw)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(`Failed to inject \"%s\": %s`, name, err)\n\t\t}\n\t}\n\n\tvar (\n\t\tgoVersion   string\n\t\tosVersion   string\n\t\tarchVersion string\n\t)\n\tif ccType == pb.ChaincodeSpec_GOLANG.String() {\n\t\tgoVersion, osVersion, archVersion, err = util.ParamsImage(client)\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, \"get params docker image failed\")\n\t\t}\n\t}\n\n\tbuildOptions, err := platform.DockerBuildOptions(path, goVersion, osVersion, archVersion)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"platform failed to create docker build options\")\n\t}\n\n\toutput := &bytes.Buffer{}\n\tbuildOptions.InputStream = codePackage\n\tbuildOptions.OutputStream = output\n\n\terr = r.DockerBuild(buildOptions, client)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"docker build failed\")\n\t}\n\n\treturn writeBytesToPackage(\"binpackage.tar\", output.Bytes(), tw)","sourceCodeStart":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/core/chaincode/platforms/platforms.go#L122-L158","documentation":"This error is a pkg/errors wrap produced in StreamDockerBuild when util.ParamsImage(client) fails while deriving the Go version, OS version and arch version used to build the Golang chaincode docker image. It means the helper could not determine build parameters from the provided client/context, so the docker build cannot proceed. The original cause is attached via errors.Wrap and should be inspected with %+v or errors.Cause.","triggerScenarios":"Calling StreamDockerBuild on a chaincode package whose spec type is pb.ChaincodeSpec_GOLANG when util.ParamsImage returns an error (e.g. the client/connection passed in cannot resolve the required build parameters).","commonSituations":"Building Golang chaincode packages where the underlying docker client or environment lookup inside ParamsImage fails; often surfaces during chaincode install/lifecycle flows with a misconfigured docker connection.","solutions":["Inspect the wrapped cause with errors.Cause(err) or fmt.Printf(\"%+v\") to see the underlying ParamsImage failure","Verify the docker client passed to StreamDockerBuild is properly initialized and connected","Confirm the chaincode spec type is really GOLANG and the code package is intact","Retry the chaincode package/build after fixing the environment issue"],"exampleFix":"// before\n_, _, _, err = util.ParamsImage(client) // err swallowed or misreported\n// after\nif goVersion, osVersion, archVersion, perr = util.ParamsImage(client); perr != nil {\n    logger.Errorf(\"ParamsImage failed: %+v\", perr)\n    return errors.Wrap(perr, \"get params docker image failed\")\n}","handlingStrategy":"try-catch","validationCode":"if _, _, _, err := util.ParamsImage(client); err != nil {\n    return fmt.Errorf(\"precheck: ParamsImage failed: %+v\", err)\n}","typeGuard":null,"tryCatchPattern":"if err != nil {\n    cause := errors.Cause(err)\n    logger.Errorf(\"docker build param lookup failed: %+v\", cause)\n    return err\n}","preventionTips":["Always unwrap with errors.Cause/%+v to see the ParamsImage root cause","Keep the docker client connection verified before packaging chaincode","Test chaincode packaging in CI with the same peer environment"],"tags":["docker","go-chaincode","build","error-wrapping"],"backgroundTag":"docker-build-param-lookup-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"}