Support Questions

Find answers, ask questions, and share your expertise

Exception in thread "main" java.io.IOException: /home/nifi-1.6.0/run directory does not have read/write privilege

avatar
Contributor

I have installed Nifi-1.6.0 and when I fire the command `./nifi.sh start` in terminal, it is showing `Exception in thread "main" java.io.IOException: /home/nifi-1.6.0/run directory does not have read/write privilege`.

76523-main-javaio.png

Although on browser GUI, Nifi is coming well on `localhost:8080/nifi`.

1 ACCEPTED SOLUTION

avatar
Contributor

Okay ! after a bit of search on stackoverflow I came across the command

`sudo chown -R $USER:$USER /home/rahul/nifi-1.6.0`

that will give the permission to the folder to alter the changes with permission to read and write, and Bingo !!! it worked .

And after firing the command mentioned in above, there is no error as following :

Exception in thread "main" java.io.IOException: /home/nifi-1.6.0/run directory does not have read/write privilege

Thanks @Matt Clarke @Jay Kumar SenSharma


View solution in original post

5 REPLIES 5

avatar
Master Mentor

@Rahul Kumar

There is a typo in your command.

You are running it as :

# cd /home/rahul/nifi-1.6.0/bin
# . nifi.sh start

Where as you should run the command as following:

# cd /home/rahul/nifi-1.6.0/bin
# ./nifi.sh start

.

NOTE: "./nifi.sh". There is no space between DOT and nifi.sh

avatar
Contributor

Still showing same error

76544-still-error-persists.png

avatar
Master Mentor
@Rahul Kumar

-

The NiFi "run" directory is where NiFi creates the "nifi.pid" and "nifi.status" files during startup.

-

You should make sure that the user that owns teh NiFi process has the ability to create files inside the /home/rahul/nifi-1.6.0/run directory.

-

Your NiFi should have failed to start.

Take a look in your nifi-bootstrap.log file to see when the last time you see:

org.apache.nifi.bootstrap.Command Starting Apache NiFi...

Does the timestamp for that line correspond with your latest attempt to start NiFi?

My thought is that their was already a NiFi process running and what you see in browser is really not the same process as to what you think you just started.

Run the following command to see what nifi is actually running and how long it has been running:

ps -ef|grep "TIME\|nifi-1"

-

Thank you,
Matt

avatar
Contributor

I started nifi just now and it is showing too in the nifi-bootstrap.log

76542-bootstrap-nifi.png

I ran

ps -ef|grep "TIME\|nifi-1"                                                                                                                                

which gave following result as shown in the image, but still java.io.exception is there...

76543-ps-efgrep-timenifi-1.png

avatar
Contributor

Okay ! after a bit of search on stackoverflow I came across the command

`sudo chown -R $USER:$USER /home/rahul/nifi-1.6.0`

that will give the permission to the folder to alter the changes with permission to read and write, and Bingo !!! it worked .

And after firing the command mentioned in above, there is no error as following :

Exception in thread "main" java.io.IOException: /home/nifi-1.6.0/run directory does not have read/write privilege

Thanks @Matt Clarke @Jay Kumar SenSharma