Support Questions

Find answers, ask questions, and share your expertise

Nifi starts without error but cannot connect

avatar
Contributor

Hi

 

I am very new to nifi and try to install and configure the system.

 

I started nifi.sh start and it shows 

 

Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home

NiFi home: /Users/daniel/Downloads/nifi-1.15.3

 

Bootstrap Config File: /Users/daniel/Downloads/nifi-1.15.3/conf/bootstrap.conf

 

And when i enter nifi.sh  status, terminal shows:

 

2022-02-26 09:31:33,238 INFO [main] org.apache.nifi.bootstrap.Command Apache NiFi is currently running, listening to Bootstrap on port 52929, PID=74313

 

I changed nifi.web.http.port in nifi.properties to 8080.

 

But still I do not see any on localhost:8080.

 

In the log file there is no message that server has started on 8080 port.

 

I have no idea what problem caused the issue.

 

Please advise me.

 

Thanks

1 ACCEPTED SOLUTION

avatar
Super Guru

Hi @CookieCream ,

 

I think I have a good idea of what's going on. The bootstrap.log, which you shared in pvt, has an error message complaining about a invalid key size. When I saw that I checked again your Java version and realized that you're using a very old Java version (1.8.0_65). In this version of Java, cryptographic key sizes were limited and you could not create long keys. Because of that, NiFi fails to create the TLS keys when it starts. To enable that in your Java version, you would have to download the Java Cryptography Extension (JCE) Unlimited Strength policies and copy them to your Java home manually to allow AES keys of size 256 and larger. These policies were only included by default in the JDK starting from update 1.8.0_162.

 

So, you have two options to make this work:

  • (Recommended) Upgrade your JDK to the latest Java 1.8 or, preferrably, to Java 11 (do not use versions higher than 11 because they are not supported by NiFi)
  • Alternatively, you can download the Java Cryptography Extension (JCE) Unlimited Strength, unzip it and follow the steps in the README.TXT to install it.

Once you do one of the above, clean up the directories of your previous attempts and try again with the steps that I copied below:

wget "https://downloads.apache.org/nifi/1.15.3/nifi-1.15.3-bin.tar.gz" -P .
tar -zxvf ./nifi-1.15.3-bin.tar.gz
cd nifi-1.15.3
./bin/nifi.sh set-single-user-credentials admin supersecret1
./bin/nifi.sh start

 

Please let us know if it works this time 😉

 

Cheers,

André

--
Was your question answered? Please take some time to click on "Accept as Solution" below this post.
If you find a reply useful, say thanks by clicking on the thumbs up button.

--
Was your question answered? Please take some time to click on "Accept as Solution" below this post.
If you find a reply useful, say thanks by clicking on the thumbs up button.

View solution in original post

25 REPLIES 25

avatar
Super Guru

That's really weird. I executed exactly the commands that I listed and it works for me. 

Are you sure that you started in an empty directory?

 

What the OS of your computer?

--
Was your question answered? Please take some time to click on "Accept as Solution" below this post.
If you find a reply useful, say thanks by clicking on the thumbs up button.

avatar
Contributor

@araujo 

 

macOS Monterey v 12.2.1

 

Since the wget command did not work on the terminal, I directly enter the url and downloaded .tar file and follow exactly as you explained. 

Thanks.

avatar
Super Guru

Can you please upload your nifi-app.log here?

--
Was your question answered? Please take some time to click on "Accept as Solution" below this post.
If you find a reply useful, say thanks by clicking on the thumbs up button.

avatar
Super Guru

And the nifi-bootstrap.log file as well, please.

--
Was your question answered? Please take some time to click on "Accept as Solution" below this post.
If you find a reply useful, say thanks by clicking on the thumbs up button.

avatar
Contributor

@araujo 

 

Do you know how to upload file? because it says "The file type (.log) is not supported."

avatar
Super Guru

Just rename the file to .txt and try to upload.

If it doesn't work, you can copy and paste the content in a Word document (.docx)

 

--
Was your question answered? Please take some time to click on "Accept as Solution" below this post.
If you find a reply useful, say thanks by clicking on the thumbs up button.

avatar
Super Guru

@CookieCream 

 

Did you solve the problem? Are you able to share the logs?

 

André

--

Was your question answered? Make sure to mark the answer as the accepted solution.
If you find a reply useful, say thanks by clicking on the thumbs up button.

 

--
Was your question answered? Please take some time to click on "Accept as Solution" below this post.
If you find a reply useful, say thanks by clicking on the thumbs up button.

avatar
Super Guru

Hi @CookieCream ,

 

I think I have a good idea of what's going on. The bootstrap.log, which you shared in pvt, has an error message complaining about a invalid key size. When I saw that I checked again your Java version and realized that you're using a very old Java version (1.8.0_65). In this version of Java, cryptographic key sizes were limited and you could not create long keys. Because of that, NiFi fails to create the TLS keys when it starts. To enable that in your Java version, you would have to download the Java Cryptography Extension (JCE) Unlimited Strength policies and copy them to your Java home manually to allow AES keys of size 256 and larger. These policies were only included by default in the JDK starting from update 1.8.0_162.

 

So, you have two options to make this work:

  • (Recommended) Upgrade your JDK to the latest Java 1.8 or, preferrably, to Java 11 (do not use versions higher than 11 because they are not supported by NiFi)
  • Alternatively, you can download the Java Cryptography Extension (JCE) Unlimited Strength, unzip it and follow the steps in the README.TXT to install it.

Once you do one of the above, clean up the directories of your previous attempts and try again with the steps that I copied below:

wget "https://downloads.apache.org/nifi/1.15.3/nifi-1.15.3-bin.tar.gz" -P .
tar -zxvf ./nifi-1.15.3-bin.tar.gz
cd nifi-1.15.3
./bin/nifi.sh set-single-user-credentials admin supersecret1
./bin/nifi.sh start

 

Please let us know if it works this time 😉

 

Cheers,

André

--
Was your question answered? Please take some time to click on "Accept as Solution" below this post.
If you find a reply useful, say thanks by clicking on the thumbs up button.

--
Was your question answered? Please take some time to click on "Accept as Solution" below this post.
If you find a reply useful, say thanks by clicking on the thumbs up button.

avatar
Contributor

@araujo 

As I updated jdk version to 17.0.2, it works!!!

 

It might be silly but have a couple more questions:

1. As I check for the java version on the terminal, it shows the right version

java version "17.0.2" 2022-01-18 LTS
Java(TM) SE Runtime Environment (build 17.0.2+8-LTS-86)
Java HotSpot(TM) 64-Bit Server VM (build 17.0.2+8-LTS-86, mixed mode, sharing)

But JAVA_HOME environment variable holds the old directory and I have to type 'export JAVA_HOME = 

/Library/Java/JavaVirtualMachines/jdk-17.0.2.jdk/Contents/Home' every time I open the terminal to launch nifi.

Could you tell me how to set JAVA_HOME permanently?

 

2. When I access to nifi, it asks me to enter User and Password.

I found the answer for the same issue and it says that I could find the user info as search text 'Generated User'/'Generated Password' on nifi-app.log, but I do not see any information

 

Thank you.

avatar
Super Guru

Hi, @CookieCream 

 


As I updated jdk version to 17.0.2, it works!!!

Great to hear it works. However, as I mentioned in my previous post, please note that NiFi is not supported on Java 17, only Java 8 and 11. Please bear this in mind. If you find any strange behaviour, try using Java 11 instead.

 

It might be silly but have a couple more questions:

1. As I check for the java version on the terminal, it shows the right version

 

 

java version "17.0.2" 2022-01-18 LTS
Java(TM) SE Runtime Environment (build 17.0.2+8-LTS-86)
Java HotSpot(TM) 64-Bit Server VM (build 17.0.2+8-LTS-86, mixed mode, sharing)

 

 

But JAVA_HOME environment variable holds the old directory and I have to type 'export JAVA_HOME = 

/Library/Java/JavaVirtualMachines/jdk-17.0.2.jdk/Contents/Home' every time I open the terminal to launch nifi.

Could you tell me how to set JAVA_HOME permanently?

 I'm not sure how JAVA_HOME is being set in your environment. I guess this depends on how Java 8 was installed in the first place.

 

But one way to overwrite this is to add the export command at the end of you ~/.bashrc file. This way it will be executed automatically every time you open a new terminal.

 

2. When I access to nifi, it asks me to enter User and Password.

I found the answer for the same issue and it says that I could find the user info as search text 'Generated User'/'Generated Password' on nifi-app.log, but I do not see any information

 

Thank you.


If you ran the commands I listed before, you executed this as well: 

 

 

./bin/nifi.sh set-single-user-credentials admin supersecret1

 

 

 

This sets your credentials to admin/supersecret1, instead of getting them generated randomly. Try using these credentials to log in.

 

Cheers,

André

 

--
Was your question answered? Please take some time to click on "Accept as Solution" below this post.
If you find a reply useful, say thanks by clicking on the thumbs up button.