NativeAzureFileSystem.rename fails with Error: One of the request inputs is not valid
My configuration is working with many other operations (createFolder, upload file, delete file, ...). So it is not a config issue.
I'm running the latest version: hadoop-azure-3.3.6.jar
The error message is not helpful. I'm not sure which input is not valid.
Any suggestions on what could be the issue?
Are there logs in Azure storage that I can see for more information on what is wrong?
Here is a simple code that shows the problem.
The error also happens when Spark internal functions try to rename a file after uploading data to Azure Storage Blob (trying to rename the temp folder to the target folder).
JavaSparkContext jsc = getSparkContext(); // Get valid Spark context
//<container-name>,<storage-account> replaced with my values
String parent = "wasbs://<container-name>@<storage-account>.blob.core.windows.net/";
Path source = new Path(parent + "sourceFolder");
Path target = new Path(parent + "targetFolder");
FileSystem fs = source.getFileSystem(jsc.hadoopConfiguration()); // fs is an object of NativeAzureFileSystem
fs.rename(source, target);
This failed with the error:
org.apache.hadoop.fs.azure.AzureException: com.microsoft.azure.storage.StorageException: One of the request inputs is not valid.
at org.apache.hadoop.fs.azure.AzureNativeFileSystemStore.rename(AzureNativeFileSystemStore.java:2898)
at org.apache.hadoop.fs.azure.AzureNativeFileSystemStore.rename(AzureNativeFileSystemStore.java:2770)
at org.apache.hadoop.fs.azure.NativeAzureFileSystem$FolderRenamePending.execute(NativeAzureFileSystem.java:468)
at org.apache.hadoop.fs.azure.NativeAzureFileSystem.rename(NativeAzureFileSystem.java:3337)