Created 02-26-2022 09:38 AM
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
Created 03-09-2022 01:57 PM
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:
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.
Created 02-26-2022 02:28 PM
Hi @CookieCream
NiFi in the latest version is deployed automatically with security and TLS enabled.
You need to set the single user credentials and connect to port 8443 instead of 8080.
Please check the documentation: https://nifi.apache.org/docs/nifi-docs/html/getting-started.html#i-started-nifi-now-what
Cheers
André
Created 02-27-2022 11:45 PM
Hi @araujo
Thanks for the advice
I made the http post empty and re-launched the nifi but still have an issue.
On nifi-app.log file, I found the the following error message which I have no idea how to solve.
Please advise me.
2022-02-27 23:08:19,323 INFO [main] o.a.n.r.v.FileBasedVariableRegistry Loaded 112 properties from system properties and environment variables
2022-02-27 23:08:19,324 INFO [main] o.a.n.r.v.FileBasedVariableRegistry Loaded a total of 112 properties. Including precedence overrides effective accessible registry key size is 112
2022-02-27 23:08:20,716 WARN [main] o.a.nifi.security.util.SslContextFactory Some truststore properties are populated (./conf/truststore.p12, ********, PKCS12) but not valid
2022-02-27 23:08:20,717 ERROR [main] o.apache.nifi.controller.FlowController Unable to start the flow controller because the TLS configuration was invalid: The truststore properties are not valid
2022-02-27 23:08:21,135 ERROR [main] o.s.web.context.ContextLoader Context initialization failed
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration': Unsatisfied dependency expressed through method 'setFilterChainProxySecurityConfigurer' parameter 1; nested exception is org.springframework.beans.factory.BeanExpressionException: Expression parsing failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.apache.nifi.web.NiFiWebApiSecurityConfiguration': Unsatisfied dependency expressed through method 'setJwtAuthenticationProvider' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.apache.nifi.web.security.configuration.JwtAuthenticationSecurityConfiguration': Unsatisfied dependency expressed through constructor parameter 3; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'flowController': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalStateException: Flow controller TLS configuration is invalid
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.resolveMethodArguments(AutowiredAnnotationBeanPostProcessor.java:767)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.inject(AutowiredAnnotationBeanPostProcessor.java:719)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:119)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:399)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1431)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:619)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:944)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:401)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:292)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:103)
at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:1067)
at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:572)
at org.eclipse.jetty.server.handler.ContextHandler.contextInitialized(ContextHandler.java:996)
at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:746)
at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:379)
at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1449)
at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1414)
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:910)
at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:288)
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:524)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:73)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:169)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:117)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:97)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:73)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:169)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:110)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:97)
at org.eclipse.jetty.server.handler.gzip.GzipHandler.doStart(GzipHandler.java:426)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:73)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:169)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:117)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:97)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:73)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:169)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:117)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:97)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:73)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:169)
at org.eclipse.jetty.server.Server.start(Server.java:423)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:110)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:97)
at org.eclipse.jetty.server.Server.doStart(Server.java:387)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:73)
at org.apache.nifi.web.server.JettyServer.start(JettyServer.java:1142)
at org.apache.nifi.NiFi.<init>(NiFi.java:170)
at org.apache.nifi.NiFi.<init>(NiFi.java:82)
at org.apache.nifi.NiFi.main(NiFi.java:330)
Caused by: org.springframework.beans.factory.BeanExpressionException: Expression parsing failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.apache.nifi.web.NiFiWebApiSecurityConfiguration': Unsatisfied dependency expressed through method 'setJwtAuthenticationProvider' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.apache.nifi.web.security.configuration.JwtAuthenticationSecurityConfiguration': Unsatisfied dependency expressed through constructor parameter 3; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'flowController': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalStateException: Flow controller TLS configuration is invalid
at org.springframework.context.expression.StandardBeanExpressionResolver.evaluate(StandardBeanExpressionResolver.java:170)
at org.springframework.beans.factory.support.AbstractBeanFactory.evaluateBeanDefinitionString(AbstractBeanFactory.java:1631)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1324)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1300)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.resolveMethodArguments(AutowiredAnnotationBeanPostProcessor.java:759)
... 54 common frames omitted
Created 02-28-2022 01:46 AM
What do you mean by "made the http post empty"?
I would suggest that you remove your NiFi directory and restart from scratch following these instructions:
https://nifi.apache.org/docs/nifi-docs/html/getting-started.html#downloading-and-installing-nifi
If you follow the exact instructions the installation should work without problems.
Cheers,
André
Created 03-01-2022 03:33 PM
I did as you advised; remove the existing NiFi directory and start from scratch as instruction states.
But as I start nifi.sh, the same error message shows on the log 😞
Created 03-01-2022 06:49 PM
Which Java version to you have in your machine?
Could you please run the following command and provide the output?
java -version
Cheers,
André
Created 03-01-2022 10:50 PM
java version "1.8.0_65"
Java(TM) SE Runtime Environment (build 1.8.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.65-b01, mixed mode)
Thanks
Daeyong
Created 03-02-2022 03:25 AM
Try these steps below after you delete your current nifi directory:
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
I just tested this on my laptop and it works without problems.
Cheers,
André
Created 03-02-2022 08:57 PM
Did the above work?
André
Created 03-02-2022 09:44 PM
I really appreciate for your help but unfortunately not working 😞
Still see the same error on nifi-app.log file.
2022-03-02 21:41:40,683 INFO [main] o.a.n.r.v.FileBasedVariableRegistry Loaded 117 properties from system properties and environment variables
2022-03-02 21:41:40,684 INFO [main] o.a.n.r.v.FileBasedVariableRegistry Loaded a total of 117 properties. Including precedence overrides effective accessible registry key size is 117
2022-03-02 21:41:41,102 WARN [main] o.a.nifi.security.util.SslContextFactory Some truststore properties are populated (./conf/truststore.p12, null, PKCS12) but not valid
2022-03-02 21:41:41,103 ERROR [main] o.apache.nifi.controller.FlowController Unable to start the flow controller because the TLS configuration was invalid: The truststore properties are not valid
2022-03-02 21:41:41,216 ERROR [main] o.s.web.context.ContextLoader Context initialization failed
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration': Unsatisfied dependency expressed through method 'setFilterChainProxySecurityConfigurer' parameter 1; nested exception is org.springframework.beans.factory.BeanExpressionException: Expression parsing failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.apache.nifi.web.NiFiWebApiSecurityConfiguration': Unsatisfied dependency expressed through method 'setJwtAuthenticationProvider' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.apache.nifi.web.security.configuration.JwtAuthenticationSecurityConfiguration': Unsatisfied dependency expressed through constructor parameter 3; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'flowController': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalStateException: Flow controller TLS configuration is invalid
Created 03-02-2022 10:32 PM
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?
Created 03-02-2022 10:38 PM
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.
Created 03-02-2022 11:22 PM
Can you please upload your nifi-app.log here?
Created 03-02-2022 11:24 PM
And the nifi-bootstrap.log file as well, please.
Created 03-02-2022 11:33 PM
Created 03-02-2022 11:36 PM
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)
Created on 03-08-2022 12:46 PM - edited 03-08-2022 12:51 PM
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.
Created 03-09-2022 01:57 PM
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:
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.
Created 03-09-2022 04:27 PM
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.
Created 03-09-2022 05:32 PM
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é
Created 03-09-2022 05:43 PM