{"record":{"id":"bb834862a495c661","repo":"vitessio/vitess","slug":"w-value-q-bb8348","errorCode":null,"errorMessage":"%w value: %q","messagePattern":"%w value: %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/mysqlctl/compression.go","lineNumber":126,"sourceCode":"\n// Validates if the external decompressor exists and return its path.\nfunc validateExternalCmd(cmd string) (string, error) {\n\tif cmd == \"\" {\n\t\treturn \"\", errors.New(\"external command is empty\")\n\t}\n\treturn exec.LookPath(cmd)\n}\n\n// Validate compression engine is one of the supported values.\nfunc validateExternalCompressionEngineName(engine string) error {\n\tswitch engine {\n\tcase PgzipCompressor:\n\tcase PargzipCompressor:\n\tcase Lz4Compressor:\n\tcase ZstdCompressor:\n\tcase ExternalCompressor:\n\tdefault:\n\t\treturn fmt.Errorf(\"%w value: %q\", errUnsupportedCompressionEngine, engine)\n\t}\n\n\treturn nil\n}\n\nfunc prepareExternalCmd(ctx context.Context, cmdStr string) (*exec.Cmd, error) {\n\tcmdArgs, err := shlex.Split(cmdStr)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif len(cmdArgs) < 1 {\n\t\treturn nil, errors.New(\"external command is empty\")\n\t}\n\tcmdPath, err := validateExternalCmd(cmdArgs[0])\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn exec.CommandContext(ctx, cmdPath, cmdArgs[1:]...), nil","sourceCodeStart":108,"sourceCodeEnd":144,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/mysqlctl/compression.go#L108-L144","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Set --compression-engine to a valid built-in value (e.g. gzip, pgzip, zstd, zstd-min).","If an external tool is intended, register it in the ExternalCompressors map before calling backup.","List supported engines with vtctldclient / check compression.go documentation to confirm exact spelling."],"exampleFix":"// before\nvtbackup --compression-engine gzib\n// after\nvtbackup --compression-engine gzip","handlingStrategy":"validation","validationCode":"var validEngines = []string{\"gzip\", \"pgzip\", \"zstd\", \"zstd-min\", \"external\"}\nfunc validEngine(e string) bool {\n\tfor _, v := range validEngines {\n\t\tif v == e { return true }\n\t}\n\treturn false\n}\nif !validEngine(flagCompressionEngine) { return fmt.Errorf(\"bad engine %s\", flagCompressionEngine) }","typeGuard":null,"tryCatchPattern":"// Go: check err from backup before proceeding\nif err := backupFiles(...); err != nil {\n\tif errors.Is(err, errUnsupportedCompressionEngine) { /* fix engine flag */ }\n\treturn err\n}","preventionTips":["Pin --compression-engine in a shared config template with only vetted values","Validate engine names in CI before deploying tablet flags","Keep ExternalCompressors registration next to engine flag defaults"],"tags":["backup","compression","configuration"],"backgroundTag":"unsupported-compression-engine","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}