hyperledger/fabric · error

get params docker image failed

Error message

get params docker image failed

What it means

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.

Source

Thrown at core/chaincode/platforms/platforms.go:140

	// ----------------------------------------------------------------------------------------------------
	// First stream out our static inputFiles
	// ----------------------------------------------------------------------------------------------------
	for name, data := range inputFiles {
		err = r.PackageWriter.Write(name, data, tw)
		if err != nil {
			return fmt.Errorf(`Failed to inject "%s": %s`, name, err)
		}
	}

	var (
		goVersion   string
		osVersion   string
		archVersion string
	)
	if ccType == pb.ChaincodeSpec_GOLANG.String() {
		goVersion, osVersion, archVersion, err = util.ParamsImage(client)
		if err != nil {
			return errors.Wrap(err, "get params docker image failed")
		}
	}

	buildOptions, err := platform.DockerBuildOptions(path, goVersion, osVersion, archVersion)
	if err != nil {
		return errors.Wrap(err, "platform failed to create docker build options")
	}

	output := &bytes.Buffer{}
	buildOptions.InputStream = codePackage
	buildOptions.OutputStream = output

	err = r.DockerBuild(buildOptions, client)
	if err != nil {
		return errors.Wrap(err, "docker build failed")
	}

	return writeBytesToPackage("binpackage.tar", output.Bytes(), tw)

View on GitHub (pinned to 2736b63f8f)

Solutions

  1. Inspect the wrapped cause with errors.Cause(err) or fmt.Printf("%+v") to see the underlying ParamsImage failure
  2. Verify the docker client passed to StreamDockerBuild is properly initialized and connected
  3. Confirm the chaincode spec type is really GOLANG and the code package is intact
  4. Retry the chaincode package/build after fixing the environment issue

Example fix

// before
_, _, _, err = util.ParamsImage(client) // err swallowed or misreported
// after
if goVersion, osVersion, archVersion, perr = util.ParamsImage(client); perr != nil {
    logger.Errorf("ParamsImage failed: %+v", perr)
    return errors.Wrap(perr, "get params docker image failed")
}
Defensive patterns

Strategy: try-catch

Validate before calling

if _, _, _, err := util.ParamsImage(client); err != nil {
    return fmt.Errorf("precheck: ParamsImage failed: %+v", err)
}

Try / catch

if err != nil {
    cause := errors.Cause(err)
    logger.Errorf("docker build param lookup failed: %+v", cause)
    return err
}

Prevention

When it happens

Trigger: 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).

Common situations: 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.

Related errors


AI-assisted analysis of hyperledger/fabric@2736b63f8f (2026-09-04). Data as JSON: /api/errors/0bcb3986e8a6e311. Report an issue: GitHub.