Support Questions

Find answers, ask questions, and share your expertise

HDF NiFi issue. Not recognizing directories

avatar

Hello All,

I have installed Nifi(HDF) on server A. I connect to Ambari and Launch NiFi UI. Everything looks good till here.

FIrst i tried to copy a file from 1 directory to another using GetFile. It did not recognize the directory and got the following error

"input directory invalidated because input directory does not exist while creating getfile in nifi".

I am on the same server where Nifi is Launched. I checked all permissions and everything looks good but not sure why it complains directory does not exist.

I tried to generate a file and write to a directory, files are getting generated but getting below error.

"failure due to java.nio.file.AccessDeniedException: /home/xxx/receive: java.nio.file.AccessDeniedException"

can someone please help me in fixing this issue.

1 ACCEPTED SOLUTION

avatar
Master Mentor
@Mr Anticipation

-

The ERROR says you have a permissions issue.

The user who owns the NiFi java process does not have permissions to navigate down the path /home/xxx/receive and/or does not have permissions to files you want to ingest.

-

Ambari by default creates the "nifi" service user account which is used to run NiFi. As such, that "NiFi" user must have access to traverse that directory path and consume the target file(s).

-

following command can be used to see what user owns the two nifi processes.

# ps -ef|grep -i nifi 

-

Thank you,

Matt

-

If you found this answer addressed your question, please take a moment to login in and click the "ACCEPT" link.

View solution in original post

5 REPLIES 5

avatar
Master Mentor
@Mr Anticipation

-

The ERROR says you have a permissions issue.

The user who owns the NiFi java process does not have permissions to navigate down the path /home/xxx/receive and/or does not have permissions to files you want to ingest.

-

Ambari by default creates the "nifi" service user account which is used to run NiFi. As such, that "NiFi" user must have access to traverse that directory path and consume the target file(s).

-

following command can be used to see what user owns the two nifi processes.

# ps -ef|grep -i nifi 

-

Thank you,

Matt

-

If you found this answer addressed your question, please take a moment to login in and click the "ACCEPT" link.

avatar
Master Mentor

@Mr Anticipation

-

*** Community Forum Tip: Try to avoid starting a new answer in response to an existing answer. Instead use comments to respond to existing answers. There is no guaranteed order to different answer which can make it hard following a discussion.

-

1. NiFi and NiFi-registry are two totally different pieces of software. Each of these services are likely running as different service users. HDF service user defaults:
NiFi service --- default service user is "nifi"

NiFi Registry service ---> default service user is "nifiregistry"

-

2. The NiFi service is where you are building your dataflows on the canvas. The NiFi-Registry service is used to store version controlled dataflows from your NiFi.

-

3. Make sure that the directory you are trying to ingest files is accessible by the nifi service user. Suggest accessing server via command line and becoming the nifi service user (#sudo su - nifi) and then navigate to the target directory cd /home/xxx/receive.

Keep in mind that even though the "receive" directory may be set to 777, if the nifi service user can't access /home or /home/xxx they will not be able to see "/home/xxx/receive" regardless of what permissions are set on that directory.

-

Thank you,

Matt

avatar

Perfect Matt. makes sense. I changed the directory to /tmp and i was able to write the files.

avatar

Hi Matt,

Thank you for the response. For directory /home/xxx/receive I have given 777 permission and that should resolve the permission issue right?

I ran grep command and it gave me a huge output. I looked for "/usr/hdf/current/nifi-registry/bin/nifi-registry.sh"

and owner and group was "nifiregistry".

avatar

@Matt Clarke,

would you please help me in resolving this issue? I still do not understand why permission 777 is unable to resolve the issue.