Uploaded image for project: 'Apache NiFi'
  1. Apache NiFi
  2. NIFI-12358

NPE when configured network interfaces do not exist

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.20.0
    • 2.0.0-M1, 1.24.0
    • None
    • None

    Description

      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 :

      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

      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

      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, 

       

      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.

      Attachments

        Issue Links

          Activity

            People

              markap14 Mark Payne
              Giom Guillaume Lhermenier
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m