hyperledger/fabric · error

unknown chaincodeType: %s

Error message

unknown chaincodeType: %s

What it means

ValidateSpec guard: the chaincode type string (e.g., golang, node, java) is not a key in the platform Registry, so no Platform implementation exists to validate the package spec. The at-fault input is the --lang/package ID type supplied by the user.

Source

Thrown at internal/peer/packaging/platforms.go:62

var logger = flogging.MustGetLogger("chaincode.platform")

func NewRegistry(platformTypes ...Platform) *Registry {
	platforms := make(map[string]Platform)
	for _, platform := range platformTypes {
		if _, ok := platforms[platform.Name()]; ok {
			logger.Panicf("Multiple platforms of the same name specified: %s", platform.Name())
		}
		platforms[platform.Name()] = platform
	}
	return &Registry{
		Platforms: platforms,
	}
}

func (r *Registry) ValidateSpec(ccType, path string) error {
	platform, ok := r.Platforms[ccType]
	if !ok {
		return fmt.Errorf("unknown chaincodeType: %s", ccType)
	}
	return platform.ValidatePath(path)
}

func (r *Registry) NormalizePath(ccType, path string) (string, error) {
	platform, ok := r.Platforms[ccType]
	if !ok {
		return "", fmt.Errorf("unknown chaincodeType: %s", ccType)
	}
	if normalizer, ok := platform.(NormalizePather); ok {
		return normalizer.NormalizePath(path)
	}
	return path, nil
}

func (r *Registry) ValidateDeploymentSpec(ccType string, codePackage []byte) error {
	platform, ok := r.Platforms[ccType]
	if !ok {

View on GitHub (pinned to 2736b63f8f)

Solutions

  1. Use a supported chaincode type: golang, node, or java
  2. Check for typos in the -l/--lang flag
  3. If a custom platform is intended, register it in the platform registry
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at internal/peer/packaging/platforms.go:62 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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