Support Questions

Find answers, ask questions, and share your expertise

NiFi PutFile processor: What directory to use? Nothing getting written to the directory?

Explorer

Hello,

I am using NiFi 1.4.0 and using it with Chrome Version 65.0.3325.181 on a Win 10 box. I have a PutFile process and I am looking to write date to an output file on my local hard drive, like c:\data. The process works and I have c:\data in the Directory field, but I am not getting data written c:\data. The folder is empty, and not sure what else I can do. Can you help?

Thanks,

Paul

10 REPLIES 10

Super Guru

@Paul Byrum

Use cmd terminal to go to data directory and mention the full path in directory value.
You need to mention path as below if you want to see those files in your data directory

C:\Users\<username>\Data 

-
Go to cd c:\Data directory using command prompt(cmd) to check the already written files from NiFi

Example:-

If i want to write any file from NiFi to Downloads directory i need to mention below path in PutFile directory value

C:\Users\Shu\Downloads

if i use C:\Downloads we are writing the file into C:\Downloads not to C:\Users\Shu\Downloads, use cmd terminal(cd C:\Downloads) to see the files.

Explorer

There is no data written to c:\data. Is it a permission issue? There are 10.1 MB in, but 0 bytes out. Could there be something wrong with the PutFile settings? For example:

These are both checked in the Settings tab:

  • Automatically Terminate Relationships
  • failure Files that could not be written to the output directory for some reason are transferred to this relationship
  • success Files that have been successfully written to the output directory are transferred to this relationship

Super Guru
@Paul Byrum

Check once the permissions because there needs to be 10.1 MB in and also Out.
For debug purpose use funnel and connect success and failure relationships from PutFile processor.

Sample Flow:

71481-putfile.png

Check where the files are routing to success or failure relationships, if the files are routing to failure relation then go to nifi-app.log to find the root cause.

Explorer

Interesting, the success route has 9 in the queue now and 1.45 MB. Nothing going the failure route. Is there other configuration need for the funnel?

Super Guru
@Paul Byrum

Funnel is just for testing out where the flowfiles are routing to i.e is they are going to Success or Failure relationship, there is no other configs needed for funnel.

Now 9 flowfiles are routed to Success relationship(i.e no permission issues encountered), now check the files in the directory(c:\data).

72518-data.png

If you are still not able to see the files in the directory share PutFile processor configs and list of files in data directory using ui (or) cmd screenshots.

Explorer

Where would the nifi-app.log be located? I am a Win 10 desktop (client) using NiFi with Chrome. I don't have access to the server. Where would these be on my desktop?

Explorer

72523-capture.png

@Shu, do you have other ideas on how to get the PutFile processor to write results to a log file? I am still not seeing files written to any path. I don't have access to the web server and NiFi is not installed on my Win 10 box. I am using NiFi via Chrome.

Explorer

I turned on DEBUG and checked the bulletin board and I get this:

3:27:42 UTC INFO 1967bc4d-0163-1000-1af5-b40c46be92b6

PutFile[id=1967bc4d-0163-1000-1af5-b40c46be92b6] Produced copy of StandardFlowFileRecord[uuid=58d18018-a864-4c12-a98d-498bbf8d19d1,claim=StandardContentClaim [resourceClaim=StandardResourceClaim[id=1525145201278-982, container=default, section=982], offset=336986, length=168493],offset=0,name=3706261132832753,size=168493] at location c:/test/3706261132832753

I made sure the path has full control on c:\test. Still, there are no files being written to c:\test. I even switch around the / to \ in the path.

Explorer

Hi @Shu, Does NiFi support writing the files on C:\ for Win 10 when using Chrome and you are using the PutFile processor? Is there a bug with NiFi? I am running out of options to try to get this working. Thanks for your help.

Super Guru
@Paul Byrum

I don't think we can write to c:\ but can you use the below commands to check the files in test directory(is there any setting causing to hide these files?).

Open cmd terminal

c:\Users>cd ..
c:\>cd c:\test
c:\>dir

72537-dir.png

72538-dir1.png

then you are going to see all the files in the directory.

if you don't see any files still then use

PutFile[id=1967bc4d-0163-1000-1af5-b40c46be92b6] Produced copy of StandardFlowFileRecord[uuid=58d18018-a864-4c12-a98d-498bbf8d19d1,claim=StandardContentClaim [resourceClaim=StandardResourceClaim[id=1525145201278-982, container=default, section=982], offset=336986, length=168493],offset=0,name=3706261132832753,size=168493] at location c:/test/3706261132832753

Assuming with above logs to configure GetFile processor and configure the processor with your test directory and file filter as same filename that you have stored into the directory

Input Directory

C:\test 

File Filter

3706261132832753

Keep Source File

false
Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.