Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-34255

Cannot create first user on new install for Jenkins 2.0

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Critical
    • Resolution: Unresolved
    • Component/s: core
    • Labels:
    • Environment:
      El Capitan OS running Safari browser version 9.0.3 (11601.4.4). Clean install from Jenkins-2.0.pkg
    • Similar Issues:

      Description

      Is this expected behavior on a system with a new Jenkins 2.0 installation? How would a first user have been created if I do not have a previous version of Jenkins installed?

      HTTP ERROR 401

      Problem accessing /securityRealm/createFirstAccount. Reason: First user was already created

      Powered by Jetty://

        Attachments

          Activity

          Hide
          rtyler R. Tyler Croy added a comment -

          [~patricko] I'm assuming that this happens when you're going through the "Getting Started" wizard with a fresh intsallation?

          Show
          rtyler R. Tyler Croy added a comment - [~patricko] I'm assuming that this happens when you're going through the "Getting Started" wizard with a fresh intsallation?
          Hide
          paddyoh Patrick O'Hannigan added a comment -

          Yes, assuming the Getting Started wizard is the preliminary step sequence but not labeled as a Getting Started wizard

          Show
          paddyoh Patrick O'Hannigan added a comment - Yes, assuming the Getting Started wizard is the preliminary step sequence but not labeled as a Getting Started wizard
          Hide
          rtyler R. Tyler Croy added a comment -

          I'm going to try to reproduce this on Jenkins 2.0RC1 on Windows 2012R2

          Show
          rtyler R. Tyler Croy added a comment - I'm going to try to reproduce this on Jenkins 2.0RC1 on Windows 2012R2
          Hide
          rtyler R. Tyler Croy added a comment -

          When prompted to create a "First User" in the Getting Started wizard on Windows 2012R2, I was able to successfully create the user and proceed to the default home screen for Jenkins.

          Show
          rtyler R. Tyler Croy added a comment - When prompted to create a "First User" in the Getting Started wizard on Windows 2012R2, I was able to successfully create the user and proceed to the default home screen for Jenkins.
          Hide
          paddyoh Patrick O'Hannigan added a comment -

          Although my attempt to create a first user threw the error noted above, the Getting Started wizard seems to have ignored that, because wizard returned a message saying "The installation was successful" while step 6 (Summary) was boldface.

          Show
          paddyoh Patrick O'Hannigan added a comment - Although my attempt to create a first user threw the error noted above, the Getting Started wizard seems to have ignored that, because wizard returned a message saying "The installation was successful" while step 6 (Summary) was boldface.
          Hide
          danielbeck Daniel Beck added a comment -

          This is a weird redirect that happens sometimes when you access Jenkins before it finished initializing. Some kind of timing issue.

          Unfortunately I was unable to reliablyreproduce it. Keith Zantow Maybe this happens with more regularity than expected?

          Show
          danielbeck Daniel Beck added a comment - This is a weird redirect that happens sometimes when you access Jenkins before it finished initializing. Some kind of timing issue. Unfortunately I was unable to reliablyreproduce it. Keith Zantow Maybe this happens with more regularity than expected?
          Hide
          kzantow Keith Zantow added a comment -

          I wish there were more specific steps that were taken for this... possibly a double submit (there is JS to attempt to prevent that, but maybe it doesn't always)? If there's any way to reproduce this and provide more info it would help to diagnose it, Patrick O'Hannigan.

          Show
          kzantow Keith Zantow added a comment - I wish there were more specific steps that were taken for this... possibly a double submit (there is JS to attempt to prevent that, but maybe it doesn't always)? If there's any way to reproduce this and provide more info it would help to diagnose it, Patrick O'Hannigan .
          Hide
          paddyoh Patrick O'Hannigan added a comment -

          I have not been able to reproduce it since yesterday, either, but what I did notice at the machine / OS level is that my Mac now gives me the choice between logging in as me or logging in as "Jenkins," so perhaps first user could not be created (per the error message) because Jenkins is the default first user, no matter what user name you supply for the wizard during a Jenkins 2.0 install?

          Show
          paddyoh Patrick O'Hannigan added a comment - I have not been able to reproduce it since yesterday, either, but what I did notice at the machine / OS level is that my Mac now gives me the choice between logging in as me or logging in as "Jenkins," so perhaps first user could not be created (per the error message) because Jenkins is the default first user, no matter what user name you supply for the wizard during a Jenkins 2.0 install?
          Hide
          kzantow Keith Zantow added a comment -

          Patrick O'Hannigan I'm assuming you used the installer for OSX - Is this correct? The setup wizard create users in the local Jenkins database, this has nothing to do with OSX. I'm very confused why you have that unless someone manually created that user in OSX or the installer (not the setup wizard) did.

          Show
          kzantow Keith Zantow added a comment - Patrick O'Hannigan I'm assuming you used the installer for OSX - Is this correct? The setup wizard create users in the local Jenkins database, this has nothing to do with OSX. I'm very confused why you have that unless someone manually created that user in OSX or the installer (not the setup wizard) did.
          Hide
          paddyoh Patrick O'Hannigan added a comment -

          Yes, I used the installer for OS X, from the link on the Jenkins 2.0 web page.

          Show
          paddyoh Patrick O'Hannigan added a comment - Yes, I used the installer for OS X, from the link on the Jenkins 2.0 web page.
          Hide
          oleg_nenashev Oleg Nenashev added a comment -

          Patrick O'Hannigan According to the submission date it was for the pre-release version. Could you retest for Jenkins 2.7?

          Show
          oleg_nenashev Oleg Nenashev added a comment - Patrick O'Hannigan According to the submission date it was for the pre-release version. Could you retest for Jenkins 2.7?
          Hide
          emily_mstr Xin Chen added a comment - - edited

          I downloaded Jenkins 2.7.1 from the official website and did a fresh install on my OS X. Same issue here.

          Show
          emily_mstr Xin Chen added a comment - - edited I downloaded Jenkins 2.7.1 from the official website and did a fresh install on my OS X. Same issue here.
          Hide
          danielbeck Daniel Beck added a comment -

          Xin Chen Any additional information you could provide, e.g. was Jenkins ever installed on that machine, how did you access it, what options chosen during installation, did you ever see any of the wizard and if so, how far did you get…

          Show
          danielbeck Daniel Beck added a comment - Xin Chen Any additional information you could provide, e.g. was Jenkins ever installed on that machine, how did you access it, what options chosen during installation, did you ever see any of the wizard and if so, how far did you get…
          Hide
          emily_mstr Xin Chen added a comment -

          This is the first time installation on my OS X machine, and I keep all the default setting during installation. Jenkins installed all the recommended dependencies/libraries and right after that the localhost:8080 GUI pops up asking me to create the first user. With all the info provided, I click the button thus the error occurs.

          Show
          emily_mstr Xin Chen added a comment - This is the first time installation on my OS X machine, and I keep all the default setting during installation. Jenkins installed all the recommended dependencies/libraries and right after that the localhost:8080 GUI pops up asking me to create the first user. With all the info provided, I click the button thus the error occurs.
          Hide
          oleg_nenashev Oleg Nenashev added a comment -

          Xin Chen cannot reproduce it, but it sounds pretty important. I'll increase the priority.
          My first guess is that there are some leftovers from the previous installation, and this one is not really clean

          Show
          oleg_nenashev Oleg Nenashev added a comment - Xin Chen cannot reproduce it, but it sounds pretty important. I'll increase the priority. My first guess is that there are some leftovers from the previous installation, and this one is not really clean
          Hide
          danielbeck Daniel Beck added a comment -

          The latest comment by Xin Chen sounds a lot like something I observed in the betas. A presumed timing issue results in a forward to /securityRealm/createFirstUser (or similar) before the wizard can take over handling requests. The solution is to ignore the form, and manually navigate to the / URL again that will now be handled by the wizard.

          Back then I was the only one who managed to observe it, but apparently it happens more frequently.

          Show
          danielbeck Daniel Beck added a comment - The latest comment by Xin Chen sounds a lot like something I observed in the betas. A presumed timing issue results in a forward to /securityRealm/createFirstUser (or similar) before the wizard can take over handling requests. The solution is to ignore the form, and manually navigate to the / URL again that will now be handled by the wizard. Back then I was the only one who managed to observe it, but apparently it happens more frequently.
          Hide
          emily_mstr Xin Chen added a comment -

          This is my first time play with Jenkins so I don't think anything leftover there.

          Show
          emily_mstr Xin Chen added a comment - This is my first time play with Jenkins so I don't think anything leftover there.
          Hide
          emily_mstr Xin Chen added a comment -

          Thanks Daniel! I'm able to access the URL right now with the workaround.

          Show
          emily_mstr Xin Chen added a comment - Thanks Daniel! I'm able to access the URL right now with the workaround.
          Hide
          kzantow Keith Zantow added a comment -

          Xin Chen Daniel Beck R. Tyler Croy I'll see what I can do to reproduce this and examine the code to see if there's anything else to do to prevent it, it must be a timing issue after the 'jenkins is working...' refresh happens at startup time...

          Show
          kzantow Keith Zantow added a comment - Xin Chen Daniel Beck R. Tyler Croy I'll see what I can do to reproduce this and examine the code to see if there's anything else to do to prevent it, it must be a timing issue after the 'jenkins is working...' refresh happens at startup time...
          Hide
          danielbeck Daniel Beck added a comment -

          Keith Zantow I just reproduced this on Jenkins 2.37. Have you made any progress here?

          Show
          danielbeck Daniel Beck added a comment - Keith Zantow I just reproduced this on Jenkins 2.37. Have you made any progress here?
          Hide
          ethanstrominger Ethan Strominger added a comment -

          I ran into the same problem and before I saw this issue, I logged https://issues.jenkins-ci.org/browse/JENKINS-48352 Issue occurred in Chrome.  If I try http://localhost:8080/ from a different Chrome tab or from Firefox, I get a log in screen asking for user name and password and cannot go further.

           

          Show
          ethanstrominger Ethan Strominger added a comment - I ran into the same problem and before I saw this issue, I logged  https://issues.jenkins-ci.org/browse/JENKINS-48352  Issue occurred in Chrome.  If I try http://localhost:8080/  from a different Chrome tab or from Firefox, I get a log in screen asking for user name and password and cannot go further.  
          Hide
          ethanstrominger Ethan Strominger added a comment -

          I was using 2.73.3.  I still have the frozen setup wizard window open.

          Show
          ethanstrominger Ethan Strominger added a comment - I was using 2.73.3.  I still have the frozen setup wizard window open.
          Hide
          danielbeck Daniel Beck added a comment -

          Ethan Strominger That's an unrelated issue.

          Show
          danielbeck Daniel Beck added a comment - Ethan Strominger That's an unrelated issue.
          Hide
          danielbeck Daniel Beck added a comment -

          The form shown to users is not the Jenkins 2 setup wizard at all, but a regular Jenkins "first user" form that has existed forever and is the way to set up a user when the security realm is Jenkins user DB, and no user exists.

          This issue seems to be with the CREATE_FIRST_USER_FILTER in HudsonPrivateSecurityRealm.

          First, the security realm is set. Then, a user is added. Between the two, the servlet filter is installed. Only after the setup wizard finishes installation is its servlet filter installed.

          Either there's an ordering issue here, or a race condition. Not sure why HudsonIsLoading would no longer handle requests at that time, though. Doesn't look like it's happening in separate threads.

          Show
          danielbeck Daniel Beck added a comment - The form shown to users is not the Jenkins 2 setup wizard at all, but a regular Jenkins "first user" form that has existed forever and is the way to set up a user when the security realm is Jenkins user DB, and no user exists. This issue seems to be with the CREATE_FIRST_USER_FILTER in HudsonPrivateSecurityRealm . First, the security realm is set. Then, a user is added. Between the two, the servlet filter is installed. Only after the setup wizard finishes installation is its servlet filter installed. Either there's an ordering issue here, or a race condition. Not sure why HudsonIsLoading would no longer handle requests at that time, though. Doesn't look like it's happening in separate threads.
          Hide
          ethanstrominger Ethan Strominger added a comment -

          Daniel Beck Does this pertain to my  logged issue as well (https://issues.jenkins-ci.org/browse/JENKINS-48352) that you said is unrelated to the current thread?  How are the two different?

          Show
          ethanstrominger Ethan Strominger added a comment - Daniel Beck Does this pertain to my  logged issue as well ( https://issues.jenkins-ci.org/browse/JENKINS-48352 ) that you said is unrelated to the current thread?  How are the two different?
          Hide
          danielbeck Daniel Beck added a comment -

          Ethan Strominger Since they're unrelated, no. This issue, as I and the reporter explained, doesn't even show the setup wizard.

          Show
          danielbeck Daniel Beck added a comment - Ethan Strominger Since they're unrelated, no. This issue, as I and the reporter explained, doesn't even show the setup wizard.

            People

            • Assignee:
              kzantow Keith Zantow
              Reporter:
              paddyoh Patrick O'Hannigan
            • Votes:
              1 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

              • Created:
                Updated: