Uploaded image for project: 'Red Hat Fuse'
  1. Red Hat Fuse
  2. ENTESB-4841

Fabric8 - NullPointerException from GitDataStore when having hostname with underscore

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: jboss-fuse-6.1
    • Fix Version/s: None
    • Component/s: Fabric8 v1
    • Labels:
      None
    • Environment:

      Windows 2012 R2 machine with computer name ENV1_FUSE.
      jre-7u80-windows-x64
      jboss-fuse-6.1.0.redhat-401

    • Steps to Reproduce:
      Hide

      Steps in Fuse:

      esb:create-admin-user --new-user admin --new-user-password admin --new-user-role admin
      fabric:create --wait-for-provisioning
       
      profile-edit --bundles wrap:mvn:com.oracle/ojdbc6/11.2.0.3.0 mq-base
      

      Show
      Steps in Fuse: esb:create-admin-user --new-user admin --new-user-password admin --new-user-role admin fabric:create --wait-for-provisioning   profile-edit --bundles wrap:mvn:com.oracle/ojdbc6/11.2.0.3.0 mq-base
    • Sprint:
      6.3 Sprint 2 (1-Feb - 26-Feb)

      Description

      After mentioned steps root container has provisioning failure stating NullPointerException in io.fabric8.git.internal.GitDataStore at line 1512:

      1502            try {
      1503                Enumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces();
      1504                while (interfaces.hasMoreElements()) {
      1505                    NetworkInterface iface = interfaces.nextElement();
      1506                    if (iface.isLoopback() || !iface.isUp()) {
      1507                        continue;
      1508                    }
      1509                    Enumeration<InetAddress> addresses = iface.getInetAddresses();
      1510                    while (addresses.hasMoreElements()) {
      1511                        InetAddress addr = addresses.nextElement();
      1512                        if (hostname.equals(addr.getHostAddress())) {
      1513                            return true;
      1514                        }
      1515                    }
      1516                }
      1517            } catch (SocketException e) {
      1518                // ignore
      1519            }
      

      This is caused by URI.getHost() (line 1459) returning null for local URIs containing ENV1_FUSE.
      This blocks any modifications/additions to profiles. After renaming the machine to ENV1-FUSE the problem went away.
      There is obvious workaround, but it might get very confusing and hard to trace down the root cause due to having NPE instead of some more descriptive Exception.
      It would be great if you could assert URI.getHost() for null values or handle the situation in more descriptive way.
      BR, Miloš

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                oscerd Andrea Cosentino
                Reporter:
                milos.zubal Miloš Zubal
                Tester:
                Roman Jakubco
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: