The requested name is valid, but no data of the requested type was found error when renaming datalake file in C#

Santhosh Kumar S 1 Reputation point
2022-01-23T13:33:49.367+00:00

HI
I am facing below issue when renaming a file in azure data lake using C# .net core 3.1
can any one show me a solution

error

The requested name is valid, but no data of the requested type was found.

here is the sample code

DataLakeFileSystemClient fileSystemClient = await GetDataLakeFileSystemClient(Container);
DataLakeDirectoryClient directoryClient = fileSystemClient.GetDirectoryClient(directoryPath);
DataLakeFileClient fileClient = directoryClient.GetFileClient(filename);
fileClient .Rename(newFileName);

Azure Data Lake Storage
Azure Data Lake Storage
An Azure service that provides an enterprise-wide hyper-scale repository for big data analytic workloads and is integrated with Azure Blob Storage.
1,351 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,288 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. svijay-MSFT 5,206 Reputation points Microsoft Employee
    2022-01-28T13:13:14.733+00:00

    Hello @Santhosh Kumar S ,

    Welcome to the Microsoft Q&A platform.

            DataLakeServiceClient serviceClient = new DataLakeServiceClient(serviceUri, sharedKeyCredential);  
            DataLakeFileSystemClient filesystem = serviceClient.GetFileSystemClient("container");  
            DataLakeDirectoryClient directoryClient = filesystem.GetDirectoryClient("test");  
            DataLakeFileClient fileClient = directoryClient.GetFileClient("File11.json");  
            fileClient.Rename("test/def.json");  
    

    I tried a similar snippet at my end and was not able to observe the issue at my end.

    Upon further checking - the error could be related to windows-sockets-error.

    169359-image.png

    Reference : https://learn.microsoft.com/en-us/windows/win32/winsock/windows-sockets-error-codes-2?redirectedfrom=MSDN#WSANO_DATA

    This hints at some DNS issue - DNS resolution issue. Possible that you re in VNET - Org network that prevents access to the Azure endpoint.

    https://learn.microsoft.com/en-us/azure/virtual-network/service-tags-overview

    I'd check whether the issue is replicable across network.

    Hope this will help. Please let us know if any further queries.

    ------------------------------

    • Please don't forget to click on 130616-image.png or upvote 130671-image.png button whenever the information provided helps you. Original posters help the community find answers faster by identifying the correct answer. Here is how
    • Want a reminder to come back and check responses? Here is how to subscribe to a notification
    • If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators

  2. Santhosh Kumar S 1 Reputation point
    2022-02-12T03:07:20.697+00:00

    HI @svijay-MSFT ·

    Thanks for your time and response , not sure what exact the issue with my case, I am still facing the issue, I am trying to recreate the code using Rest API there also i have the problem with Rename

    0 comments No comments