Uploaded image for project: 'Crowd Data Center'
  1. Crowd Data Center
  2. CWD-2665

Installation creates username and groups when it fails to resolve local host name.

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Medium Medium
    • 2.6
    • None
    • None
    • None

      From Scott McCulley,

      I ran in to some difficulties during the install of Crowd. I thought I might bring them up to as something to address in your next release.

      1) During the configuration of the default admin, the application attempts to resolve the hostname of the server. If it fails, it reports error. But before it does, it adds the user and group to the DB so it is impossible to re-use that admin user or create a new one, since the group already exists.

      Question:

      Is it really necessary to attempt to resolve the hostname of the server?  What if (and I am) using a different name to access Crowd, and it isn't the name of the server??
      

      Suggestion:

      1)  Ask for the name of the server (actually, I think you do.)  Then use that server name instead of attempting to use the hostname.
      2)  Don't create the user if you intend to fail.  Or if you fail, drop the user from the DB, so it can be re-used later.
      3)  Same goes for the admin group as well...
      

      Error log:

      2011-09-18 19:34:20,050 http-8095-1 INFO [console.action.setup.SelectSetupStep] Current setup step is /console/setup/directoryinternalsetup.action
      2011-09-18 19:34:24,651 http-8095-1 INFO [console.action.setup.SelectSetupStep] Current setup step is /console/setup/defaultadministrator.action
      2011-09-18 19:34:46,700 http-8095-1 ERROR [console.action.setup.DefaultAdministrator] web3.cardboard-box.com: web3.cardboard-box.com
      java.net.UnknownHostException: web3.cardboard-box.com: web3.cardboard-box.com
              at java.net.InetAddress.getLocalHost(InetAddress.java:1360)
              at com.atlassian.crowd.console.action.setup.DefaultAdministrator.addCrowdApplication(DefaultAdministrator.java:213)
              at com.atlassian.crowd.console.action.setup.DefaultAdministrator.doUpdate(DefaultAdministrator.java:112)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:597)
      

            [CWD-2665] Installation creates username and groups when it fails to resolve local host name.

            joe added a comment -

            (Yes, to be clear, the actual hostname of the machine is shown.)

            Agreed, the setup process could be improved to offer more information. I've opened CWD-3061 to avoid scope-creep on this issue, and to allow for some more general improvements at the same time.

            joe added a comment - (Yes, to be clear, the actual hostname of the machine is shown.) Agreed, the setup process could be improved to offer more information. I've opened CWD-3061 to avoid scope-creep on this issue, and to allow for some more general improvements at the same time.

            Um: just to be clear - 'crowd-trial' in the message is the actual hostname of the machine I was trying to install onto.

            What about sneaking a little more info into the message? eg:

            Unable to resolve this machine's hostname into an IP address. 
            Thus Crowd cannot complete its installation. 
            Please ensure [hostname] resolves to an IP address then reload this web page to continue the installation. 
            For more see https://jira.atlassian.com/browse/CWD-2665 .
            

            Where [hostname] is the machines actual hostname...

            Again, thanks for the fast turn around

            martin_paulo added a comment - Um: just to be clear - 'crowd-trial' in the message is the actual hostname of the machine I was trying to install onto. What about sneaking a little more info into the message? eg: Unable to resolve this machine's hostname into an IP address. Thus Crowd cannot complete its installation. Please ensure [hostname] resolves to an IP address then reload this web page to continue the installation. For more see https://jira.atlassian.com/browse/CWD-2665 . Where [hostname] is the machines actual hostname... Again, thanks for the fast turn around

            joe added a comment -

            Fair point. The message is now:

            Unable to resolve this machine's hostname. Please ensure 'crowd-trial' resolves to an IP address. 
            

            joe added a comment - Fair point. The message is now: Unable to resolve this machine's hostname. Please ensure 'crowd-trial' resolves to an IP address.

            I appreciate the prompt turnaround. Mind you, 'cryptic error' doesn't fill my heart with joy

            I think that Alan Cooper's dictum of if you have to issue an error message then tell the user
            1) what went wrong
            2) how they are affected
            3) what they can do to solve the problem
            4) where they can go for more information
            is a good one to follow: especially in an installation wizard that is the first view a user has of the product.

            martin_paulo added a comment - I appreciate the prompt turnaround. Mind you, 'cryptic error' doesn't fill my heart with joy I think that Alan Cooper's dictum of if you have to issue an error message then tell the user 1) what went wrong 2) how they are affected 3) what they can do to solve the problem 4) where they can go for more information is a good one to follow: especially in an installation wizard that is the first view a user has of the product.

            joe added a comment -

            Thanks for the clear report. We've fixed this so the hostname is looked up before creating the user and group. It will still fail with a cryptic error, but you can repeat that stage after editing /etc/hosts and it won't leave you stuck at a stage you can't complete.

            joe added a comment - Thanks for the clear report. We've fixed this so the hostname is looked up before creating the user and group. It will still fail with a cryptic error, but you can repeat that stage after editing /etc/hosts and it won't leave you stuck at a stage you can't complete.

            Well, this was a pain.

            I ran into this when trying to install an evaluation version of Crowd. I have now have a vast number of unwanted evaluation licenses as a result

            I think that this is a bug that you really need to fix: the error message is singularly unhelpful to most people and leaves Crowd hung at an installation step that you can't progress beyond: you are in some sort of crazy catch 22 where the group is already defined but you can't step forward to add the user to it [Crowd 2.5.3]

            A look at the log file reveals that this exception is reported and ignored multiple times before you get to the catch 22 situation:

            Log file extracts
            2013-01-10 05:57:48,352 http-8095-2 INFO [ContainerBase.[Catalina].[localhost].[/crowd]] Initializing Spring root WebApplicationContext
            2013-01-10 05:57:50,478 http-8095-2 ERROR [net.sf.ehcache.Cache] Unable to set localhost. This prevents creation of a GUID. Cause was: crowd-trial: crowd-trial: Name or service not known
            java.net.UnknownHostException: crowd-trial: crowd-trial: Name or service not known
            
            2013-01-10 05:57:51,574 http-8095-2 INFO [v2.c3p0.impl.C3P0ImplUtils] Failed to get local InetAddress for VMID. This is unlikely to matter. At all. We'll add some extra randomness
            java.net.UnknownHostException: crowd-trial: crowd-trial: Name or service not known
            
            2013-01-10 05:59:13,794 http-8095-2 INFO [console.action.setup.SelectSetupStep] Current setup step is /console/setup/defaultadministrator.action
            2013-01-10 05:59:50,154 http-8095-3 ERROR [console.action.setup.DefaultAdministrator] crowd-trial: crowd-trial: Name or service not known
            java.net.UnknownHostException: crowd-trial: crowd-trial: Name or service not known
            

            The work around I came up with to install Crowd on Ubuntu 12.10 (AMD 64) was as follows:
            1) I wrote a micky mouse java class to replicate the error.

            InetTester.java
            import java.net.InetAddress;
            import java.net.UnknownHostException;
            
            public class InetTester {
                public static void main(String[] args) {
                    try {
                        InetAddress localHost = InetAddress.getLocalHost();
                        System.out.println("Local host is: " + localHost);
                    } catch (UnknownHostException e) {
                        e.printStackTrace();
                    }
                }
            }
            
            

            2) Added [IP number] [machine name] in my /etc/hosts file: sudo vi /etc/hosts
            so it looked something like:

            Hosts File
            127.0.0.1 localhost
            172.16.62.152 crowd-trial
            

            3) Confirmed that the micky mouse java class now reported the machine hostname correctly
            4) Installed Crowd.

            This was a seriously annoying problem: have you thought Crowds error handling through properly?

            Please fix it!

            martin_paulo added a comment - Well, this was a pain. I ran into this when trying to install an evaluation version of Crowd. I have now have a vast number of unwanted evaluation licenses as a result I think that this is a bug that you really need to fix: the error message is singularly unhelpful to most people and leaves Crowd hung at an installation step that you can't progress beyond: you are in some sort of crazy catch 22 where the group is already defined but you can't step forward to add the user to it [Crowd 2.5.3] A look at the log file reveals that this exception is reported and ignored multiple times before you get to the catch 22 situation: Log file extracts 2013-01-10 05:57:48,352 http-8095-2 INFO [ContainerBase.[Catalina].[localhost].[/crowd]] Initializing Spring root WebApplicationContext 2013-01-10 05:57:50,478 http-8095-2 ERROR [net.sf.ehcache.Cache] Unable to set localhost. This prevents creation of a GUID. Cause was: crowd-trial: crowd-trial: Name or service not known java.net.UnknownHostException: crowd-trial: crowd-trial: Name or service not known 2013-01-10 05:57:51,574 http-8095-2 INFO [v2.c3p0.impl.C3P0ImplUtils] Failed to get local InetAddress for VMID. This is unlikely to matter. At all. We'll add some extra randomness java.net.UnknownHostException: crowd-trial: crowd-trial: Name or service not known 2013-01-10 05:59:13,794 http-8095-2 INFO [console.action.setup.SelectSetupStep] Current setup step is /console/setup/defaultadministrator.action 2013-01-10 05:59:50,154 http-8095-3 ERROR [console.action.setup.DefaultAdministrator] crowd-trial: crowd-trial: Name or service not known java.net.UnknownHostException: crowd-trial: crowd-trial: Name or service not known The work around I came up with to install Crowd on Ubuntu 12.10 (AMD 64) was as follows: 1) I wrote a micky mouse java class to replicate the error. InetTester.java import java.net.InetAddress; import java.net.UnknownHostException; public class InetTester { public static void main( String [] args) { try { InetAddress localHost = InetAddress.getLocalHost(); System .out.println( "Local host is: " + localHost); } catch (UnknownHostException e) { e.printStackTrace(); } } } 2) Added [IP number] [machine name] in my /etc/hosts file: sudo vi /etc/hosts so it looked something like: Hosts File 127.0.0.1 localhost 172.16.62.152 crowd-trial 3) Confirmed that the micky mouse java class now reported the machine hostname correctly 4) Installed Crowd. This was a seriously annoying problem: have you thought Crowds error handling through properly? Please fix it!

              jwalton joe
              vchoy Vincent Choy (Inactive)
              Affected customers:
              1 This affects my team
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: