[ 
https://issues.apache.org/jira/browse/NIFI-4988?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16481856#comment-16481856
 ] 

ASF GitHub Bot commented on NIFI-4988:
--------------------------------------

GitHub user apsaltis opened a pull request:

    https://github.com/apache/nifi/pull/2725

    NIFI-4988 Changed to handle an invalid ZIP file

    Changed the exception handling so that an invalid ZIP file is handled. When 
an invalid zip is processed, the exception is an IllegalArgumentException which 
was not being handled and thus the session was being rollbacked. 
    
    Thank you for submitting a contribution to Apache NiFi.
    
    In order to streamline the review of the contribution we ask you
    to ensure the following steps have been taken:
    
    ### For all changes:
    - [X ] Is there a JIRA ticket associated with this PR? Is it referenced 
         in the commit message?
    
    - [X ] Does your PR title start with NIFI-XXXX where XXXX is the JIRA 
number you are trying to resolve? Pay particular attention to the hyphen "-" 
character.
    
    - [X ] Has your PR been rebased against the latest commit within the target 
branch (typically master)?
    
    - [ X] Is your initial contribution a single, squashed commit?
    
    ### For code changes:
    - [ X] Have you ensured that the full suite of tests is executed via mvn 
-Pcontrib-check clean install at the root nifi folder?
    - [X ] Have you written or updated unit tests to verify your changes?
    - [N/A ] If adding new dependencies to the code, are these dependencies 
licensed in a way that is compatible for inclusion under [ASF 
2.0](http://www.apache.org/legal/resolved.html#category-a)? 
    - [N/A ] If applicable, have you updated the LICENSE file, including the 
main LICENSE file under nifi-assembly?
    - [N/A ] If applicable, have you updated the NOTICE file, including the 
main NOTICE file found under nifi-assembly?
    - [N/A ] If adding new Properties, have you added .displayName in addition 
to .name (programmatic access) for each of the new properties?
    
    ### For documentation related changes:
    - [N/A ] Have you ensured that format looks appropriate for the output in 
which it is rendered?
    
    ### Note:
    Please ensure that once the PR is submitted, you check travis-ci for build 
issues and submit an update to your PR as soon as possible.


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/apsaltis/nifi NIFI-4988

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/nifi/pull/2725.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #2725
    
----
commit bca63409d0fb37df715c3095a926a00bb88ba151
Author: Andrew Psaltis <apsaltis@...>
Date:   2018-05-20T07:10:39Z

    NIFI-4988 Changed the exception handling so that an invliad ZIP is handled. 
When an invalid zip is processed, the exception is an IllegalArgumentException 
which was not being handled and thus the session was being rollbacked.

----


> UnpackContent throws "java.lang.IllegalArgumentException: invalid entry size" 
> and Administratively Yields
> ---------------------------------------------------------------------------------------------------------
>
>                 Key: NIFI-4988
>                 URL: https://issues.apache.org/jira/browse/NIFI-4988
>             Project: Apache NiFi
>          Issue Type: Bug
>    Affects Versions: 1.4.0, 1.5.0
>            Reporter: William Vilwock
>            Assignee: Andrew Psaltis
>            Priority: Major
>         Attachments: 1474061523922903.zip, 1474113567697855.zip, 
> UnpackContent-NIFI-4988.xml
>
>
> When using the UnpackContent processor we sometimes receive the error 
> "java.lang.IllegalArgumentException: invalid entry size". Instead of the flow 
> file being routed to the failure relationship, the session is rolled back, 
> the flow file is penalized, and the framework "Administratively Yields". This 
> is causing our flow to back up. We would expect the malformed zip to be 
> routed to the failure relationship, not tried again. We received this 
> exception in both NiFi 1.4.0 and 1.5.0. 
> This is our exception stack trace:
> java.lang.IllegalArgumentException: invalid entry size
>  at 
> org.apache.commons.compress.archivers.zip.ZipArchiveEntry.setSize(ZipArchiveEntry.java:679)
>  at 
> org.apache.commons.compress.archivers.zip.ZipArchiveInputStream.readDataDescriptor(ZipArchiveInputStream.java:764)
>  at 
> org.apache.commons.compress.archivers.zip.ZipArchiveInputStream.closeEntry(ZipArchiveInputStream.java:651)
>  at 
> org.apache.commons.compress.archivers.zip.ZipArchiveInputStream.getNextZipEntry(ZipArchiveInputStream.java:225)
>  at 
> org.apache.commons.compress.archivers.zip.ZipArchiveInputStream.getNextEntry(ZipArchiveInputStream.java:378)
>  at 
> org.apache.nifi.processors.standard.UnpackContent$ZipUnpacker$1.process(UnpackContent.java:362)
>  at 
> org.apache.nifi.controller.repository.StandardProcessSession.read(StandardProcessSession.java:2175)
>  at 
> org.apache.nifi.controller.repository.StandardProcessSession.read(StandardProcessSession.java:2145)
>  at 
> org.apache.nifi.processors.standard.UnpackContent$ZipUnpacker.unpack(UnpackContent.java:356)
>  at 
> org.apache.nifi.processors.standard.UnpackContent.onTrigger(UnpackContent.java:255)
>  at 
> org.apache.nifi.processor.AbstractProcessor.onTrigger(AbstractProcessor.java:27)
>  at 
> org.apache.nifi.controller.StandardProcessorNode.onTrigger(StandardProcessorNode.java:1122)
>  at 
> org.apache.nifi.controller.tasks.ContinuallyRunProcessorTask.call(ContinuallyRunProcessorTask.java:147)
>  at 
> org.apache.nifi.controller.tasks.ContinuallyRunProcessorTask.call(ContinuallyRunProcessorTask.java:47)
>  at 
> org.apache.nifi.controller.scheduling.TimerDrivenSchedulingAgent$1.run(TimerDrivenSchedulingAgent.java:128)
>  at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
>  at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
>  at 
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
>  at 
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
>  at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>  at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>  at java.lang.Thread.run(Thread.java:748)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to