{"record":{"id":"852a9a229fa5c9c0","repo":"nodejs/node","slug":"error-s","errorCode":null,"errorMessage":"\n** ERROR: %s\n","messagePattern":"\n\\*\\* ERROR: (.+?)\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"deps/cares/src/tools/adig.c","lineNumber":1511,"sourceCode":"#endif\n\n  status = (ares_status_t)ares_library_init(ARES_LIB_INIT_ALL);\n  if (status != ARES_SUCCESS) {\n    fprintf(stderr, \"ares_library_init: %s\\n\", ares_strerror((int)status));\n    return 1;\n  }\n\n  config_defaults();\n\n  if (!read_cmdline(argc, (const char * const *)argv, 1)) {\n    printf(\"\\n** ERROR: %s\\n\\n\", global_config.error);\n    print_help();\n    rv = 1;\n    goto done;\n  }\n\n  if (global_config.no_rcfile && !read_rcfile()) {\n    fprintf(stderr, \"\\n** ERROR: %s\\n\", global_config.error);\n  }\n\n  if (global_config.is_help) {\n    print_help();\n    goto done;\n  }\n\n  if (global_config.name == NULL) {\n    printf(\"missing query name\\n\");\n    print_help();\n    rv = 1;\n    goto done;\n  }\n\n  config_opts();\n\n  status = (ares_status_t)ares_init_options(&channel, &global_config.options,\n                                            global_config.optmask);","sourceCodeStart":1493,"sourceCodeEnd":1529,"githubUrl":"https://github.com/nodejs/node/blob/1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e/deps/cares/src/tools/adig.c#L1493-L1529","documentation":"Printed to stdout (not stderr) by adig's main() at adig.c:1511 when read_cmdline() returns false, indicating that command-line argument parsing encountered an error. The error detail is stored in global_config.error. The tool then calls print_help() and sets rv=1 before jumping to the cleanup label. This is a usage error, not a runtime or network failure.","triggerScenarios":"Invoking adig with invalid command-line arguments, missing required options, an unknown flag, or a malformed option value. The read_cmdline() function (line 1509) parses the options table and sets global_config.error with a descriptive message before returning false. Common triggers: specifying an invalid query type, passing a malformed port number, or omitting a required value for an option that expects one.","commonSituations":"A user runs adig with a typo in an option flag, passes an out-of-range numeric value, or uses a deprecated syntax. A script invokes adig with arguments generated dynamically and one value is empty or invalid.","solutions":["Read the global_config.error message printed between '** ERROR:' and the help text to identify the specific parsing failure.","Run 'adig --help' to review the accepted options and their expected formats.","Correct the offending argument and re-run the command.","For scripted usage, validate each argument before passing it to adig."],"exampleFix":"// before: invalid query type\nadig -t INVALIDTYPE example.com\n// prints: '** ERROR: ...' followed by help\n\n// after: use a valid type\nadig -t A example.com","handlingStrategy":"validation","validationCode":"// Validate command-line arguments before passing to adig\n// Example: check query type is valid before invoking\nvalid_types=\"A AAAA CNAME MX TXT NS SOA SRV PTR\"\nif ! echo \"$valid_types\" | grep -qw \"$QUERY_TYPE\"; then\n    echo \"invalid query type: $QUERY_TYPE\" >&2\n    exit 1\nfi\nadig -t \"$QUERY_TYPE\" \"$DOMAIN\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Review adig --help before constructing complex command lines.","In scripts, validate each argument before passing it to adig.","Test commands interactively before embedding them in automation."],"tags":["c-ares","adig","command-line","usage-error","argument-parsing"],"backgroundTag":null,"analyzedSha":"1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e","analyzedAt":"2026-08-13T00:53:24.642Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}