Joseph Gresock created NIFI-5328:
------------------------------------

             Summary: Flow file attributes can break UnpackContent using 
flowfile-tar-v1 format
                 Key: NIFI-5328
                 URL: https://issues.apache.org/jira/browse/NIFI-5328
             Project: Apache NiFi
          Issue Type: Bug
    Affects Versions: 1.6.0
            Reporter: Joseph Gresock


I'm using NiFi to MergeContent using flowfile-tar-v1 format, followed by 
UnpackContent with the same format.  One of my flow files has an attribute with 
the following value:
{code:java}
Unrecognized token 'PKI': was expecting 
('true', 'false' or 'null')
 at [Source: (StringReader); line: 1, column: 12]{code}
 

I can view the resulting tar on disk, and it is formatted correctly.  However, 
the UnpackContent processor gets the following error, apparently caused by 
trying to dereference XML entities from the attribute value:

 

       at 
org.apache.nifi.controller.repository.StandardProcessSession.read(StandardProcessSession.java:2207)
        at 
org.apache.nifi.controller.repository.StandardProcessSession.read(StandardProcessSession.java:2175)
        at 
org.apache.nifi.processors.standard.UnpackContent$FlowFileStreamUnpacker.unpack(UnpackContent.java:409)
        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:1147)
        at 
org.apache.nifi.controller.tasks.ConnectableTask.invoke(ConnectableTask.java:175)
        at 
org.apache.nifi.controller.scheduling.TimerDrivenSchedulingAgent$1.run(TimerDrivenSchedulingAgent.java:117)
        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)
*Caused by: java.util.InvalidPropertiesFormatException: 
org.xml.sax.SAXParseException; lineNumber: 44; columnNumber: 65; Character 
reference "&#*
        at 
sun.util.xml.PlatformXmlPropertiesProvider.load(PlatformXmlPropertiesProvider.java:80)
        at java.util.Properties$XmlSupport.load(Properties.java:1201)
        at java.util.Properties.loadFromXML(Properties.java:881)
        at 
org.apache.nifi.util.FlowFileUnpackagerV1.getAttributes(FlowFileUnpackagerV1.java:74)
        at 
org.apache.nifi.util.FlowFileUnpackagerV1.unpackageFlowFile(FlowFileUnpackagerV1.java:44)
        at 
org.apache.nifi.processors.standard.UnpackContent$FlowFileStreamUnpacker$1$1.process(UnpackContent.java:421)
        at 
org.apache.nifi.controller.repository.StandardProcessSession.write(StandardProcessSession.java:2621)
        ... 16 common frames omitted
Caused by: org.xml.sax.SAXParseException: Character reference "&#
        at 
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203)
        at 
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177)
        at 
com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:400)
        at 
com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:327)
        at 
com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1472)
        at 
com.sun.org.apache.xerces.internal.impl.XMLScanner.scanCharReferenceValue(XMLScanner.java:1345)
        at 
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3053)
        at 
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:602)
        at 
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:505)
        at 
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:842)
        at 
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:771)
        at 
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
        at 
com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:243)
        at 
com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:339)
        at 
sun.util.xml.PlatformXmlPropertiesProvider.getLoadingDoc(PlatformXmlPropertiesProvider.java:106)
        at 
sun.util.xml.PlatformXmlPropertiesProvider.load(PlatformXmlPropertiesProvider.java:78)
        ... 22 common frames omitted



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

Reply via email to