{"record":{"id":"af48e309adee09ac","repo":"apache/hadoop","slug":"eio-af48e3","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_utimens.c","lineNumber":41,"sourceCode":"int dfs_utimens(const char *path, const struct timespec ts[2])\n{\n  struct hdfsConn *conn = NULL;\n  hdfsFS fs;\n  int ret = 0;\n  dfs_context *dfs = (dfs_context*)fuse_get_context()->private_data;\n\n  TRACE1(\"utimens\", path)\n\n  assert(path);\n  assert(dfs);\n  assert('/' == *path);\n\n  time_t aTime = ts[0].tv_sec;\n  time_t mTime = ts[1].tv_sec;\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\n  if (hdfsUtime(fs, path, mTime, aTime)) {\n    hdfsFileInfo *info = hdfsGetPathInfo(fs, path);\n    if (info == NULL) {\n      ret = (errno > 0) ? -errno : -ENOENT;\n      goto cleanup;\n    }\n    // Silently ignore utimens failure for directories, otherwise \n    // some programs like tar will fail.\n    if (info->mKind == kObjectKindDirectory) {\n      ret = 0;\n    } else {\n      ret = (errno > 0) ? -errno : -EACCES;","sourceCodeStart":23,"sourceCodeEnd":59,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/fuse-dfs/fuse_impls_utimens.c#L23-L59","documentation":"Emitted by the fuse-dfs utimens handler when fuseConnectAsThreadUid() cannot obtain a libhdfs connection for the calling UID; timestamp updates fail with EIO. The handler needs the connection to call hdfsUtime with the atime/mtime taken from the timespec array; the connection failure happens before any HDFS metadata call.","triggerScenarios":"touch on the mount, cp -p/rsync -a preserving times, when getUsername(uid) fails, the uid's Kerberos ticket cache is missing/stale (fuseNewConnect -> EACCES), or hdfsBuilderConnect fails (JVM/CLASSPATH, wrong namenode URI/port, NameNode down).","commonSituations":"Backup/sync tools (rsync -a, cp -p) running on a Kerberized mount after ticket expiry; fuse_dfs restarted without the Hadoop CLASSPATH; accessing uids without local passwd entries.","solutions":["Check fuse-dfs stderr for the preceding fuseNewConnect/fuseConnect message naming the real cause.","Refresh Kerberos tickets (kinit) for the accessing uid and retry the operation.","Verify the mount's backend is reachable: hdfs dfs -ls hdfs://<nn>:<port>/ from the same environment.","Ensure the uid exists in local passwd so uid->username resolution works.","Restart fuse_dfs with the correct environment if JVM startup was the failure."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"# before timestamp-preserving copies onto 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":"struct timespec ts[2] = {...};\nif (utimensat(AT_FDCWD, mount_file, ts, 0) < 0 && errno == EIO) {\n    /* hdfsUtime never ran: fuse-dfs connect failed for this uid */\n    alert_backend_connection();\n}","preventionTips":["Run rsync -a / cp -p jobs with auto-renewed Kerberos credentials.","Treat EIO from timestamp calls as a mount-backend incident, not a file problem.","Monitor fuse-dfs stderr around scheduled sync windows.","Keep the accessing uid resolvable in local passwd."],"tags":["c","fuse-dfs","libhdfs","kerberos","connection","eio","utimens","touch"],"backgroundTag":"hdfs-connection-failed","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}