SeleniumHQ/selenium · info

%s

Error message

 %s

What it means

This is the per-candidate continuation line of the error-501 diagnostic: the for-loop in get_xlib_handle() prints ' %s\n' once for each entry in possible_locations (the five hardcoded libX11.so.6 paths) right after the 'None of the following is a ... version of Xlib:' header. It is purely informational stderr output listing exactly which paths were ELF-checked and rejected, and it is emitted from the same code block as error 501. It carries no independent meaning: by itself it just tells you one more scanned path; together with the header and the trailing return NULL it is the 'candidate dump' half of the no-suitable-libX11 report.

Source

Thrown at cpp/linux-specific/x_ignore_nofocus.c:633

  if (is_32bit_system() || is_emulated_32bit()) {
    required_lib_arch = EM_386;
  } else {
    required_lib_arch = EM_X86_64;
  }
  int suitable_xlib_index = find_xlib_by_arch(possible_locations, locations_len, required_lib_arch);
  int found_library = FALSE;
  if (suitable_xlib_index >= 0) {
    snprintf(library, MAX_LIBRARY_PATH, "%s", possible_locations[suitable_xlib_index]);
    found_library = TRUE;
  } else {
    found_library = find_xlib_by_env(library, required_lib_arch);
  }
  if (found_library == FALSE) {
    const char* desired_arch = (required_lib_arch == EM_386 ? "32-bit" : "64-bit");
    fprintf(stderr, "None of the following is a %s version of Xlib:", desired_arch);
    int i;
    for (i = 0; i < locations_len; i++) {
      fprintf(stderr, " %s\n", possible_locations[i]);
    }
    return NULL;
  }

  ret_handle = dlopen(library, RTLD_LAZY);
  if (ret_handle == NULL) {
    fprintf(stderr, "Failed to dlopen %s\n", library);
    fprintf(stderr, "dlerror says: %s\n", dlerror());
  }

  return ret_handle;
}

void print_event_to_log(Display* dpy, XEvent* ev)
{
#ifdef DEBUG_PRINTOUTS
  if ((ev->type != PropertyNotify) && (ev->type != ConfigureNotify)) {
    print_event(g_out_stream, ev, dpy);

View on GitHub (pinned to aa36b38e69)

Solutions

  1. Treat this line as a symptom of error 501 and fix the root cause there: install the arch-matching libX11 (e.g. `apt-get install -y libx11-6`) or set LD_LIBRARY_PATH to a directory holding the correct-arch libX11.so.6.
  2. Use the five paths this line prints as a checklist: confirm whether each exists and what arch `file` reports for it, then install the missing arch package.
  3. Ensure JVM and browser architecture agree with the installed libX11; the loop prints these only because no candidate matched the required EM_386/EM_X86_64.
  4. After installing, re-run and confirm neither the header (501) nor these ' %s' lines reappear, indicating find_xlib_by_arch succeeded.
Defensive patterns

Strategy: validation

Validate before calling

# This line is informational; validate that a correct-arch libX11 is reachable.
#!/usr/bin/env bash
REQUIRED_ARCH="64-bit"

found=0
for lib in /usr/lib/libX11.so.6 \
           /usr/lib/x86_64-linux-gnu/libX11.so.6 \
           /usr/lib/i386-linux-gnu/libX11.so.6 \
           /usr/lib64/libX11.so.6 \
           /usr/lib32/libX11.so.6; do
  [ -f "$lib" ] || continue
  arch=$(file -L "$lib" | grep -o 'ELF 32-bit\|ELF 64-bit')
  [ "${arch#ELF }" = "$REQUIRED_ARCH" ] && { found=1; echo "OK $lib"; break; }
done

if [ "$found" -eq 0 ] && [ -n "$LD_LIBRARY_PATH" ]; then
  for d in "${LD_LIBRARY_PATH//:/ }"; do
    lib="$d/libX11.so.6"; [ -f "$lib" ] || continue
    arch=$(file -L "$lib" | grep -o 'ELF 32-bit\|ELF 64-bit')
    [ "${arch#ELF }" = "$REQUIRED_ARCH" ] && { found=1; echo "OK(env) $lib"; break; }
  done
fi
[ "$found" -eq 1 ] || { echo "no $REQUIRED_ARCH libX11; install libx11-6 or set LD_LIBRARY_PATH"; exit 1; }

Prevention

When it happens

Trigger: Printed for i in [0, locations_len) inside the `if (found_library == FALSE)` branch of get_xlib_handle() — i.e. exactly when find_xlib_by_arch returns -1 for all candidates AND find_xlib_by_env returns FALSE. You will always see locations_len (5) of these lines immediately following the error-501 header line.

Common situations: Same root contexts as error 501: stripped containers missing libX11, arch mismatch between JVM/browser and the installed libX11, or libX11 in a path the scanner does not know about with LD_LIBRARY_PATH unset. Developers grep their stderr/logs and key on this ' %s' line because it lists the concrete paths; the fix is identical to error 501.

Related errors


AI-assisted analysis of SeleniumHQ/selenium@aa36b38e69 (2026-08-14). Data as JSON: /api/errors/6bd877cd74e79f03. Report an issue: GitHub.