vitessio/vitess · error

%w value: %q

Error message

%w value: %q

What it means

Thrown by validateExternalCompressionEngineName when a user-supplied compression engine name does not match any built-in engine and is not registered as an external compression command. It wraps errUnsupportedCompressionEngine and echoes the offending engine name so the misconfiguration is obvious.

Source

Thrown at go/vt/mysqlctl/compression.go:126

// Validates if the external decompressor exists and return its path.
func validateExternalCmd(cmd string) (string, error) {
	if cmd == "" {
		return "", errors.New("external command is empty")
	}
	return exec.LookPath(cmd)
}

// Validate compression engine is one of the supported values.
func validateExternalCompressionEngineName(engine string) error {
	switch engine {
	case PgzipCompressor:
	case PargzipCompressor:
	case Lz4Compressor:
	case ZstdCompressor:
	case ExternalCompressor:
	default:
		return fmt.Errorf("%w value: %q", errUnsupportedCompressionEngine, engine)
	}

	return nil
}

func prepareExternalCmd(ctx context.Context, cmdStr string) (*exec.Cmd, error) {
	cmdArgs, err := shlex.Split(cmdStr)
	if err != nil {
		return nil, err
	}
	if len(cmdArgs) < 1 {
		return nil, errors.New("external command is empty")
	}
	cmdPath, err := validateExternalCmd(cmdArgs[0])
	if err != nil {
		return nil, err
	}
	return exec.CommandContext(ctx, cmdPath, cmdArgs[1:]...), nil

View on GitHub (pinned to 01a25a7d17)

Solutions

  1. Set --compression-engine to a valid built-in value (e.g. gzip, pgzip, zstd, zstd-min).
  2. If an external tool is intended, register it in the ExternalCompressors map before calling backup.
  3. List supported engines with vtctldclient / check compression.go documentation to confirm exact spelling.

Example fix

// before
vtbackup --compression-engine gzib
// after
vtbackup --compression-engine gzip
Defensive patterns

Strategy: validation

Validate before calling

var validEngines = []string{"gzip", "pgzip", "zstd", "zstd-min", "external"}
func validEngine(e string) bool {
	for _, v := range validEngines {
		if v == e { return true }
	}
	return false
}
if !validEngine(flagCompressionEngine) { return fmt.Errorf("bad engine %s", flagCompressionEngine) }

Try / catch

// Go: check err from backup before proceeding
if err := backupFiles(...); err != nil {
	if errors.Is(err, errUnsupportedCompressionEngine) { /* fix engine flag */ }
	return err
}

Prevention

When it happens

Trigger: Calling newExternalCompressor (via backupFiles) with --compression-engine set to a value that is neither a known built-in (gzip, zstd, pgzip, etc.) nor a registered external compressor via ExternalCompressors.

Common situations: Typo in the --compression-engine flag; using an engine name from an older Vitess version that was renamed; forgetting to register the external command through the ExternalCompressors parameter before backup.

Related errors


AI-assisted analysis of vitessio/vitess@01a25a7d17 (2026-09-01). Data as JSON: /api/errors/bb834862a495c661. Report an issue: GitHub.