{"record":{"id":"23aed111a144b62e","repo":"apache/hadoop","slug":"no-user-specified-for-sftp-connection-expand-uri","errorCode":null,"errorMessage":"No user specified for sftp connection. Expand URI or credential file.","messagePattern":"No user specified for sftp connection\\. Expand URI or credential file\\.","errorType":"validation","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/sftp/SFTPFileSystem.java","lineNumber":129,"sourceCode":"      : port;\n    conf.setInt(FS_SFTP_HOST_PORT, port);\n\n    // get user/password information from URI\n    String userAndPwdFromUri = uriInfo.getUserInfo();\n    if (userAndPwdFromUri != null) {\n      String[] userPasswdInfo = userAndPwdFromUri.split(\":\");\n      String user = userPasswdInfo[0];\n      user = URLDecoder.decode(user, \"UTF-8\");\n      conf.set(FS_SFTP_USER_PREFIX + host, user);\n      if (userPasswdInfo.length > 1) {\n        conf.set(FS_SFTP_PASSWORD_PREFIX + host + \".\" +\n            user, userPasswdInfo[1]);\n      }\n    }\n\n    String user = conf.get(FS_SFTP_USER_PREFIX + host);\n    if (user == null || user.equals(\"\")) {\n      throw new IllegalStateException(E_USER_NULL);\n    }\n\n    int connectionMax =\n        conf.getInt(FS_SFTP_CONNECTION_MAX, DEFAULT_MAX_CONNECTION);\n    connectionPool = new SFTPConnectionPool(connectionMax);\n  }\n\n  /**\n   * Connecting by using configuration parameters.\n   *\n   * @return An FTPClient instance\n   * @throws IOException\n   */\n  private ChannelSftp connect() throws IOException {\n    checkNotClosed();\n\n    Configuration conf = getConf();\n    String host = conf.get(FS_SFTP_HOST, null);","sourceCodeStart":111,"sourceCodeEnd":147,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/sftp/SFTPFileSystem.java#L111-L147","documentation":"Error \"No user specified for sftp connection. Expand URI or credential file.\" thrown in apache/hadoop.","triggerScenarios":"Thrown when an sftp:// URI (and the associated credential file, if any) provides no username for the SFTP connection.","commonSituations":"See trigger scenarios.","solutions":["Include a user in the SFTP URI (sftp://user@host/...) or configure a credential file.","Set the username via the credential file referenced by the configuration."],"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"}