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

Use of CLI login command resets Jenkins after restart when using default JENKINS_HOME

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • cli, core
    • None
    • 1.552-SNAPSHOT

      Steps to reproduce:

      1. java -jar jenkins.war with no explicitly defined JENKINS_HOME has the default $HOME/.jenkins (unless $HOME/.hudson exists)
      2. Run java -jar jenkins-cli.jar … login, creating $HOME/.hudson/cli-credentials on the server
      3. Restart Jenkins, and it'll init with an empty home, as now $HOME/.hudson exists and is preferred to $HOME/.jenkins!

          [JENKINS-21772] Use of CLI login command resets Jenkins after restart when using default JENKINS_HOME

          Daniel Beck created issue -
          Daniel Beck made changes -
          Description Original: Steps to reproduce:

          1. `java -jar jenkins.war` with no explicitly defined `JENKINS_HOME` has the default `~/.jenkins` (unless `~/.hudson` exists)
          2. Run `java -jar jenkins-cli.jar … login`, creating `~/.hudson/cli-credentials` on the server
          3. Restart Jenkins, and it'll init with an empty home, as now `~/.hudson` exists and is preferred to `~/.jenkins`!
          New: Steps to reproduce:

          1. {{java -jar jenkins.war}} with no explicitly defined {{JENKINS_HOME}} has the default {{~/.jenkins}} (unless {{~/.hudson}} exists)
          2. Run {{java -jar jenkins-cli.jar … login}}, creating {{~/.hudson/cli-credentials}} on the server
          3. Restart Jenkins, and it'll init with an empty home, as now {{~/.hudson}} exists and is preferred to {{~/.jenkins}}!
          Daniel Beck made changes -
          Description Original: Steps to reproduce:

          1. {{java -jar jenkins.war}} with no explicitly defined {{JENKINS_HOME}} has the default {{~/.jenkins}} (unless {{~/.hudson}} exists)
          2. Run {{java -jar jenkins-cli.jar … login}}, creating {{~/.hudson/cli-credentials}} on the server
          3. Restart Jenkins, and it'll init with an empty home, as now {{~/.hudson}} exists and is preferred to {{~/.jenkins}}!
          New: Steps to reproduce:

          1. {{java -jar jenkins.war}} with no explicitly defined {{JENKINS_HOME}} has the default {{$HOME/.jenkins}} (unless {{$HOME/.hudson}} exists)
          2. Run {{java -jar jenkins-cli.jar … login}}, creating {{$HOME/.hudson/cli-credentials}} on the server
          3. Restart Jenkins, and it'll init with an empty home, as now {{$HOME/.hudson}} exists and is preferred to {{$HOME/.jenkins}}!

          Code changed in jenkins
          User: Daniel Beck
          Path:
          core/src/main/java/hudson/cli/ClientAuthenticationCache.java
          http://jenkins-ci.org/commit/jenkins/237dda40e08f4db759e965738b1b9b3755525161
          Log:
          [FIXED JENKINS-21772] Only cache CLI credentials in ~/.hudson if it exists.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Daniel Beck Path: core/src/main/java/hudson/cli/ClientAuthenticationCache.java http://jenkins-ci.org/commit/jenkins/237dda40e08f4db759e965738b1b9b3755525161 Log: [FIXED JENKINS-21772] Only cache CLI credentials in ~/.hudson if it exists.
          SCM/JIRA link daemon made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]
          Daniel Beck made changes -
          Assignee New: Daniel Beck [ danielbeck ]

          dogfood added a comment -

          Integrated in jenkins_main_trunk #3192
          [FIXED JENKINS-21772] Only cache CLI credentials in ~/.hudson if it exists. (Revision 237dda40e08f4db759e965738b1b9b3755525161)

          Result = SUCCESS
          Vojtech Juranek : 237dda40e08f4db759e965738b1b9b3755525161
          Files :

          • core/src/main/java/hudson/cli/ClientAuthenticationCache.java

          dogfood added a comment - Integrated in jenkins_main_trunk #3192 [FIXED JENKINS-21772] Only cache CLI credentials in ~/.hudson if it exists. (Revision 237dda40e08f4db759e965738b1b9b3755525161) Result = SUCCESS Vojtech Juranek : 237dda40e08f4db759e965738b1b9b3755525161 Files : core/src/main/java/hudson/cli/ClientAuthenticationCache.java
          minal silimkar made changes -
          Assignee Original: Daniel Beck [ danielbeck ] New: minal silimkar [ minal_silimkar ]

          Daniel Beck added a comment -

          minal_silimkar: You realize this issue has been resolved, right? Why did you assign it to yourself?

          Daniel Beck added a comment - minal_silimkar : You realize this issue has been resolved, right? Why did you assign it to yourself?
          Daniel Beck made changes -
          Assignee Original: minal silimkar [ minal_silimkar ] New: Daniel Beck [ danielbeck ]

            danielbeck Daniel Beck
            danielbeck Daniel Beck
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: