nodejs/node · error

** ERROR: %s

Error message

** ERROR: %s

What it means

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.

Source

Thrown at deps/cares/src/tools/adig.c:1511

#endif

  status = (ares_status_t)ares_library_init(ARES_LIB_INIT_ALL);
  if (status != ARES_SUCCESS) {
    fprintf(stderr, "ares_library_init: %s\n", ares_strerror((int)status));
    return 1;
  }

  config_defaults();

  if (!read_cmdline(argc, (const char * const *)argv, 1)) {
    printf("\n** ERROR: %s\n\n", global_config.error);
    print_help();
    rv = 1;
    goto done;
  }

  if (global_config.no_rcfile && !read_rcfile()) {
    fprintf(stderr, "\n** ERROR: %s\n", global_config.error);
  }

  if (global_config.is_help) {
    print_help();
    goto done;
  }

  if (global_config.name == NULL) {
    printf("missing query name\n");
    print_help();
    rv = 1;
    goto done;
  }

  config_opts();

  status = (ares_status_t)ares_init_options(&channel, &global_config.options,
                                            global_config.optmask);

View on GitHub (pinned to 1b2de5e052)

Solutions

  1. Read the global_config.error message printed between '** ERROR:' and the help text to identify the specific parsing failure.
  2. Run 'adig --help' to review the accepted options and their expected formats.
  3. Correct the offending argument and re-run the command.
  4. For scripted usage, validate each argument before passing it to adig.

Example fix

// before: invalid query type
adig -t INVALIDTYPE example.com
// prints: '** ERROR: ...' followed by help

// after: use a valid type
adig -t A example.com
Defensive patterns

Strategy: validation

Validate before calling

// Validate command-line arguments before passing to adig
// Example: check query type is valid before invoking
valid_types="A AAAA CNAME MX TXT NS SOA SRV PTR"
if ! echo "$valid_types" | grep -qw "$QUERY_TYPE"; then
    echo "invalid query type: $QUERY_TYPE" >&2
    exit 1
fi
adig -t "$QUERY_TYPE" "$DOMAIN"

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of nodejs/node@1b2de5e052 (2026-08-13). Data as JSON: /api/errors/852a9a229fa5c9c0. Report an issue: GitHub.