Skip to main content
livsey
Bronze ⭐️⭐️⭐️
August 14, 2024
Question

apache nifi 2.0.0 M2 JettyServer Failed

rebooting the machine. I couldn’t find any information about another solution for this problem.

Good afternoon. when starting apache nifi 2.0.0 M2 (as well as M1, M3, M4), after a while it closes with an error, the java_home variable is defined, nifi_properties indicated its IP. please tell me what the problem is and a possible solution

 

nifi-bootstrap.log

2024-08-13 19:59:22,516 WARN [main] o.a.n.b.process.RuntimeValidatorExecutor Runtime Configuration [AvailableLocalPorts] validation failed: Local Ports [28231] less than recommended [55000] according to [/proc/sys/net/ipv4/ip_local_port_range]
2024-08-13 19:59:22,519 WARN [main] o.a.n.b.process.RuntimeValidatorExecutor Runtime Configuration [Swappiness] validation failed: Swappiness [60] more than recommended [0] according to [/proc/sys/vm/swappiness]
2024-08-13 19:59:23,442 INFO [main] org.apache.nifi.bootstrap.RunNiFi {javaVersion=21.0.4, availableProcessors=3, maxOpenFileDescriptors=1048576, totalPhysicalMemoryMB=5921, minimumHeapSize=1g, maximumHeapSize=1g}
2024-08-13 19:59:26,274 INFO [main] org.apache.nifi.bootstrap.Command Generated Self-Signed Certificate Expiration: 2024-10-12
2024-08-13 19:59:26,275 INFO [main] org.apache.nifi.bootstrap.Command Generated Self-Signed Certificate SHA-256: 2464276B1A18B286B653532BA0BAFD6F56F72632BC65437455011985899B4D4B
2024-08-13 19:59:26,822 INFO [main] org.apache.nifi.bootstrap.Command Starting Apache NiFi...
2024-08-13 19:59:26,822 INFO [main] org.apache.nifi.bootstrap.Command Working Directory: /home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2
2024-08-13 19:59:26,822 INFO [main] org.apache.nifi.bootstrap.Command Command: /usr/lib/jvm/jdk-21.0.4-oracle-x64/bin/java -classpath /home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./conf:/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./lib/nifi-runtime-2.0.0-M2.jar:/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./lib/nifi-per-process-group-logging-2.0.0-M2.jar:/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./lib/nifi-python-framework-api-2.0.0-M2.jar:/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./lib/log4j-over-slf4j-2.0.11.jar:/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./lib/jul-to-slf4j-2.0.11.jar:/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./lib/logback-core-1.4.14.jar:/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./lib/nifi-framework-api-2.0.0-M2.jar:/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./lib/nifi-nar-utils-2.0.0-M2.jar:/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./lib/nifi-server-api-2.0.0-M2.jar:/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./lib/nifi-stateless-bootstrap-2.0.0-M2.jar:/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./lib/slf4j-api-2.0.11.jar:/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./lib/nifi-stateless-api-2.0.0-M2.jar:/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./lib/nifi-api-2.0.0-M2.jar:/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./lib/nifi-property-utils-2.0.0-M2.jar:/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./lib/jcl-over-slf4j-2.0.11.jar:/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./lib/logback-classic-1.4.14.jar:/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./lib/nifi-properties-2.0.0-M2.jar -Xmx1g -Djava.awt.headless=true -Xms1g -Djavax.security.auth.useSubjectCredsOnly=true -Dsun.net.http.allowRestrictedHeaders=true -Djava.protocol.handler.pkgs=sun.net.www.protocol -Dcurator-log-only-first-connection-issue-as-error-level=true -Dnifi.properties.file.path=/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./conf/nifi.properties -Dnifi.bootstrap.listen.port=33249 -Dapp=NiFi -Dorg.apache.nifi.bootstrap.config.log.dir=/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/logs org.apache.nifi.NiFi
2024-08-13 19:59:26,899 INFO [main] org.apache.nifi.bootstrap.Command Application Process [4533] launched
2024-08-13 19:59:28,297 INFO [NiFi Bootstrap Command Listener] org.apache.nifi.bootstrap.RunNiFi Apache NiFi now running and listening for Bootstrap requests on port 41501
2024-08-13 20:00:10,000 ERROR [NiFi logging handler] org.apache.nifi.StdErr Failed to start web server: Cannot invoke "jakarta.servlet.ServletContext.setAttribute(String, Object)" because "webApiServletContext" is null
2024-08-13 20:00:10,000 ERROR [NiFi logging handler] org.apache.nifi.StdErr Shutting down...
2024-08-13 20:00:10,906 INFO [main] org.apache.nifi.bootstrap.RunNiFi NiFi never started. Will not restart NiFi
2024-08-13 20:00:58,578 INFO [main] org.apache.nifi.bootstrap.Command Apache NiFi is not running
2024-08-13 20:18:15,633 WARN [main] o.a.n.b.process.RuntimeValidatorExecutor Runtime Configuration [AvailableLocalPorts] validation failed: Local Ports [28231] less than recommended [55000] according to [/proc/sys/net/ipv4/ip_local_port_range]
2024-08-13 20:18:15,635 WARN [main] o.a.n.b.process.RuntimeValidatorExecutor Runtime Configuration [Swappiness] validation failed: Swappiness [60] more than recommended [0] according to [/proc/sys/vm/swappiness]
2024-08-13 20:18:15,815 INFO [main] org.apache.nifi.bootstrap.RunNiFi {javaVersion=21.0.4, availableProcessors=3, maxOpenFileDescriptors=1048576, totalPhysicalMemoryMB=5921, minimumHeapSize=1g, maximumHeapSize=1g}
2024-08-13 20:18:15,852 INFO [main] org.apache.nifi.bootstrap.Command Starting Apache NiFi...
2024-08-13 20:18:15,853 INFO [main] org.apache.nifi.bootstrap.Command Working Directory: /home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2
2024-08-13 20:18:15,853 INFO [main] org.apache.nifi.bootstrap.Command Command: /usr/lib/jvm/jdk-21.0.4-oracle-x64/bin/java -classpath /home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./conf:/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./lib/nifi-runtime-2.0.0-M2.jar:/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./lib/nifi-per-process-group-logging-2.0.0-M2.jar:/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./lib/nifi-python-framework-api-2.0.0-M2.jar:/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./lib/log4j-over-slf4j-2.0.11.jar:/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./lib/jul-to-slf4j-2.0.11.jar:/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./lib/logback-core-1.4.14.jar:/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./lib/nifi-framework-api-2.0.0-M2.jar:/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./lib/nifi-nar-utils-2.0.0-M2.jar:/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./lib/nifi-server-api-2.0.0-M2.jar:/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./lib/nifi-stateless-bootstrap-2.0.0-M2.jar:/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./lib/slf4j-api-2.0.11.jar:/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./lib/nifi-stateless-api-2.0.0-M2.jar:/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./lib/nifi-api-2.0.0-M2.jar:/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./lib/nifi-property-utils-2.0.0-M2.jar:/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./lib/jcl-over-slf4j-2.0.11.jar:/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./lib/logback-classic-1.4.14.jar:/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./lib/nifi-properties-2.0.0-M2.jar -Xmx1g -Djava.awt.headless=true -Xms1g -Djavax.security.auth.useSubjectCredsOnly=true -Dsun.net.http.allowRestrictedHeaders=true -Djava.protocol.handler.pkgs=sun.net.www.protocol -Dcurator-log-only-first-connection-issue-as-error-level=true -Dnifi.properties.file.path=/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./conf/nifi.properties -Dnifi.bootstrap.listen.port=37363 -Dapp=NiFi -Dorg.apache.nifi.bootstrap.config.log.dir=/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/logs org.apache.nifi.NiFi
2024-08-13 20:18:15,876 INFO [main] org.apache.nifi.bootstrap.Command Application Process [5981] launched
2024-08-13 20:18:16,684 INFO [NiFi Bootstrap Command Listener] org.apache.nifi.bootstrap.RunNiFi Apache NiFi now running and listening for Bootstrap requests on port 39667
2024-08-13 20:18:29,629 ERROR [NiFi logging handler] org.apache.nifi.StdErr Failed to start web server: Cannot invoke "jakarta.servlet.ServletContext.setAttribute(String, Object)" because "webApiServletContext" is null
2024-08-13 20:18:29,629 ERROR [NiFi logging handler] org.apache.nifi.StdErr Shutting down...
2024-08-13 20:18:30,879 INFO [main] org.apache.nifi.bootstrap.RunNiFi NiFi never started. Will not restart NiFi
2024-08-13 20:19:01,246 INFO [main] org.apache.nifi.bootstrap.Command Apache NiFi is not running

 

nifi-app.log

2024-08-13 20:18:29,628 INFO [main] org.eclipse.jetty.server.Server Started oejs.Server@587c5c1{STARTING}[12.0.5,sto=0] @13768ms
2024-08-13 20:18:29,629 WARN [main] org.apache.nifi.web.server.JettyServer Failed to start web server... shutting down.
java.lang.NullPointerException: Cannot invoke "jakarta.servlet.ServletContext.setAttribute(String, Object)" because "webApiServletContext" is null
at org.apache.nifi.web.server.JettyServer.start(JettyServer.java:792)
at org.apache.nifi.NiFi.<init>(NiFi.java:172)
at org.apache.nifi.NiFi.<init>(NiFi.java:83)
at org.apache.nifi.NiFi.main(NiFi.java:332)

8 replies

DianaTorres
Community Manager
Community Manager
August 14, 2024

@livsey Welcome to the Cloudera Community!

To help you get the best possible solution, I have tagged our NiFi experts @SAMSAL @cotopaul @ckumar  who may be able to assist you further.

Please keep us updated on your post, and we hope you find a satisfactory solution to your query.

Translate
Regards, Diana Torres, Senior Community Moderator
Samyuktha
Silver ⭐️
October 15, 2024

Did u find any solution for this.Currently I am facing this type of issue

Translate
MattWho
Titanium ⭐️⭐️⭐️
Titanium ⭐️⭐️⭐️
October 15, 2024

@livsey 

Can you share what Java and Java version you are using and how you have configured your Apache NiFi conf/nifi.properties file?

I am most interested in the Web Properties section.

Thank you,
Matt

Translate
Kiranq
Silver ⭐️⭐️⭐️
October 17, 2024

@MattWho 

Hi Matt, I am having the same issue as:

Kiranq_0-1729180126614.png


Here are my web properties:

Kiranq_1-1729180155352.png

 

and java version as below:

Kiranq_2-1729180184230.png

Please suggest any resolution. 

 

Translate
MattWho
Titanium ⭐️⭐️⭐️
Titanium ⭐️⭐️⭐️
October 17, 2024

@Kiranq  @livsey 

If you configure "nifi.web.https.host" with your actual Windows hostname or IP rather then using the loopback address (127.0.0.1), does your NiFi start?

Any custom add-ons?

Have you set NiFi to debug in logback to see if any additional logging shed some light here?

Thanks,
Matt

Translate
MattWho
Titanium ⭐️⭐️⭐️
Titanium ⭐️⭐️⭐️
October 18, 2024

@Kiranq 

This error shared:

2024-10-17 08:35:19,764 ERROR [Timer-Driven Process Thread-5] o.a.n.c.s.StandardControllerServiceNode StandardControllerServiceNode[service=CSVRecordLookupService[id=a8b84b00-b0ee-31c8-dbda-7e7e9795ba4b], name=CSVRecordLookupService, active=true] Encountering difficulty enabling. (Validation State is INVALID: ['CSV File' is invalid because CSV File is required, 'Lookup Key Column' is invalid because Lookup Key Column is required]). Will continue trying to enable.

Indicates that NiFi is trying to enable a NiFi Controller services loaded from the flow.json.gz during startup, but cannot because it's configuration is invalid.  It is complaining about the configuration of the "CSV File" and "Lookup Key Column" properties.

Have you tried starting your NiFi with the following setting in your nifi.properties file set to "false":

nifi.flowcontroller.autoResumeState=false

This will start NiFi and all components on the canvas will not be started during startup.
Also if you NiFi is at the point it is trying to enable components on the canvas, Your NiFi is up and running.

As far as the screenshot error, have you verified ownership and permissions on that directory path.  Permissions can be an issue if you started the NiFI service as different users at some point in time resulting in some files created on startup having different ownership. 

 

Please help our community thrive. If you found any of the suggestions/solutions provided helped you with solving your issue or answering your question, please take a moment to login and click "Accept as Solution" on one or more of them that helped.

Thank you,
Matt

Translate