{"record":{"id":"51f3b7b22e2e464e","repo":"apache/hadoop","slug":"hdfsconncheckkpath-conn-usrname-s-stat-s-fail","errorCode":null,"errorMessage":"hdfsConnCheckKpath(conn.usrname=%s): stat(%s) failed with error code %d.  Pessimistically condemning the connection.\n","messagePattern":"hdfsConnCheckKpath\\(conn\\.usrname=(.+?)\\): stat\\((.+?)\\) failed with error code (.+?)\\.  Pessimistically condemning the connection\\.\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/fuse-dfs/fuse_connect.c","lineNumber":298,"sourceCode":" * opened the connection, mark the connection as condemned and remove it from\n * the hdfs connection tree.\n *\n * @param conn      The HDFS connection\n */\nstatic int hdfsConnCheckKpath(const struct hdfsConn *conn)\n{\n  int ret;\n  struct stat st;\n  char prevTimeBuf[TIME_STR_LEN], newTimeBuf[TIME_STR_LEN];\n\n  if (stat(conn->kpath, &st) < 0) {\n    ret = errno;\n    if (ret == ENOENT) {\n      fprintf(stderr, \"hdfsConnCheckKpath(conn.usrname=%s): the kerberos \"\n              \"ticket cache file '%s' has disappeared.  Condemning the \"\n              \"connection.\\n\", conn->usrname, conn->kpath);\n    } else {\n      fprintf(stderr, \"hdfsConnCheckKpath(conn.usrname=%s): stat(%s) \"\n              \"failed with error code %d.  Pessimistically condemning the \"\n              \"connection.\\n\", conn->usrname, conn->kpath, ret);\n    }\n    return -ret;\n  }\n  if ((st.st_mtim.tv_sec != conn->kPathMtime) ||\n      (st.st_mtim.tv_nsec != conn->kPathMtimeNs)) {\n    timeToStr(conn->kPathMtime, prevTimeBuf, sizeof(prevTimeBuf));\n    timeToStr(st.st_mtim.tv_sec, newTimeBuf, sizeof(newTimeBuf));\n    fprintf(stderr, \"hdfsConnCheckKpath(conn.usrname=%s): mtime on '%s' \"\n            \"has changed from '%s' to '%s'.  Condemning the connection \"\n            \"because our cached Kerberos credentials have probably \"\n            \"changed.\\n\", conn->usrname, conn->kpath, prevTimeBuf, newTimeBuf);\n    return -EINTERNAL;\n  }\n  return 0;\n}\n","sourceCodeStart":280,"sourceCodeEnd":316,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/fuse-dfs/fuse_connect.c#L280-L316","documentation":"Error \"hdfsConnCheckKpath(conn.usrname=%s): stat(%s) failed with error code %d.  Pessimistically condemning the connection.\n\" thrown in apache/hadoop.","triggerScenarios":"Thrown at hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/fuse-dfs/fuse_connect.c:298 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the Kerberos ticket cache file path (KRB5CCNAME) exists and is readable; fix permissions or re-run kinit.","Check the errno returned by stat to determine whether the path was removed or a filesystem error occurred, then restore the ticket cache."],"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-23T01:17:44.959Z"}