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

Jenkins Start up Error : Cannot resolve permission for ID: Lockable Resources/View Unlock Reserve

XMLWordPrintable

      I am seeing errors mentioned below when trying to upgrade Jenkins from current version "2.332.3" to "2.346.2"

      This Jenkins instance is setup on Kubernetes. So we update the Jenkins version and plugins in the source repo in yaml config files and then apply the changes to bring up Jenkins master with upgraded version and plugins.

      My current JCasC config looks something like below:

      ### Values used by the dependent 'jenkins' Helm Chart
      jenkins:
       ...
      
          JCasC:
            enabled: true
            configScripts:
              welcome-message: |
                jenkins:
                  systemMessage: "XYZ"
              global-setup: |
                ...
                jenkins:
                  labelString: "lightweight-executor-master"
                  authorizationStrategy:
                    roleBased:
                      roles:
                        global:
                          - name: "admin"
                            description: "Jenkins administrators"
                            assignments:
                              - "abc@xyz.com"
                            permissions:
                              - "Overall/Administer"
                              - "Overall/Read"
                              - "Support/DownloadBundle"
                              - "Credentials/Create"
                              - "Credentials/Delete"
                              - "Credentials/ManageDomains"
                              - "Credentials/Update"
                              - "Credentials/View"
                              - "Agent/Build"
                              - "Agent/Configure"
                              - "Agent/Connect"
                              - "Agent/Create"
                              - "Agent/Delete"
                              - "Agent/Disconnect"
                              - "Agent/Provision"
                              - "Build Failure Analyzer/RemoveCause"
                              - "Build Failure Analyzer/UpdateCauses"
                              - "Build Failure Analyzer/ViewCauses"
                              - "Job/Build"
                              - "Job/Cancel"
                              - "Job/Configure"
                              - "Job/Create"
                              - "Job/Delete"
                              - "Job/Discover"
                              - "Job/Move"
                              - "Job/Read"
                              - "Job/Workspace"
                              - "Run/Delete"
                              - "Run/Replay"
                              - "Run/Update"
                              - "View/Configure"
                              - "View/Create"
                              - "View/Delete"
                              - "View/Read"
                              - "SCM/Tag"
                              - "Metrics/HealthCheck"
                              - "Metrics/ThreadDump"
                              - "Metrics/View"
                              - "Lockable Resources/Reserve"
                              - "Lockable Resources/Unlock"
                              - "Lockable Resources/View"
                          - name: "developer"
                            description: "Jenkins developers"
      ...

      Jenkins fails during start up and I see below log. I have attached full Jenkins log as well. 

      2022-07-28 06:23:48.722+0000 [id=31]    WARNING    o.j.p.p.c.PrometheusConfiguration#lambda$parseLongFromEnv$1: COLLECTING_METRICS_PERIOD_IN_SECONDS must be a positive integer. The default value: '120' will be used instead of provided.
      2022-07-28 06:23:49.326+0000 [id=34]    INFO    jenkins.InitReactorRunner$1#onAttained: Started all plugins
      2022-07-28 06:23:49.332+0000 [id=32]    INFO    jenkins.InitReactorRunner$1#onAttained: Augmented all extensions
      2022-07-28 06:23:49.453+0000 [id=31]    WARNING    o.j.p.p.DiskUsageCollector#collect: Cannot collect disk usage data because plugin CloudBees Disk Usage Simple is not installed: java.lang.NoClassDefFoundError: com/cloudbees/simplediskusage/QuickDiskUsagePlugin
      2022-07-28 06:23:49.503+0000 [id=35]    INFO    jenkins.InitReactorRunner$1#onAttained: System config loaded
      2022-07-28 06:23:51.794+0000 [id=35]    SEVERE    jenkins.InitReactorRunner$1#onTaskFailed: Failed ConfigurationAsCode.init
      java.lang.IllegalStateException: Cannot resolve permission for ID: Lockable Resources/View
          at org.jenkinsci.plugins.rolestrategy.casc.RoleDefinition.getRole(RoleDefinition.java:67)
          at org.jenkinsci.plugins.rolestrategy.casc.RoleDefinition.<init>(RoleDefinition.java:51)
      Caused: java.lang.reflect.InvocationTargetException
          at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
          at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
          at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
          at java.base/java.lang.reflect.Constructor.newInstance(Unknown Source)
          at io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator.tryConstructor(DataBoundConfigurator.java:173)
      Caused: io.jenkins.plugins.casc.ConfiguratorException: roleDefinition: Failed to construct instance of class org.jenkinsci.plugins.rolestrategy.casc.RoleDefinition.
       Constructor: public org.jenkinsci.plugins.rolestrategy.casc.RoleDefinition(java.lang.String,java.lang.String,java.lang.String,java.util.Collection,java.util.Collection).
       Arguments: [java.lang.String, java.lang.String, null, java.util.ArrayList, java.util.ArrayList].
       Expected Parameters: name java.lang.String, description java.lang.String, pattern java.lang.String, permissions java.util.Collection<java.lang.String>, assignments java.util.Collection<java.lang.String>
          at io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator.tryConstructor(DataBoundConfigurator.java:191)
          at io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator.instance(DataBoundConfigurator.java:76)
          at io.jenkins.plugins.casc.BaseConfigurator.configure(BaseConfigurator.java:266)
          at io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator.configure(DataBoundConfigurator.java:82)
          at io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator.tryConstructor(DataBoundConfigurator.java:151)
          at io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator.instance(DataBoundConfigurator.java:76)
          at io.jenkins.plugins.casc.BaseConfigurator.configure(BaseConfigurator.java:266)
          at io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator.configure(DataBoundConfigurator.java:82)
          at org.jenkinsci.plugins.rolestrategy.casc.RoleBasedAuthorizationStrategyConfigurator.instance(RoleBasedAuthorizationStrategyConfigurator.java:57)
          at org.jenkinsci.plugins.rolestrategy.casc.RoleBasedAuthorizationStrategyConfigurator.instance(RoleBasedAuthorizationStrategyConfigurator.java:33)
          at io.jenkins.plugins.casc.BaseConfigurator.configure(BaseConfigurator.java:266)
          at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.lambda$doConfigure$16668e2$1(HeteroDescribableConfigurator.java:277)
          at io.vavr.CheckedFunction0.lambda$unchecked$52349c75$1(CheckedFunction0.java:247)
          at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.doConfigure(HeteroDescribableConfigurator.java:277)
          at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.lambda$configure$2(HeteroDescribableConfigurator.java:86)
          at io.vavr.control.Option.map(Option.java:392)
          at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.lambda$configure$3(HeteroDescribableConfigurator.java:86)
          at io.vavr.Tuple2.apply(Tuple2.java:238)
          at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.configure(HeteroDescribableConfigurator.java:83)
          at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.check(HeteroDescribableConfigurator.java:92)
          at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.check(HeteroDescribableConfigurator.java:55)
          at io.jenkins.plugins.casc.BaseConfigurator.configure(BaseConfigurator.java:350)
          at io.jenkins.plugins.casc.BaseConfigurator.check(BaseConfigurator.java:286)
          at io.jenkins.plugins.casc.ConfigurationAsCode.lambda$checkWith$8(ConfigurationAsCode.java:776)
          at io.jenkins.plugins.casc.ConfigurationAsCode.invokeWith(ConfigurationAsCode.java:712)
      Caused: io.jenkins.plugins.casc.ConfiguratorException: jenkins: error configuring 'jenkins' with class io.jenkins.plugins.casc.core.JenkinsConfigurator configurator
      
      

       

      Note : For a workaround I tried commenting "Lockable Resources" in "jcasc.yaml" (Configuration as Code) yaml file as mentioned below. This workaround is able to bring up Jenkins fine without any issues. 

       

      # - "Lockable Resources/Reserve"                        
      # - "Lockable Resources/Unlock"
      # - "Lockable Resources/View"

            mawinter69 Markus Winter
            vagarwal Vikas Agarwal
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: