Copying files to azure data lake

Tamilarasu Raja @ 4i Apps 0 Reputation points
2025-03-05T12:35:30.05+00:00

Failure happened on 'Sink' side. ErrorCode=AdlsGen2OperationFailed,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=ADLS Gen2 operation failed for: Operation returned an invalid status code 'PreconditionFailed'. Account: 'datalakeworkflow'. FileSystem: 'bronze'. Path: 'item().SchemaName/item().TableName/item().TableName.parquet '. ErrorCode: 'LeaseLost'. Message: 'A lease ID was specified, but the lease for the resource has expired.'. RequestId: 'e46d4766-d01f-0063-3fca-8d629a000000'. TimeStamp: 'Wed, 05 Mar 2025 12:27:56 GMT'..,Source=Microsoft.DataTransfer.ClientLibrary,''Type=Microsoft.Azure.Storage.Data.Models.ErrorSchemaException,Message=Operation returned an invalid status code 'PreconditionFailed',Source=Microsoft.DataTransfer.ClientLibrary,'

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,547 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Hari Babu Vattepally 1,740 Reputation points Microsoft External Staff
    2025-03-05T15:46:31.55+00:00

    Hi @Tamilarasu Raja @ 4i Apps

    The error AdlsGen2OperationFailed with the message LeaseLost means that the lease ID for the resource has expired. This can occur for several reasons as:

    • The resource lease expired before the operation could be completed.
    • The current operation failed because another process might have acquired or released the lease.
    • It may also be due to network interruptions or delays may have led to the lease expiring before the operation could finish.

    To get this issue resolved, please try the following:

    • Please make sure to renew the lease periodically to avoid it expiring during extended operations.
    • Please check that no other processes are interfering with the lease on the resource.
    • Implement retry logic in your data transfer process to manage transient errors and lease expirations.
    • Please ensure that the permissions for the Azure Data Lake Storage account are properly configured to allow the required operations.

    Additional reference:

    https://learn.microsoft.com/en-us/azure/data-factory/connector-troubleshoot-azure-data-lake

    I hope this helps! Please let us know if you have any further quires, we will be glad to assist you closely.

    Please do consider to “up-vote” wherever the information provided helps you, this can be beneficial to other community members.

    0 comments No comments

  2. Amrinder Singh 5,790 Reputation points Microsoft Employee
    2025-03-05T17:00:49.6366667+00:00

    Hi Tamilarasu Raja @ 4i Apps,

    Thanks for reaching out over Q&A Forum.

    Based on the exception you shared, it points that the operation failed as the lease ID was not present or expired one. In the below link, you can get an idea as to how lease states are traversed.

    https://learn.microsoft.com/en-us/rest/api/storageservices/lease-blob?tabs=microsoft-entra-id#lease-states

    In case you are not specifying this explicitly, this might be getting handled internally by ADF. In case it's transient, you can try retrying the operation to see if that succeeds.

    Hope that helps!

    Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members. 

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.