ADF Copy activity is failing when extracting zip files

Prapul Kumar Dongari 116 Reputation points
2023-10-05T06:54:11.09+00:00

I have a .zip file in one adls in container when i was trying to extract the .zip file using adf copy activity i used binary datasets for both source and sink and at source side i used .zip as compress type ,optimal as compression level when i run the pipeline it is getting failed with following error:

ErrorCode=UserErrorUnzipInvalidFile,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=The file 'ABC.zip' is not a valid Zip file with Deflate compression method.,Source=Microsoft.DataTransfer.ClientLibrary,''Type=System.IO.InvalidDataException,Message=End of Central Directory record could not be found.,Source=Microsoft.DataTransfer.ClientLibrary,'

note: when i used deflate compression type the copy activity is getting succeded but its wriiting empty file

please give me soloution for this issue

thanks

prapulkumar.d

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
9,776 questions
{count} votes

1 answer

Sort by: Most helpful
  1. KranthiPakala-MSFT 46,427 Reputation points Microsoft Employee
    2023-10-06T00:17:41.05+00:00

    @Prapul Kumar Dongari Welcome to Microsoft Q&A forum and thanks for reaching out here.

    ADF uses .net build-in unzip tool to extract the zip files. Given the error message "Message=The file '*************' is not a valid Zip file with Deflate compression ethod.,Source=Microsoft.DataTransfer.ClientLibrary,''Type=System.IO.InvalidDataException,Message=End of Central Directory record could not be found", it indicates that the source zip file is somehow not in a healthy status.

    Or file is corrupted (assuming based on this message: **Message=End of Central Directory record could not be found**) due to unsupported compression type being used while generating the zip file.

    Please note that the internal zip library of Azure Data Factory only supports "deflate" compression. In case if you source file is being compressed by an algorithm other than "deflate", then it results in such an error.

    Please refer to this documentation for more details: Unsupported compression causes files to be corrupted

    User's image

    Hence, I recommend troubleshooting on how your source file being compressed (You can use some third party tool like "7zip" to open the zip file, and it will show the actual compression algo). If it is not Deflate compression then it is not supported by ADF.

    Hope this info helps. In case if your source zip file uses "deflate" method for compression but still notice this behavior in ADF, then I recommend filing a support ticket for deeper investiagation. And in case if you don't have a support plan, please let me know here.


    Please don’t forget to Accept Answer and Yes for "was this answer helpful" wherever the information provided helps you, this can be beneficial to other community members.

    0 comments No comments