Support Questions
Find answers, ask questions, and share your expertise

Nifi processing files as zero bytes


Iam using Nifi 1.3 version and this is the flow..getsftp->putsftp->putsftp.

But at times after the files are picked by getsftp,say if its 190 bytes then putsftp transfers as 0 bytes.

It doesnot happen all the time but at times.

Please find below the error:

2019-01-07 02:00:01,272 ERROR [Timer-Driven Process Thread-7] o.a.nifi.processors.standard.PutSFTP PutSFTP[id=XXX] PutSFTP[id=XXX] failed to process session due to org.apache.nifi.processor.exception.MissingFlowFileException: Unable to find content for FlowFile: {} org.apache.nifi.processor.exception.MissingFlowFileException: Unable to find content for FlowFile at org.apache.nifi.controller.repository.StandardProcessSession.handleContentNotFound( at at at org.apache.nifi.processors.standard.PutFileTransfer.onTrigger( at org.apache.nifi.processor.AbstractProcessor.onTrigger( at org.apache.nifi.controller.StandardProcessorNode.onTrigger( at at at org.apache.nifi.controller.scheduling.TimerDrivenSchedulingAgent$ at java.util.concurrent.Executors$ at java.util.concurrent.FutureTask.runAndReset( at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301( at java.util.concurrent.ScheduledThreadPoolExecutor$ at java.util.concurrent.ThreadPoolExecutor.runWorker( at java.util.concurrent.ThreadPoolExecutor$ at Caused by: org.apache.nifi.controller.repository.ContentNotFoundException: Could not find content for StandardContentClaim [resourceClaim=StandardResourceClaim[id=XXX, container=default, section=490], offset=0, length=190]: Stream contained only 0 bytes but should have contained 190 at at at at at com.jcraft.jsch.ChannelSftp._put( at com.jcraft.jsch.ChannelSftp.put( at com.jcraft.jsch.ChannelSftp.put( at org.apache.nifi.processors.standard.util.SFTPTransfer.put( at org.apache.nifi.processors.standard.PutFileTransfer$1.process( at ... 14 common frames omitted 2019-01-07 02:00:01,272 WARN [Timer-Driven Process Thread-7] o.a.nifi.processors.standard.PutSFTP PutSFTP[id=015b10b1-853c-1b95-d98f-915e12c396bd] Processor Administrat ively Yielded for 1 sec due to processing failure 2019-01-07 02:00:01,273 WARN [Timer-Driven Process Thread-7] o.a.n.c.t.ContinuallyRunProcessorTask Administratively Yielding PutSFTP[id=XXX] due to uncaught Exception: org.apache.nifi.processor.exception.MissingFlowFileException: Unable to find content for FlowFile

Can you please help me in finding why the files are transfered as 0 bytes?


@Matt Clarke

@Shu Can you please help in resolving it

Master Guru

@Gillu Varghese

I would inspect your content repository to see if the referenced claim (StandardResourceClaim[id=XXX, container=default, section=490], offset=0, length=190]) still exists.

Within content_repository directory, I would look for sub-folder "490". Then within that folder look for file named XXX (assuming you replaced actual claim number here with XXX)


It sounds like this file my have been deleted.
Do you have some external process that may be access your content repository?
Was the content repository maybe moved?
Do you maybe have multiple node NiFi cluster where every node is trying to share same mounted content repo?
Was NIFi restarted as different user? This could result in some files in repo being owned by different users which may lead to permissions issues access those files.
FlowFiles are what move from processor to processor. The FlowFile metadata (stored in flowfile repository) includes information on the size and location of the physical content within one of the content repositories (default in this case). In this case, the FlowFile has reached a processor where actually retrieving that content was needed, but could not be found.


Thank you,


; ;