{"record":{"id":"26811592f4452d74","repo":"apache/hadoop","slug":"libhadoop-cannot-be-loaded-268115","errorCode":null,"errorMessage":"libhadoop cannot be loaded.","messagePattern":"libhadoop cannot be loaded\\.","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/unix/DomainSocketWatcher.java","lineNumber":244,"sourceCode":"  private final DomainSocket notificationSockets[];\n\n  /**\n   * Whether or not this DomainSocketWatcher is closed.\n   */\n  private boolean closed = false;\n  \n  /**\n   * True if we have written a byte to the notification socket. We should not\n   * write anything else to the socket until the notification handler has had a\n   * chance to run. Otherwise, our thread might block, causing deadlock. \n   * See HADOOP-11333 for details.\n   */\n  private boolean kicked = false;\n\n  public DomainSocketWatcher(int interruptCheckPeriodMs, String src)\n      throws IOException {\n    if (loadingFailureReason != null) {\n      throw new UnsupportedOperationException(loadingFailureReason);\n    }\n    Preconditions.checkArgument(interruptCheckPeriodMs > 0);\n    this.interruptCheckPeriodMs = interruptCheckPeriodMs;\n    notificationSockets = DomainSocket.socketpair();\n    watcherThread.setDaemon(true);\n    watcherThread.setName(src + \" DomainSocketWatcher\");\n    watcherThread\n        .setUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {\n          @Override\n          public void uncaughtException(Thread thread, Throwable t) {\n            LOG.error(thread + \" terminating on unexpected exception\", t);\n          }\n        });\n    watcherThread.start();\n  }\n\n  /**\n   * Close the DomainSocketWatcher and wait for its thread to terminate.","sourceCodeStart":226,"sourceCodeEnd":262,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/unix/DomainSocketWatcher.java#L226-L262","documentation":"Error \"libhadoop cannot be loaded.\" thrown in apache/hadoop.","triggerScenarios":"Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/unix/DomainSocketWatcher.java:244 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Build or install the Hadoop native library (libhadoop) for your platform and ensure it is loadable via java.library.path or LD_LIBRARY_PATH.","Verify the native library version matches the Hadoop version in use.","Avoid using DomainSocketWatcher-based features (e.g. short-circuit reads) if native support is unavailable."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}