[
https://issues.apache.org/jira/browse/NIFI-12358?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17786540#comment-17786540
]
ASF subversion and git services commented on NIFI-12358:
--------------------------------------------------------
Commit b5c3e6f9aae9791b749ba3d908ce1b6672ee2124 in nifi's branch
refs/heads/main from Mark Payne
[ https://gitbox.apache.org/repos/asf?p=nifi.git;h=b5c3e6f9aa ]
NIFI-12358 Fixed NPE in HostHeaderHandler
Fixed NPE in ThreadDumpTask and TrackedLeaderElectionManager
This closes #8032
Signed-off-by: David Handermann <[email protected]>
> NPE when configured network interfaces do not exist
> ---------------------------------------------------
>
> Key: NIFI-12358
> URL: https://issues.apache.org/jira/browse/NIFI-12358
> Project: Apache NiFi
> Issue Type: Bug
> Affects Versions: 1.20.0
> Reporter: Guillaume Lhermenier
> Assignee: Mark Payne
> Priority: Major
> Fix For: 2.latest
>
> Time Spent: 20m
> Remaining Estimate: 0h
>
> I recently had to switch our NiFi base AMIs in AWS from amazonlinux 2 to
> amazonlinux 2023.
> This went pretty smoothly but I an issue about network interfaces.
> For some reasons, I had the following configured in my nifi.properties :
> {code:java}
> nifi.web.https.host=nifi1.emea.qa.domain.io
> nifi.web.https.port=8443
> nifi.web.https.network.interface.eth0=eth0
> nifi.web.https.network.interface.eth1=eth1{code}
> And this worked for many years.
> However, in amazon Linux, networks seems to have changed and naming too.
> Instead of eth0/eth1, I had my network interfaces named ens5/ens6.
> Of course, NiFi wasn't able to find them.
> However, the log could be clearer than a NullPointerException
> {code:java}
> 2023-11-13 14:35:28,644 WARN [main] o.a.nifi.web.server.HostHeaderHandler
> Failed to determine custom network interfaces.
> java.lang.NullPointerException: null
> at
> org.apache.nifi.web.server.HostHeaderHandler.extractIPsFromNetworkInterfaces(HostHeaderHandler.java:335)
> at
> org.apache.nifi.web.server.HostHeaderHandler.generateDefaultHostnames(HostHeaderHandler.java:276)
> at
> org.apache.nifi.web.server.HostHeaderHandler.<init>(HostHeaderHandler.java:100)
> at org.apache.nifi.web.server.JettyServer.init(JettyServer.java:217)
> at
> org.apache.nifi.web.server.JettyServer.initialize(JettyServer.java:1074)
> at org.apache.nifi.NiFi.<init>(NiFi.java:164)
> at org.apache.nifi.NiFi.<init>(NiFi.java:83)
> at org.apache.nifi.NiFi.main(NiFi.java:332)
> 2023-11-13 14:35:28,649 INFO [main] o.a.nifi.web.server.HostHeaderHandler
> Determined 14 valid hostnames and IP addresses for incoming headers:
> 127.0.0.1, 127.0.0.1:8443, localhost, localhost:8443, [::1], [::1]:8443,
> ip-172-30-xx-xx.eu-west-1.compute.internal,
> ip-172-30-xx-xx.eu-west-1.compute.internal:8443, 172.30.xx.xx,
> 172.30.xx.xx:8443, nifi1.emea.qa.domain.io, nifi1.emea.qa.domain.io:8443,
> nifi.emea.qa.domain.io, {code}
>
> NB : I hadn't tested this on newer versions than 1.20 and won't have time to
> in the coming weeks.
> However, our migration to 1.23 should be done in the next months, I'll update
> the ticket if needed at that time.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)