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

Unable to unshelve change: java.lang.IllegalStateException: Expected 1 instance of hudson.model.User$AllUsers but got 0

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Blocker
    • Resolution: Fixed
    • p4-plugin
    • Jenkins 2.346.2
      P4 Plugin Version 1.13.0
      p4 Version Rev. P4/NTX64/2021.2/2273812 (2022/04/14).
      OS Name Microsoft Windows Server 2019 Datacenter
      OS Version 10.0.17763 Build 17763
      OS System Manufacturer Amazon EC2

    Description

      After updating the plugin from v1.12.4 to v1.13.0 our unshelve operations resulted in the following error that looks related to saving the unshelve change to the changelog file:

      [2022-07-28T21:22:34.503Z] P4 Task: unshelve review: 1153859
      [2022-07-28T21:22:34.512Z] (p4):cmd:... p4 unshelve -f -s1153859 -cdefault
      [2022-07-28T21:22:34.512Z] p4 unshelve -f -s1153859 -cdefault
      ...
      [2022-07-28T21:22:34.676Z] ... duration: (173ms)
      [2022-07-28T21:22:34.709Z] (p4):cmd:... p4 change -o 1153859
      [2022-07-28T21:22:34.709Z] p4 change -o 1153859
      [2022-07-28T21:22:34.709Z] 
      [2022-07-28T21:22:34.719Z] (p4):stop:11
      [2022-07-28T21:22:34.781Z] (p4):stop:exception
      [2022-07-28T21:22:34.781Z] 
      [2022-07-28T21:22:34.781Z] Unable to unshelve change: java.lang.IllegalStateException: Expected 1 instance of hudson.model.User$AllUsers but got 0

      Rolling back the plugin to v1.12.4 unblocked us:

      [2022-07-28T22:09:46.594Z] P4 Task: unshelve review: 1153859
      [2022-07-28T22:09:46.604Z] (p4):cmd:... p4 unshelve -f -s1153859 -cdefault
      [2022-07-28T22:09:46.604Z] p4 unshelve -f -s1153859 -cdefault
      ...
      [2022-07-28T22:09:46.780Z] ... duration: (186ms)
      [2022-07-28T22:09:46.780Z] P4 Task: resolve: -Safe (-as)
      [2022-07-28T22:09:46.791Z] (p4):cmd:... p4 resolve -am C:\Workspace/...
      [2022-07-28T22:09:46.791Z] p4 resolve -am C:\Workspace/...
      [2022-07-28T22:09:46.791Z] 
      [2022-07-28T22:09:46.800Z] C:\Workspace/... - no file(s) to resolve.
      [2022-07-28T22:09:46.800Z] 
      [2022-07-28T22:09:46.800Z] (p4):stop:11
      [2022-07-28T22:09:46.800Z] ... duration: (20ms)

      This is the configuration of the unshelve command we are running:

      p4unshelve(
        credential: env.P4CREDENTIAL,                            
        ignoreEmpty: true,
        resolve: "Safe (-as)",
        shelf: params.Shelveset,
        tidy: false,
        workspace: streamSpec(
          charset: "auto",
          format: env.P4WORKSPACE,
          pinHost: false,
          streamName: env.P4STREAM
        )
      )

       

      Attachments

        Activity

          p4karl Karl Wirth added a comment -

          Thanks heiko_nardmann 

          I have also now been able to reproduce this with 2.289.2.

          Reproduction steps:

          (1) Install Jenkins 2.289.3

          (2) Install P4-Plugin 1.13.0.

          (3) Setup a Jenkins slave. Note I start mine from Linux with:

          java -jar agent.jar -jnlpUrl http://JENKINS-SERVER:8080/computer/LinuxDesktop/jenkins-agent.jnlp -secret 6ecae164acb9f98d19e8449cd8fa3755f14bbb8c966208fab5216fe6ddd7305c -workDir "/filestoreSSD/Vagrant/Jenkins/slave1"

          (4) Shelve a file from P4V or the command line and record the shelved CL.

          (5) Create a freetyle job that sync the files related to the shelf then a build step that unshelves the known pending shelf to the slave. For example:

          and:

          (6) When you run the build you will see the error. For example when unshelving CL 2536:

          P4 Task: unshelve review: 2536
          ... p4 unshelve -f -s2536 -cdefault +
          ... duration: (27ms)
          ... p4 change -o 2536 +
          Unable to unshelve change: java.lang.IllegalStateException: Expected 1 instance of hudson.model.User$AllUsers but got 0
          P4 Task: attempt: 1 

           

          p4karl Karl Wirth added a comment - Thanks heiko_nardmann   I have also now been able to reproduce this with 2.289.2. Reproduction steps: (1) Install Jenkins 2.289.3 (2) Install P4-Plugin 1.13.0. (3) Setup a Jenkins slave. Note I start mine from Linux with: java -jar agent.jar -jnlpUrl http: //JENKINS-SERVER:8080/computer/LinuxDesktop/jenkins-agent.jnlp -secret 6ecae164acb9f98d19e8449cd8fa3755f14bbb8c966208fab5216fe6ddd7305c -workDir "/filestoreSSD/Vagrant/Jenkins/slave1" (4) Shelve a file from P4V or the command line and record the shelved CL. (5) Create a freetyle job that sync the files related to the shelf then a build step that unshelves the known pending shelf to the slave. For example: and: (6) When you run the build you will see the error. For example when unshelving CL 2536: P4 Task: unshelve review: 2536 ... p4 unshelve -f -s2536 -cdefault + ... duration: (27ms) ... p4 change -o 2536 + Unable to unshelve change: java.lang.IllegalStateException: Expected 1 instance of hudson.model.User$AllUsers but got 0 P4 Task: attempt: 1  

          I'm also experiencing this issue with Jenkins 2.346.3 & 1.13.0 of the P4 plugin. We've had to downgrade the plugin to 1.11.6 until this has been fixed, as this bug is completely blocking us.

          pd_andrew Andrew Ferguson added a comment - I'm also experiencing this issue with Jenkins 2.346.3 & 1.13.0 of the P4 plugin. We've had to downgrade the plugin to 1.11.6 until this has been fixed, as this bug is completely blocking us.
          p4karl Karl Wirth added a comment -

          pd_andrew - thanks for letting us know. I will make sure the product managers see this. 

          p4karl Karl Wirth added a comment - pd_andrew - thanks for letting us know. I will make sure the product managers see this. 
          p4paul Paul Allen added a comment -

          Released in 1.13.2

          p4paul Paul Allen added a comment - Released in 1.13.2
          p4karl Karl Wirth added a comment -

          Confirmation that it is solved in 1.13.2 -
          Before upgrade:
          P4 Task: unshelve review: 2695
          ... p4 unshelve -f -s2695 -cdefault +
          ... duration: (6ms)
          ... p4 change -o 2695 +

          Unable to unshelve change: java.lang.IllegalStateException: Expected 1 instance of hudson.model.User$AllUsers but got 0
          P4 Task: attempt: 1
          Build step 'Perforce: Unshelve' marked build as failure
          Finished: FAILURE
           
          Same job after upgrade:
          P4 Task: unshelve review: 2695
          ... p4 unshelve -f -s2695 -cdefault +
          ... duration: (5ms)
          P4 Task: resolve: -at

          p4karl Karl Wirth added a comment - Confirmation that it is solved in 1.13.2 - Before upgrade: P4 Task: unshelve review: 2695 ... p4 unshelve -f -s2695 -cdefault + ... duration: (6ms) ... p4 change -o 2695 + Unable to unshelve change: java.lang.IllegalStateException: Expected 1 instance of hudson.model.User$AllUsers but got 0 P4 Task: attempt: 1 Build step 'Perforce: Unshelve' marked build as failure Finished: FAILURE   Same job after upgrade: P4 Task: unshelve review: 2695 ... p4 unshelve -f -s2695 -cdefault + ... duration: (5ms) P4 Task: resolve: -at

          People

            Unassigned Unassigned
            kuzman Trent Kuzman
            Votes:
            10 Vote for this issue
            Watchers:
            13 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: