Created 02-11-2025 02:20 AM
I am getting the following error. I have populated nifi.properties and bootstrap.conf using configmaps as mentioned below
-------
2025-02-11 06:48:50,240 ERROR [main] org.apache.nifi.runtime.Application Start Server failed
java.lang.IllegalStateException: Application Properties loading failed
at org.apache.nifi.runtime.PropertiesProvider.readProperties(PropertiesProvider.java:65)
at org.apache.nifi.runtime.Application.startServer(Application.java:121)
at org.apache.nifi.runtime.Application.run(Application.java:78)
at org.apache.nifi.runtime.Application.run(Application.java:60)
at org.apache.nifi.NiFi.main(NiFi.java:42)
Caused by: java.lang.reflect.InvocationTargetException: null
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:115)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at org.apache.nifi.runtime.PropertiesProvider.readProperties(PropertiesProvider.java:63)
... 4 common frames omitted
Caused by: java.lang.NullPointerException: Cannot invoke "java.io.File.exists()" because "flowConfigurationFile" is null
at org.apache.nifi.properties.NiFiPropertiesLoader.getDefaultProperties(NiFiPropertiesLoader.java:157)
at org.apache.nifi.properties.NiFiPropertiesLoader.get(NiFiPropertiesLoader.java:138)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
... 6 common frames omitted
2025-02-11 06:48:50,243 WARN [main] org.apache.nifi.web.server.JettyServer Failed to stop Server
java.lang.NullPointerException: Cannot invoke "org.eclipse.jetty.server.Server.stop()" because "this.server" is null
at org.apache.nifi.web.server.JettyServer.stop(JettyServer.java:1000)
at org.apache.nifi.runtime.Application.run(Application.java:81)
at org.apache.nifi.runtime.Application.run(Application.java:60)
at org.apache.nifi.NiFi.main(NiFi.java:42)
-----
Using apache nifi version - NiFi 2.2.0
attaching my sample deployment file
------
containers:
- image: nifi_2.2.0:v1
imagePullPolicy: IfNotPresent
name: nifi
ports:
- containerPort: 8080
protocol: TCP
resources:
limits:
cpu: 1500m
memory: 4Gi
requests:
cpu: 750m
memory: 2Gi
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /opt/nifi/nifi-current/conf/nifi.properties
name: config-volume
subPath: nifi.properties
- mountPath: /opt/nifi/nifi-current/conf/bootstrap.conf
name: config-volume
subPath: bootstrap.conf
- mountPath: /opt/nifi/nifi-current/flowfile_repository
name: nifi-flowfile
- mountPath: /opt/nifi/nifi-current/logs
name: nifi-logs
volumes:
- name: nifi-flowfile
persistentVolumeClaim:
claimName: nifi-flowfile-pvc
- emptyDir: {}
name: nifi-logs
- emptyDir: {}
name: nifi-conf
- configMap:
defaultMode: 420
name: nifi-config
name: config-volume
-----
my configmap
apiVersion: v1
data:
bootstrap.conf: |
java.arg.1=-Xms512m
java.arg.2=-Xmx2g
nifi.bootstrap.class=org.apache.nifi.bootstrap.BootstrapProcess
nifi.properties: |
nifi.web.http.port=8080
nifi.remote.input.host=nifi-cluster
nifi.remote.input.secure=false
nifi.remote.input.socket.port=10000
nifi.zookeeper.connect.string=zookeeper:2181
nifi.nar.library.directory=/opt/nifi/nifi-current/lib
kind: ConfigMap
metadata:
name: nifi-config
namespace: nifi-ns
-----
Created 02-11-2025 09:34 AM
@nifi-srinikr
The exception you shared is complaining about a null value for the "flowConfigurationFile":
Caused by: java.lang.NullPointerException: Cannot invoke "java.io.File.exists()" because "flowConfigurationFile" is null
On NiFi startup NiFi will check if the flow configuration file that NiFi is configured to use exists. If it does not, NiFi will create it. In your case it appears this property is null and this the if exists check is failing.
The configuration file location and filename is specified by this property in the nifi.properties file:
nifi.flow.configuration.file=<path to>/flow.xml.gz (Apache NiFi 1.x releases)
or
nifi.flow.configuration.file=<path to>/flow.json.gz (Apache NiFi 2.x releases)
What version of Apache NiFi are you using?
Please help our community grow and trhive. 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
Created 03-04-2025 01:59 AM
@nifi-srinikr, Did the response help resolve your query? If it did, kindly mark the relevant reply as the solution, as it will aid others in locating the answer more easily in the future.
Regards,
Vidya Sargur,