6

In my current project, I have been using apache nifi for some experiments purpose. When I have configured the first time. The nifi was running perfect (I was able to see the canvas, toolbar on Google Chrome when I typed http://localhost:8080/nifi/ ). But, after restarting my computer once, I am not able to run it.

When I type nifi.0.7.0\bin\run-nifi.bat command, I see the following message on the console.

2016-07-27 10:19:39,246 INFO [main] org.apache.nifi.bootstrap.Command Starting A
pache NiFi...
2016-07-27 10:19:39,246 INFO [main] org.apache.nifi.bootstrap.Command Working Di
rectory: C:\NIFI-0~1.0
2016-07-27 10:19:39,246 INFO [main] org.apache.nifi.bootstrap.Command Command: C
:\Program Files\Java\jdk1.8.0_102\bin\java.exe -classpath C:\NIFI-0~1.0\.\conf;C
:\NIFI-0~1.0\.\lib\jcl-over-slf4j-1.7.12.jar;C:\NIFI-0~1.0\.\lib\jul-to-slf4j-1.
7.12.jar;C:\NIFI-0~1.0\.\lib\log4j-over-slf4j-1.7.12.jar;C:\NIFI-0~1.0\.\lib\log
back-classic-1.1.3.jar;C:\NIFI-0~1.0\.\lib\logback-core-1.1.3.jar;C:\NIFI-0~1.0\
.\lib\nifi-api-0.7.0.jar;C:\NIFI-0~1.0\.\lib\nifi-documentation-0.7.0.jar;C:\NIF
I-0~1.0\.\lib\nifi-nar-utils-0.7.0.jar;C:\NIFI-0~1.0\.\lib\nifi-properties-0.7.0
.jar;C:\NIFI-0~1.0\.\lib\nifi-runtime-0.7.0.jar;C:\NIFI-0~1.0\.\lib\slf4j-api-1.
7.12.jar -Dorg.apache.jasper.compiler.disablejsr199=true -Xmx512m -Xms512m -Dsun
.net.http.allowRestrictedHeaders=true -Djava.net.preferIPv4Stack=true -Djava.awt
.headless=true -Djava.protocol.handler.pkgs=sun.net.www.protocol -Dnifi.properti
es.file.path=C:\NIFI-0~1.0\.\conf\nifi.properties -Dnifi.bootstrap.listen.port=4
9823 -Dapp=NiFi -Dorg.apache.nifi.bootstrap.config.log.dir=C:\NIFI-0~1.0\bin\..\
\logs org.apache.nifi.NiFi

Could you please advise me what is the problem? and how could I resolve the issue?

More more information, the content of nifi-app.log is as follows:

2016-07-31 17:47:52,531 INFO [main] org.apache.nifi.NiFi Launching NiFi...
2016-07-31 17:47:52,687 INFO [main] org.apache.nifi.BootstrapListener Started Bootstrap Listener, Listening for incoming requests on port 54877
2016-07-31 17:47:52,718 INFO [main] org.apache.nifi.BootstrapListener Successfully initiated communication with Bootstrap
2016-07-31 17:58:20,339 INFO [main] org.apache.nifi.NiFi Launching NiFi...
2016-07-31 17:58:20,464 INFO [main] org.apache.nifi.BootstrapListener Started Bootstrap Listener, Listening for incoming requests on port 49217
2016-07-31 17:58:20,480 INFO [main] org.apache.nifi.BootstrapListener Successfully initiated communication with Bootstrap

The content of nifi-bootstrap.log is as follows:

2016-07-31 17:47:52,013 INFO [main] o.a.n.b.NotificationServiceManager Successfully loaded the following 0 services: []
2016-07-31 17:47:52,013 INFO [main] org.apache.nifi.bootstrap.RunNiFi Registered no Notification Services for Notification Type NIFI_STARTED
2016-07-31 17:47:52,013 INFO [main] org.apache.nifi.bootstrap.RunNiFi Registered no Notification Services for Notification Type NIFI_STOPPED
2016-07-31 17:47:52,013 INFO [main] org.apache.nifi.bootstrap.RunNiFi Registered no Notification Services for Notification Type NIFI_DIED
2016-07-31 17:47:52,029 INFO [main] org.apache.nifi.bootstrap.Command Starting Apache NiFi...
2016-07-31 17:47:52,029 INFO [main] org.apache.nifi.bootstrap.Command Working Directory: C:\NIFI-0~1.0
2016-07-31 17:47:52,029 INFO [main] org.apache.nifi.bootstrap.Command Command: C:\Program Files\Java\jdk1.8.0_102\bin\java.exe -classpath C:\NIFI-0~1.0\.\conf;C:\NIFI-0~1.0\.\lib\jcl-over-slf4j-1.7.12.jar;C:\NIFI-0~1.0\.\lib\jul-to-slf4j-1.7.12.jar;C:\NIFI-0~1.0\.\lib\log4j-over-slf4j-1.7.12.jar;C:\NIFI-0~1.0\.\lib\logback-classic-1.1.3.jar;C:\NIFI-0~1.0\.\lib\logback-core-1.1.3.jar;C:\NIFI-0~1.0\.\lib\nifi-api-0.7.0.jar;C:\NIFI-0~1.0\.\lib\nifi-documentation-0.7.0.jar;C:\NIFI-0~1.0\.\lib\nifi-nar-utils-0.7.0.jar;C:\NIFI-0~1.0\.\lib\nifi-properties-0.7.0.jar;C:\NIFI-0~1.0\.\lib\nifi-runtime-0.7.0.jar;C:\NIFI-0~1.0\.\lib\slf4j-api-1.7.12.jar -Dorg.apache.jasper.compiler.disablejsr199=true -Xmx512m -Xms512m -Dsun.net.http.allowRestrictedHeaders=true -Djava.net.preferIPv4Stack=true -Djava.awt.headless=true -Djava.protocol.handler.pkgs=sun.net.www.protocol -Dnifi.properties.file.path=C:\NIFI-0~1.0\.\conf\nifi.properties -Dnifi.bootstrap.listen.port=54876 -Dapp=NiFi -Dorg.apache.nifi.bootstrap.config.log.dir=C:\NIFI-0~1.0\bin\..\\logs org.apache.nifi.NiFi 
2016-07-31 17:47:52,702 WARN [NiFi Bootstrap Command Listener] org.apache.nifi.bootstrap.RunNiFi Failed to set permissions so that only the owner can read status file C:\NIFI-0~1.0\bin\..\run\nifi.pid; this may allows others to have access to the key needed to communicate with NiFi. Permissions should be changed so that only the owner can read this file
2016-07-31 17:47:52,718 INFO [NiFi Bootstrap Command Listener] org.apache.nifi.bootstrap.RunNiFi Apache NiFi now running and listening for Bootstrap requests on port 54877
2016-07-31 17:55:03,208 INFO [main] org.apache.nifi.bootstrap.RunNiFi NiFi never started. Will not restart NiFi
2016-07-31 17:58:18,870 INFO [main] o.a.n.b.NotificationServiceManager Successfully loaded the following 0 services: []
2016-07-31 17:58:18,870 INFO [main] org.apache.nifi.bootstrap.RunNiFi Registered no Notification Services for Notification Type NIFI_STARTED
2016-07-31 17:58:18,870 INFO [main] org.apache.nifi.bootstrap.RunNiFi Registered no Notification Services for Notification Type NIFI_STOPPED
2016-07-31 17:58:18,870 INFO [main] org.apache.nifi.bootstrap.RunNiFi Registered no Notification Services for Notification Type NIFI_DIED
2016-07-31 17:58:19,915 INFO [main] org.apache.nifi.bootstrap.Command Starting Apache NiFi...
2016-07-31 17:58:19,915 INFO [main] org.apache.nifi.bootstrap.Command Working Directory: C:\NIFI-0~1.0
2016-07-31 17:58:19,915 INFO [main] org.apache.nifi.bootstrap.Command Command: C:\Program Files\Java\jdk1.8.0_102\bin\java.exe -classpath C:\NIFI-0~1.0\.\conf;C:\NIFI-0~1.0\.\lib\jcl-over-slf4j-1.7.12.jar;C:\NIFI-0~1.0\.\lib\jul-to-slf4j-1.7.12.jar;C:\NIFI-0~1.0\.\lib\log4j-over-slf4j-1.7.12.jar;C:\NIFI-0~1.0\.\lib\logback-classic-1.1.3.jar;C:\NIFI-0~1.0\.\lib\logback-core-1.1.3.jar;C:\NIFI-0~1.0\.\lib\nifi-api-0.7.0.jar;C:\NIFI-0~1.0\.\lib\nifi-documentation-0.7.0.jar;C:\NIFI-0~1.0\.\lib\nifi-nar-utils-0.7.0.jar;C:\NIFI-0~1.0\.\lib\nifi-properties-0.7.0.jar;C:\NIFI-0~1.0\.\lib\nifi-runtime-0.7.0.jar;C:\NIFI-0~1.0\.\lib\slf4j-api-1.7.12.jar -Dorg.apache.jasper.compiler.disablejsr199=true -Xmx512m -Xms512m -Dsun.net.http.allowRestrictedHeaders=true -Djava.net.preferIPv4Stack=true -Djava.awt.headless=true -Djava.protocol.handler.pkgs=sun.net.www.protocol -Dnifi.properties.file.path=C:\NIFI-0~1.0\.\conf\nifi.properties -Dnifi.bootstrap.listen.port=49216 -Dapp=NiFi -Dorg.apache.nifi.bootstrap.config.log.dir=C:\NIFI-0~1.0\bin\..\\logs org.apache.nifi.NiFi 
2016-07-31 17:58:20,480 WARN [NiFi Bootstrap Command Listener] org.apache.nifi.bootstrap.RunNiFi Failed to set permissions so that only the owner can read status file C:\NIFI-0~1.0\bin\..\run\nifi.pid; this may allows others to have access to the key needed to communicate with NiFi. Permissions should be changed so that only the owner can read this file
2016-07-31 17:58:20,480 INFO [NiFi Bootstrap Command Listener] org.apache.nifi.bootstrap.RunNiFi Apache NiFi now running and listening for Bootstrap requests on port 49217

and nifi-user.log is Empty.

When I try to call localhost:8080/nifi/, I see the following. enter image description here

user7337271
  • 1,662
  • 1
  • 14
  • 23
user-517752
  • 1,188
  • 5
  • 21
  • 54
  • are you able to apache nifi in browser ? – thar45 Jul 27 '16 at 05:15
  • no. I am not able to run apache Nifi in the browser. :( :( – user-517752 Jul 27 '16 at 05:16
  • 1
    I dont see any errors in the above logs . just check the status of nifi .. To see the current status of NiFi, double-click status-nifi.bat – thar45 Jul 27 '16 at 05:25
  • 1
    You should have a look at the `nifi-app.log` file in the `log` directory. There are also a few other log files in there that might be worth a look. – Binary Nerd Jul 27 '16 at 07:16
  • 1
    The output you're showing is what is printed always on startup. Please take a look in the logs/nifi-bootstrap.log and if there is nothing of interest there then take look in nifi-app.log. If there was a failure on startup you will see information about it there. – Joe Witt Jul 28 '16 at 04:26
  • @JoeWitt. Thanks for the suggestions ! I have added log file content. Could you please advise me the solution? – user-517752 Jul 31 '16 at 12:36
  • @Pankesh there should be far more in the nifi-app.log. That is all? Can you check if the java processes are running? The logs look good as supplied but it will show loading of nars and the web service and such in the logs. If it is stuck where you show then keep in mind loading takes at least 10-20 seconds or so. – Joe Witt Aug 01 '16 at 15:30
  • @Pankesh what was the solution to this problem? I am facing the same issue and I see on the web that others have encountered this same issue but never posted how they fixed it. Thank you for your time. – Code Novice Mar 20 '18 at 21:25
  • 1
    I had the same. The solution seems to be that you have to wait a while, a full minute or more, then refresh the url. Basically keep trying and the "site can't be reached" will finally go away and nifi will appear. – Woodchuck May 20 '18 at 06:13
  • @JWoodchuck +1, I had to wait around 3-5 minutes. Thank you –  Sep 20 '19 at 02:28

5 Answers5

8

Try to check if the config file have the following key "nifi.sensitive.props.key=" with a value. If it's empty, please set a key like the example "nifi.sensitive.props.key=132134".

If your still are in troulbe, please watch this video, should help. https://www.youtube.com/watch?v=DDd6KayUHt8

All the best.

user7077454
  • 81
  • 1
  • 2
7

Besides the previous comment which helped me fix the problem, you have also to give it a little time as it has been discussed here https://community.hortonworks.com/questions/107192/nifi-web-ui-not-working-facing-error-err-connectio.html. Indeed, after starting Nifi, the Web interface is not immediately reachable, Nifi needs a period of time to initialize all its stuff. You can follow the execution of Nifi by visiting the log file called: nifi-app.log which you can find in NIFI_HOME/logs. I think the message: org.apache.nifi.NiFi Controller initialization took 132792678105 nanoseconds (132 seconds) is the good sign that Nifi Web interface is ready to be used.

Youness Marhrani
  • 1,084
  • 16
  • 8
  • in the logs folder open nifi-app.log file, if the app is running fine after some time you must see the following line "org.apache.nifi.web.server.JettyServer NiFi has started. The UI is available at the following URLs" at the end of the file – Anantha Raju C Oct 08 '18 at 13:40
3

I was also facing the issue initially but then looking at logs, url was http://127.0.0.1:8080/nifi and it worked instead of localhost

  • It was same for me. First time I started NiFi, it was on localhost, but after restarting my computer and running it again, I was not able to reach it on localhost, but on 127.0.0.1:8080 – Tomas Lukac Apr 01 '21 at 12:23
  • Same for me. Thanks Keerthi. I waited from morning to evening and still it was not working. I restarted couples of time. Read all the logs but didn't found anything. Wondering for it and it got solved this way. Happy for it. – NickyPatel Oct 07 '21 at 16:00
0

Nifi takes some time to start it. Looking at the logs it seems that there are no error while starting. Try to call localhost:8080/nifi after 5 minutes or late. Hope that you will be able to see NiFi-UI after that.

0

The UI takes time to load up, as it will trigger JAVA console and then you have to accept. Post that you can access the url at localhost:8080/nifi

Nitin
  • 396
  • 7
  • 18