{"record":{"id":"a78d70966b6e5030","repo":"apache/hadoop","slug":"eio-a78d70","errorCode":"EIO","errorMessage":"fuseConnectAsThreadUid: failed to open a libhdfs connection!  error %d.\n","messagePattern":"fuseConnectAsThreadUid: failed to open a libhdfs connection!  error (.+?)\\.\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/fuse-dfs/fuse_impls_rmdir.c","lineNumber":49,"sourceCode":"  dfs_context *dfs = (dfs_context*)fuse_get_context()->private_data;\n  int numEntries = 0;\n  hdfsFileInfo *info = NULL;\n\n  TRACE1(\"rmdir\", path)\n\n  assert(path);\n  assert(dfs);\n  assert('/' == *path);\n\n  if (is_protected(path)) {\n    ERROR(\"Trying to delete protected directory %s\", path);\n    ret = -EACCES;\n    goto cleanup;\n  }\n\n  ret = fuseConnectAsThreadUid(&conn);\n  if (ret) {\n    fprintf(stderr, \"fuseConnectAsThreadUid: failed to open a libhdfs \"\n            \"connection!  error %d.\\n\", ret);\n    ret = -EIO;\n    goto cleanup;\n  }\n  fs = hdfsConnGetFs(conn);\n  info = hdfsListDirectory(fs, path, &numEntries);\n  if (numEntries) {\n    ret = -ENOTEMPTY;\n    goto cleanup;\n  }\n\n  if (hdfsDeleteWithTrash(fs, path, dfs->usetrash)) {\n    ERROR(\"Error trying to delete directory %s\", path);\n    ret = -EIO;\n    goto cleanup;\n  }\n  ret = 0;\n","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/fuse-dfs/fuse_impls_rmdir.c#L31-L67","documentation":"Emitted by the fuse-dfs rmdir handler when fuseConnectAsThreadUid() cannot obtain a libhdfs connection for the calling UID; rmdir on the mount fails with EIO. The protected-path check (EACCES) and the later not-empty check (ENOTEMPTY from hdfsListDirectory) are separate outcomes; this message means the connection step itself failed before any HDFS call was made.","triggerScenarios":"rmdir on the fuse-dfs mount when getUsername(uid) fails, the uid's Kerberos ticket cache is missing (fuseNewConnect -> EACCES), or hdfsBuilderConnect fails (JVM will not start, wrong namenode URI/port, NameNode unreachable).","commonSituations":"Cleanup scripts running rmdir after the user's Kerberos ticket expired; fuse_dfs running on a host whose /tmp ticket cache was cleaned; uid not present in local passwd; CLASSPATH misconfigured at mount time.","solutions":["Read the fuse-dfs stderr lines above this message for the fuseNewConnect root cause (kinit hint or hdfsBuilderConnect error code).","Refresh Kerberos credentials for the accessing uid (kinit) and retry the rmdir - fuse-dfs builds a fresh connection per user.","Verify namenode reachability and config: hdfs dfs -ls hdfs://<nn>:<port>/ with the same environment.","Ensure the uid resolves via getent passwd.","Restart fuse_dfs with a correct environment if stderr shows JVM startup failures."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"# before directory cleanup through the mount\nklist -s || kinit \"$USER\"@EXAMPLE.COM\nCLASSPATH=\"$(hdfs classpath --glob)\" hdfs dfs -ls \"${HDFS_URI:-hdfs://nn:8020/}\" || exit 1","typeGuard":null,"tryCatchPattern":"if (rmdir(mount_path) < 0 && errno == EIO) {\n    /* connection failure, not ENOTEMPTY/EACCES - check fuse-dfs stderr */\n    alert_backend_connection();\n}","preventionTips":["Schedule cleanup jobs to start with fresh Kerberos tickets.","Distinguish errnos: EACCES = protected path, ENOTEMPTY = directory has entries, EIO = this connect failure.","Monitor fuse-dfs stderr and NameNode health alongside mount health checks.","Keep the fuse_dfs environment (CLASSPATH, LIBHDFS_OPTS) under config management."],"tags":["c","fuse-dfs","libhdfs","kerberos","connection","eio","rmdir"],"backgroundTag":"hdfs-connection-failed","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}