You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-issues@hadoop.apache.org by "Dan Ziemba (Jira)" <ji...@apache.org> on 2025/09/26 01:28:00 UTC

[jira] [Created] (HDFS-17843) FileSystem.createFile() fails with relative path

Dan Ziemba created HDFS-17843:
---------------------------------

             Summary: FileSystem.createFile() fails with relative path
                 Key: HDFS-17843
                 URL: https://issues.apache.org/jira/browse/HDFS-17843
             Project: Hadoop HDFS
          Issue Type: Bug
          Components: hdfs-client
    Affects Versions: 3.4.2
            Reporter: Dan Ziemba


Attempting to create an HDFS file like below results in "IllegalArgumentException: Pathname \{path} from \{path} is not a valid DFS filename."

{{fileSystem.createFile(new Path("relative")).build())}}

This works fine using the plain create(path) method instead. Problem appears to be with code here that passes variable "f" (the original path) instead of "p" (path received by doCall() that should be absolute) to the getPathName() method:
[https://github.com/apache/hadoop/blob/84e8b89ee2ebe6923691205b9e171badde7a495c/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DistributedFileSystem.java#L626]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org