• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • core
    • Linux redhat Server release 5.8 64 bit
      Apache Tomcat 6.0.18
      Jenkins 1.563

      After upgrade from 1.563 to 1.572, all my Jenkins userid in Uppercase are no longer visible and cannot log in (eg : userid like UL11244) . I can see only user in lowercase (admin). I use Jenkins own database.
      As a workaround, I have to rename directory in JENKINS_HOME/users folder, eg:
      mv /build/hudson/users/UL11251 /build/hudson/users/ul11251 and then modify config.xml to find and replace all UL11251 in ul11251.
      In this case user ul11251 can log in and work.
      But since I have lot of users, I have to rollback to 1.563.
      Thanks

          [JENKINS-23872] Jenkins users disappeared!

          Franco Vitali added a comment - - edited

          Started to happen to us after rolling back to 1.570. Now some random user account simply "dissapear". We are using the simple permissions matrix and the selected permissions remain, but the user accounts needs to be created again.

          Windows Server 2012 R2
          Jenkins 1.570

          Franco Vitali added a comment - - edited Started to happen to us after rolling back to 1.570. Now some random user account simply "dissapear". We are using the simple permissions matrix and the selected permissions remain, but the user accounts needs to be created again. Windows Server 2012 R2 Jenkins 1.570

          This is nothing to do with the credentials plugin

          Stephen Connolly added a comment - This is nothing to do with the credentials plugin

          Daniel Beck added a comment -

          Would be interesting to know what the first Jenkins version to break was. If you're affected, could you please try to determine this?

          Given the range, 1.566 seems like a likely candidate (JENKINS-22247).

          This line looks suspicious:
          https://github.com/jenkinsci/jenkins/compare/jenkins-1.565...jenkins-1.566#diff-fb790d926ccb14a63b5c55893f64d31dR144

          Still, weird that it affects Windows according to the report.

          Daniel Beck added a comment - Would be interesting to know what the first Jenkins version to break was. If you're affected, could you please try to determine this? Given the range, 1.566 seems like a likely candidate ( JENKINS-22247 ). This line looks suspicious: https://github.com/jenkinsci/jenkins/compare/jenkins-1.565...jenkins-1.566#diff-fb790d926ccb14a63b5c55893f64d31dR144 Still, weird that it affects Windows according to the report.

          e. cresta added a comment -

          ok. I can confirm that the problem start from 1.566

          e. cresta added a comment - ok. I can confirm that the problem start from 1.566

          Daniel Beck added a comment -

          What is the output in Script Console of the following command?

          Jenkins.getInstance().getExtensionList(hudson.model.User.CanonicalIdResolver)

          What is the output in Script Console of the following command?

          User.all

          Daniel Beck added a comment - What is the output in Script Console of the following command? Jenkins.getInstance().getExtensionList(hudson.model.User.CanonicalIdResolver) What is the output in Script Console of the following command? User.all

          Daniel Beck added a comment -

          What is the output in Script Console of the following command?

          println User.getConfigFileFor('UL11251')
          println User.getConfigFileFor('UL11251').exists()

          Daniel Beck added a comment - What is the output in Script Console of the following command? println User.getConfigFileFor( 'UL11251' ) println User.getConfigFileFor( 'UL11251' ).exists()

          e. cresta added a comment -

          Test with 1.574

          println User.getConfigFileFor('UL11251') /build/hudson/users/ul11251/config.xml
          println User.getConfigFileFor('UL11251').exists() false

          Jenkins.getInstance().getExtensionList(hudson.model.User.CanonicalIdResolver)
          Result: [hudson.model.User$FullNameIdResolver@7870a27b, jenkins.model.DefaultUserCanonicalIdResolver@2abb7703]

          User.all
          Result: [admin, , builder2, readonly, U801841, U803881, U808691, U813361, U814241, U821261, U824001, UEL0WG1, UEL1IM1, UEL1Y11, UEL26G1, UEL2ER1, UEL2ES1, UL07371, UL09891, UL10251, UL10891, UL11131, UL11151, UL11231, UL11241, UL11251, UL11261, UL11281, FRANCESCO FORTUNATO DONATO, UL11421, UL11441, UL11451, UL11461, UL11481, UL11551, UL11571, UL11581, UL11601, UL11611, UL11621, UL11661, UL11751, UL11761, UL11771, UL11791, UL11891, VW05581]

          e. cresta added a comment - Test with 1.574 println User.getConfigFileFor('UL11251') /build/hudson/users/ul11251/config.xml println User.getConfigFileFor('UL11251').exists() false Jenkins.getInstance().getExtensionList(hudson.model.User.CanonicalIdResolver) Result: [hudson.model.User$FullNameIdResolver@7870a27b, jenkins.model.DefaultUserCanonicalIdResolver@2abb7703] User.all Result: [admin, , builder2, readonly, U801841, U803881, U808691, U813361, U814241, U821261, U824001, UEL0WG1, UEL1IM1, UEL1Y11, UEL26G1, UEL2ER1, UEL2ES1, UL07371, UL09891, UL10251, UL10891, UL11131, UL11151, UL11231, UL11241, UL11251, UL11261, UL11281, FRANCESCO FORTUNATO DONATO, UL11421, UL11441, UL11451, UL11461, UL11481, UL11551, UL11571, UL11581, UL11601, UL11611, UL11621, UL11661, UL11751, UL11761, UL11771, UL11791, UL11891, VW05581]

          Daniel Beck added a comment -

          Assigning speculatively to Stephen as this regression was introduced by his change in 1.566 (JENKINS-22247) at least for case sensitive file systems.

          Still not sure what's going on on Windows (special case sensitive volume?), but it seems to be a regression at least on Linux and OS X.

          Daniel Beck added a comment - Assigning speculatively to Stephen as this regression was introduced by his change in 1.566 ( JENKINS-22247 ) at least for case sensitive file systems. Still not sure what's going on on Windows (special case sensitive volume?), but it seems to be a regression at least on Linux and OS X.

          Just an update. You should only have to change the filenames to lowercase: https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/jenkins/model/IdStrategy.java#L144

          I am seeing if I can add some migration mechanism

          Stephen Connolly added a comment - Just an update. You should only have to change the filenames to lowercase: https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/jenkins/model/IdStrategy.java#L144 I am seeing if I can add some migration mechanism

          Code changed in jenkins
          User: Stephen Connolly
          Path:
          core/src/main/java/hudson/model/User.java
          http://jenkins-ci.org/commit/jenkins/46c58c52256c16dff076b92a97290f3930e3d49c
          Log:
          [FIXED JENKINS-23872] Jenkins users disappeared!

          • Added migration logic to move the config files

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Stephen Connolly Path: core/src/main/java/hudson/model/User.java http://jenkins-ci.org/commit/jenkins/46c58c52256c16dff076b92a97290f3930e3d49c Log: [FIXED JENKINS-23872] Jenkins users disappeared! Added migration logic to move the config files

          e. cresta added a comment -

          It' not enough to change filename. It is necessary to change all entries in config.xml for all users from uppercase to lowercase.
          For now I'll not upgrade Jenkins until the problem will be resolved

          e. cresta added a comment - It' not enough to change filename. It is necessary to change all entries in config.xml for all users from uppercase to lowercase. For now I'll not upgrade Jenkins until the problem will be resolved

          dogfood added a comment -

          Integrated in jenkins_main_trunk #3562
          [FIXED JENKINS-23872] Jenkins users disappeared! (Revision 46c58c52256c16dff076b92a97290f3930e3d49c)

          Result = SUCCESS
          Stephen Connolly : 46c58c52256c16dff076b92a97290f3930e3d49c
          Files :

          • core/src/main/java/hudson/model/User.java

          dogfood added a comment - Integrated in jenkins_main_trunk #3562 [FIXED JENKINS-23872] Jenkins users disappeared! (Revision 46c58c52256c16dff076b92a97290f3930e3d49c) Result = SUCCESS Stephen Connolly : 46c58c52256c16dff076b92a97290f3930e3d49c Files : core/src/main/java/hudson/model/User.java

          Daniel Beck added a comment -

          Stephen: User.getOrCreate uses keyFor(String) which by default lowercases the user name in the case-insensitive strategy.

          But the authorization strategy is configured for uppercase user names, and there never was a need before to do case insensitive comparison.

          E.g. https://github.com/jenkinsci/role-strategy-plugin/blob/master/src/main/java/com/michelin/cio/hudson/plugins/rolestrategy/RoleMap.java#L71

          So, no permissions for the newly lowercased user (even if he now retains his custom name, email address, password, ...)

          Daniel Beck added a comment - Stephen: User.getOrCreate uses keyFor(String) which by default lowercases the user name in the case-insensitive strategy. But the authorization strategy is configured for uppercase user names, and there never was a need before to do case insensitive comparison. E.g. https://github.com/jenkinsci/role-strategy-plugin/blob/master/src/main/java/com/michelin/cio/hudson/plugins/rolestrategy/RoleMap.java#L71 So, no permissions for the newly lowercased user (even if he now retains his custom name, email address, password, ...)

          Code changed in jenkins
          User: Daniel Beck
          Path:
          changelog.html
          http://jenkins-ci.org/commit/jenkins/02b46fc5ddb32548019591c63d5700f8d3228b8e
          Log:
          Noting JENKINS-23872, JENKINS-24006, 19d8b80

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Daniel Beck Path: changelog.html http://jenkins-ci.org/commit/jenkins/02b46fc5ddb32548019591c63d5700f8d3228b8e Log: Noting JENKINS-23872 , JENKINS-24006 , 19d8b80

          Daniel, the authorization strategies need updating to reflect the case sensitivity strategy exposed by the security realm.

          Stephen Connolly added a comment - Daniel, the authorization strategies need updating to reflect the case sensitivity strategy exposed by the security realm.

          Daniel Beck added a comment -

          Stephen: I know, but it looked like your comment

          Just an update. You should only have to change the filenames to lowercase

          addressed the following:

          mv /build/hudson/users/UL11251 /build/hudson/users/ul11251 and then modify config.xml to find and replace all UL11251 in ul11251.

          The latter is still necessary (depending on security realm), otherwise you'll have your users but they won't have permissions to do anything.

          Daniel Beck added a comment - Stephen: I know, but it looked like your comment Just an update. You should only have to change the filenames to lowercase addressed the following: mv /build/hudson/users/UL11251 /build/hudson/users/ul11251 and then modify config.xml to find and replace all UL11251 in ul11251. The latter is still necessary (depending on security realm), otherwise you'll have your users but they won't have permissions to do anything.

          Code changed in jenkins
          User: Jesse Glick
          Path:
          changelog.html
          core/src/main/java/hudson/model/User.java
          test/src/test/java/hudson/model/UserTest.java
          test/src/test/resources/hudson/model/UserTest/migration.zip
          http://jenkins-ci.org/commit/jenkins/088edabb31a90cd607f3c6a3123effce5703c817
          Log:
          [FIXED JENKINS-24317] Corrected user dir migration code from JENKINS-23872.
          Adapted from #1375 by @daniel-beck: omitting change to User construction, and adding test.

          Compare: https://github.com/jenkinsci/jenkins/compare/3daa6a97b026...088edabb31a9

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: changelog.html core/src/main/java/hudson/model/User.java test/src/test/java/hudson/model/UserTest.java test/src/test/resources/hudson/model/UserTest/migration.zip http://jenkins-ci.org/commit/jenkins/088edabb31a90cd607f3c6a3123effce5703c817 Log: [FIXED JENKINS-24317] Corrected user dir migration code from JENKINS-23872 . Adapted from #1375 by @daniel-beck: omitting change to User construction, and adding test. Compare: https://github.com/jenkinsci/jenkins/compare/3daa6a97b026...088edabb31a9

          Code changed in jenkins
          User: Jesse Glick
          Path:
          changelog.html
          core/src/main/java/hudson/model/User.java
          test/src/test/java/hudson/model/UserTest.java
          test/src/test/resources/hudson/model/UserTest/migration.zip
          http://jenkins-ci.org/commit/jenkins/bce92ec53ddefb7d5105f3f82af96ee954467bdd
          Log:
          [FIXED JENKINS-24317] Corrected user dir migration code from JENKINS-23872.
          Adapted from #1375 by @daniel-beck: omitting change to User construction, and adding test.
          (cherry picked from commit 088edabb31a90cd607f3c6a3123effce5703c817)

          Conflicts:
          changelog.html

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: changelog.html core/src/main/java/hudson/model/User.java test/src/test/java/hudson/model/UserTest.java test/src/test/resources/hudson/model/UserTest/migration.zip http://jenkins-ci.org/commit/jenkins/bce92ec53ddefb7d5105f3f82af96ee954467bdd Log: [FIXED JENKINS-24317] Corrected user dir migration code from JENKINS-23872 . Adapted from #1375 by @daniel-beck: omitting change to User construction, and adding test. (cherry picked from commit 088edabb31a90cd607f3c6a3123effce5703c817) Conflicts: changelog.html

            stephenconnolly Stephen Connolly
            ecresta e. cresta
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: