{"record":{"id":"63a45cac84698ed2","repo":"nodejs/node","slug":"invalid-parameter-s-n","errorCode":null,"errorMessage":"invalid parameter: [%s]\\n","messagePattern":"invalid parameter: \\[(.+?)\\]\\\\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"deps/brotli/c/tools/brotli.c","lineNumber":679,"sourceCode":"          if (quality_set) {\n            fprintf(stderr, \"quality already set\\n\");\n            return COMMAND_INVALID;\n          }\n          quality_set = ParseInt(value, BROTLI_MIN_QUALITY,\n                                 BROTLI_MAX_QUALITY, &params->quality);\n          if (!quality_set) {\n            fprintf(stderr, \"error parsing quality value [%s]\\n\", value);\n            return COMMAND_INVALID;\n          }\n        } else if (strncmp(\"suffix\", arg, key_len) == 0) {\n          if (suffix_set) {\n            fprintf(stderr, \"suffix already set\\n\");\n            return COMMAND_INVALID;\n          }\n          suffix_set = BROTLI_TRUE;\n          params->suffix = value;\n        } else {\n          fprintf(stderr, \"invalid parameter: [%s]\\n\", arg);\n          return COMMAND_INVALID;\n        }\n      }\n    }\n  }\n\n  params->input_count = input_count;\n  params->longest_path_len = longest_path_len;\n  params->decompress = (command == COMMAND_DECOMPRESS);\n  params->test_integrity = (command == COMMAND_TEST_INTEGRITY);\n\n  if (input_count > 1 && output_set) return COMMAND_INVALID;\n  if (params->test_integrity) {\n    if (params->output_path) return COMMAND_INVALID;\n    if (params->write_to_stdout) return COMMAND_INVALID;\n  }\n  if (params->reject_uncompressible && params->write_to_stdout) {\n    return COMMAND_INVALID;","sourceCodeStart":661,"sourceCodeEnd":697,"githubUrl":"https://github.com/nodejs/node/blob/1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e/deps/brotli/c/tools/brotli.c#L661-L697","documentation":"The brotli CLI rejects a `--key=value` style parameter whose key does not match any recognized name. Valid keys are `comment`, `dictionary`, `lgwin`, `large_window`, `output`, `quality`, and `suffix`. The message echoes the full unparsed argument (e.g. `--foo=bar`) so the developer can see which token was not understood.","triggerScenarios":"Passing `--unknownkey=value` or misspelling a valid key (e.g. `--quailty=5`, `--ouput=foo.br`). The parser reaches the final `else` branch at line 678 after every `strncmp` check against the seven known keys fails.","commonSituations":"Typos in scripting or Makefile targets; copying options from a different brotli version that supports a flag this build does not; using a flag from a wrapper library that maps to a different CLI name.","solutions":["Check the exact argument against the list of supported keys: comment, dictionary, lgwin, large_window, output, quality, suffix.","Run `brotli --help` or `-h` to see the flags supported by this build.","Correct the spelling or remove the unsupported parameter from the command line or build script."],"exampleFix":"// before\nbrotli --quailty=5 input.txt\n// after\nbrotli --quality=5 input.txt","handlingStrategy":"validation","validationCode":"// Validate recognized parameter keys before invoking brotli\n#include <string.h>\n#include <stdbool.h>\n\nstatic bool is_valid_brotli_param(const char *key) {\n    static const char *known[] = {\n        \"comment\", \"dictionary\", \"lgwin\",\n        \"large_window\", \"output\", \"quality\", \"suffix\", NULL\n    };\n    for (int i = 0; known[i]; i++) {\n        if (strcmp(key, known[i]) == 0) return true;\n    }\n    return false;\n}\n\n// Before building argv:\n//   extract key before '=' and call is_valid_brotli_param(key)\n//   reject / log / skip if false","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate parameter names against the brotli help output before scripting.","Use a thin wrapper script that maps your config keys to the correct brotli flag names.","Pin the brotli version in CI so the supported flag set does not change unexpectedly."],"tags":["cli","argument-parsing","brotli"],"backgroundTag":null,"analyzedSha":"1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e","analyzedAt":"2026-08-13T00:53:24.642Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}