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

Cannot resolve permission for ID: View/Create

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Duplicate
    • Labels:
      None
    • Environment:
      Jenkins version: 2.303
      Role-based Authorization Strategy: 3.2.0
      Matrix Authorization Strategy Plugin: 2.6.8
      Configuration as Code Plugin: 1.51
    • Similar Issues:

      Description

      After updating Jenkins to the latest version, the Configuration as Code plugin can no longer resolve the View/Create permission. The CasC config can be imported with no issue after removing all View permissions.

      My JCasC config looks something like the below:

       

      ...
      jenkins:  agentProtocols:
          - "JNLP4-connect"
          - "Ping"
        authorizationStrategy:
          roleBased:
            roles:
              global:
                - name: "admin"
                  assignments:
                    - "admin"
                    - "user1"       
                  pattern: ".*"
                  permissions:
                    - "Job/Move"
                    - "Job/Build"
                    - "Credentials/Delete"
                    - "Credentials/ManageDomains"
                    - "View/Create"
      ...

      Full error message

       

      [2021-08-03T05:42:05.549Z] 2021-08-03 05:41:57.991+0000 [id=42]	SEVERE	jenkins.InitReactorRunner$1#onTaskFailed: Failed ConfigurationAsCode.init
      [2021-08-03T05:42:05.549Z] java.lang.IllegalStateException: Cannot resolve permission for ID: View/Create
      [2021-08-03T05:42:05.549Z] 	at org.jenkinsci.plugins.rolestrategy.casc.RoleDefinition.getRole(RoleDefinition.java:52)
      [2021-08-03T05:42:05.549Z] 	at org.jenkinsci.plugins.rolestrategy.casc.RoleDefinition.<init>(RoleDefinition.java:41)
      [2021-08-03T05:42:05.549Z] Caused: java.lang.reflect.InvocationTargetException
      [2021-08-03T05:42:05.549Z] 	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      [2021-08-03T05:42:05.549Z] 	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
      [2021-08-03T05:42:05.549Z] 	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      [2021-08-03T05:42:05.549Z] 	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
      [2021-08-03T05:42:05.549Z] 	at io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator.tryConstructor(DataBoundConfigurator.java:173)
      [2021-08-03T05:42:05.549Z] Caused: io.jenkins.plugins.casc.ConfiguratorException: roleDefinition: Failed to construct instance of class org.jenkinsci.plugins.rolestrategy.casc.RoleDefinition.
      [2021-08-03T05:42:05.549Z]  Constructor: public org.jenkinsci.plugins.rolestrategy.casc.RoleDefinition(java.lang.String,java.lang.String,java.lang.String,java.util.Collection,java.util.Collection).
      [2021-08-03T05:42:05.549Z]  Arguments: [java.lang.String, null, java.lang.String, java.util.ArrayList, java.util.ArrayList].
      [2021-08-03T05:42:05.549Z]  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>
      [2021-08-03T05:42:05.549Z] 	at io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator.tryConstructor(DataBoundConfigurator.java:191)
      [2021-08-03T05:42:05.549Z] 	at io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator.instance(DataBoundConfigurator.java:76)
      [2021-08-03T05:42:05.549Z] 	at io.jenkins.plugins.casc.BaseConfigurator.configure(BaseConfigurator.java:267)
      [2021-08-03T05:42:05.549Z] 	at io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator.configure(DataBoundConfigurator.java:82)
      [2021-08-03T05:42:05.549Z] 	at io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator.tryConstructor(DataBoundConfigurator.java:151)
      [2021-08-03T05:42:05.549Z] 	at io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator.instance(DataBoundConfigurator.java:76)
      [2021-08-03T05:42:05.549Z] 	at io.jenkins.plugins.casc.BaseConfigurator.configure(BaseConfigurator.java:267)
      [2021-08-03T05:42:05.549Z] 	at io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator.configure(DataBoundConfigurator.java:82)
      [2021-08-03T05:42:05.549Z] 	at org.jenkinsci.plugins.rolestrategy.casc.RoleBasedAuthorizationStrategyConfigurator.instance(RoleBasedAuthorizationStrategyConfigurator.java:58)
      [2021-08-03T05:42:05.549Z] 	at org.jenkinsci.plugins.rolestrategy.casc.RoleBasedAuthorizationStrategyConfigurator.instance(RoleBasedAuthorizationStrategyConfigurator.java:34)
      [2021-08-03T05:42:05.549Z] 	at io.jenkins.plugins.casc.BaseConfigurator.configure(BaseConfigurator.java:267)
      [2021-08-03T05:42:05.549Z] 	at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.lambda$doConfigure$16668e2$1(HeteroDescribableConfigurator.java:277)
      [2021-08-03T05:42:05.549Z] 	at io.vavr.CheckedFunction0.lambda$unchecked$52349c75$1(CheckedFunction0.java:247)
      [2021-08-03T05:42:05.549Z] 	at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.doConfigure(HeteroDescribableConfigurator.java:277)
      [2021-08-03T05:42:05.549Z] 	at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.lambda$configure$2(HeteroDescribableConfigurator.java:86)
      [2021-08-03T05:42:05.549Z] 	at io.vavr.control.Option.map(Option.java:392)
      [2021-08-03T05:42:05.549Z] 	at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.lambda$configure$3(HeteroDescribableConfigurator.java:86)
      [2021-08-03T05:42:05.549Z] 	at io.vavr.Tuple2.apply(Tuple2.java:238)
      [2021-08-03T05:42:05.549Z] 	at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.configure(HeteroDescribableConfigurator.java:83)
      [2021-08-03T05:42:05.549Z] 	at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.check(HeteroDescribableConfigurator.java:92)
      [2021-08-03T05:42:05.549Z] 	at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.check(HeteroDescribableConfigurator.java:55)
      [2021-08-03T05:42:05.549Z] 	at io.jenkins.plugins.casc.BaseConfigurator.configure(BaseConfigurator.java:351)
      [2021-08-03T05:42:05.549Z] 	at io.jenkins.plugins.casc.BaseConfigurator.check(BaseConfigurator.java:287)
      [2021-08-03T05:42:05.549Z] 	at io.jenkins.plugins.casc.ConfigurationAsCode.lambda$checkWith$8(ConfigurationAsCode.java:777)
      [2021-08-03T05:42:05.549Z] 	at io.jenkins.plugins.casc.ConfigurationAsCode.invokeWith(ConfigurationAsCode.java:713)
      [2021-08-03T05:42:05.549Z] Caused: io.jenkins.plugins.casc.ConfiguratorException: jenkins: error configuring 'jenkins' with class io.jenkins.plugins.casc.core.JenkinsConfigurator configurator
      [2021-08-03T05:42:05.549Z] 	at io.jenkins.plugins.casc.ConfigurationAsCode.invokeWith(ConfigurationAsCode.java:719)
      [2021-08-03T05:42:05.549Z] 	at io.jenkins.plugins.casc.ConfigurationAsCode.checkWith(ConfigurationAsCode.java:777)
      [2021-08-03T05:42:05.549Z] 	at io.jenkins.plugins.casc.ConfigurationAsCode.configureWith(ConfigurationAsCode.java:762)
      [2021-08-03T05:42:05.549Z] 	at io.jenkins.plugins.casc.ConfigurationAsCode.configureWith(ConfigurationAsCode.java:638)
      [2021-08-03T05:42:05.549Z] 	at io.jenkins.plugins.casc.ConfigurationAsCode.configure(ConfigurationAsCode.java:307)
      [2021-08-03T05:42:05.549Z] 	at io.jenkins.plugins.casc.ConfigurationAsCode.init(ConfigurationAsCode.java:299)
      [2021-08-03T05:42:05.549Z] Caused: java.lang.reflect.InvocationTargetException
      [2021-08-03T05:42:05.549Z] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      [2021-08-03T05:42:05.549Z] 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      [2021-08-03T05:42:05.549Z] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      [2021-08-03T05:42:05.549Z] 	at java.lang.reflect.Method.invoke(Method.java:498)
      [2021-08-03T05:42:05.549Z] 	at hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:105)
      [2021-08-03T05:42:05.549Z] Caused: java.lang.Error
      [2021-08-03T05:42:05.549Z] 	at hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:111)
      [2021-08-03T05:42:05.549Z] 	at hudson.init.TaskMethodFinder$TaskImpl.run(TaskMethodFinder.java:181)
      [2021-08-03T05:42:05.549Z] 	at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:296)
      [2021-08-03T05:42:05.549Z] 	at jenkins.model.Jenkins$5.runTask(Jenkins.java:1160)
      [2021-08-03T05:42:05.549Z] 	at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:214)
      [2021-08-03T05:42:05.549Z] 	at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117)
      [2021-08-03T05:42:05.549Z] 	at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:68)
      [2021-08-03T05:42:05.549Z] 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      [2021-08-03T05:42:05.549Z] 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      [2021-08-03T05:42:05.549Z] 	at java.lang.Thread.run(Thread.java:748)
      [2021-08-03T05:42:05.549Z] 2021-08-03 05:41:57.993+0000 [id=22]	SEVERE	hudson.util.BootFailure#publish: Failed to initialize Jenkins
      [2021-08-03T05:42:05.549Z] java.lang.IllegalStateException: Cannot resolve permission for ID: View/Create
      [2021-08-03T05:42:05.549Z] 	at org.jenkinsci.plugins.rolestrategy.casc.RoleDefinition.getRole(RoleDefinition.java:52)
      [2021-08-03T05:42:05.549Z] 	at org.jenkinsci.plugins.rolestrategy.casc.RoleDefinition.<init>(RoleDefinition.java:41)
      [2021-08-03T05:42:05.549Z] Caused: java.lang.reflect.InvocationTargetException
      [2021-08-03T05:42:05.549Z] 	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      [2021-08-03T05:42:05.549Z] 	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
      [2021-08-03T05:42:05.549Z] 	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      [2021-08-03T05:42:05.549Z] 	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
      [2021-08-03T05:42:05.549Z] 	at io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator.tryConstructor(DataBoundConfigurator.java:173)
      [2021-08-03T05:42:05.549Z] Caused: io.jenkins.plugins.casc.ConfiguratorException: roleDefinition: Failed to construct instance of class org.jenkinsci.plugins.rolestrategy.casc.RoleDefinition.
      [2021-08-03T05:42:05.549Z]  Constructor: public org.jenkinsci.plugins.rolestrategy.casc.RoleDefinition(java.lang.String,java.lang.String,java.lang.String,java.util.Collection,java.util.Collection).
      [2021-08-03T05:42:05.549Z]  Arguments: [java.lang.String, null, java.lang.String, java.util.ArrayList, java.util.ArrayList].
      [2021-08-03T05:42:05.549Z]  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>
      [2021-08-03T05:42:05.549Z] 	at io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator.tryConstructor(DataBoundConfigurator.java:191)
      [2021-08-03T05:42:05.549Z] 	at io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator.instance(DataBoundConfigurator.java:76)
      [2021-08-03T05:42:05.549Z] 	at io.jenkins.plugins.casc.BaseConfigurator.configure(BaseConfigurator.java:267)
      [2021-08-03T05:42:05.549Z] 	at io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator.configure(DataBoundConfigurator.java:82)
      [2021-08-03T05:42:05.549Z] 	at io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator.tryConstructor(DataBoundConfigurator.java:151)
      [2021-08-03T05:42:05.549Z] 	at io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator.instance(DataBoundConfigurator.java:76)
      [2021-08-03T05:42:05.549Z] 	at io.jenkins.plugins.casc.BaseConfigurator.configure(BaseConfigurator.java:267)
      [2021-08-03T05:42:05.549Z] 	at io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator.configure(DataBoundConfigurator.java:82)
      [2021-08-03T05:42:05.549Z] 	at org.jenkinsci.plugins.rolestrategy.casc.RoleBasedAuthorizationStrategyConfigurator.instance(RoleBasedAuthorizationStrategyConfigurator.java:58)
      [2021-08-03T05:42:05.549Z] 	at org.jenkinsci.plugins.rolestrategy.casc.RoleBasedAuthorizationStrategyConfigurator.instance(RoleBasedAuthorizationStrategyConfigurator.java:34)
      [2021-08-03T05:42:05.549Z] 	at io.jenkins.plugins.casc.BaseConfigurator.configure(BaseConfigurator.java:267)
      [2021-08-03T05:42:05.549Z] 	at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.lambda$doConfigure$16668e2$1(HeteroDescribableConfigurator.java:277)
      [2021-08-03T05:42:05.549Z] 	at io.vavr.CheckedFunction0.lambda$unchecked$52349c75$1(CheckedFunction0.java:247)
      [2021-08-03T05:42:05.549Z] 	at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.doConfigure(HeteroDescribableConfigurator.java:277)
      [2021-08-03T05:42:05.549Z] 	at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.lambda$configure$2(HeteroDescribableConfigurator.java:86)
      [2021-08-03T05:42:05.549Z] 	at io.vavr.control.Option.map(Option.java:392)
      [2021-08-03T05:42:05.549Z] 	at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.lambda$configure$3(HeteroDescribableConfigurator.java:86)
      [2021-08-03T05:42:05.549Z] 	at io.vavr.Tuple2.apply(Tuple2.java:238)
      [2021-08-03T05:42:05.549Z] 	at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.configure(HeteroDescribableConfigurator.java:83)
      [2021-08-03T05:42:05.549Z] 	at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.check(HeteroDescribableConfigurator.java:92)
      [2021-08-03T05:42:05.549Z] 	at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.check(HeteroDescribableConfigurator.java:55)
      [2021-08-03T05:42:05.549Z] 	at io.jenkins.plugins.casc.BaseConfigurator.configure(BaseConfigurator.java:351)
      [2021-08-03T05:42:05.549Z] 	at io.jenkins.plugins.casc.BaseConfigurator.check(BaseConfigurator.java:287)
      [2021-08-03T05:42:05.549Z] 	at io.jenkins.plugins.casc.ConfigurationAsCode.lambda$checkWith$8(ConfigurationAsCode.java:777)
      [2021-08-03T05:42:05.549Z] 	at io.jenkins.plugins.casc.ConfigurationAsCode.invokeWith(ConfigurationAsCode.java:713)
      [2021-08-03T05:42:05.549Z] Caused: io.jenkins.plugins.casc.ConfiguratorException: jenkins: error configuring 'jenkins' with class io.jenkins.plugins.casc.core.JenkinsConfigurator configurator
      [2021-08-03T05:42:05.549Z] 	at io.jenkins.plugins.casc.ConfigurationAsCode.invokeWith(ConfigurationAsCode.java:719)
      [2021-08-03T05:42:05.549Z] 	at io.jenkins.plugins.casc.ConfigurationAsCode.checkWith(ConfigurationAsCode.java:777)
      [2021-08-03T05:42:05.549Z] 	at io.jenkins.plugins.casc.ConfigurationAsCode.configureWith(ConfigurationAsCode.java:762)
      [2021-08-03T05:42:05.549Z] 	at io.jenkins.plugins.casc.ConfigurationAsCode.configureWith(ConfigurationAsCode.java:638)
      [2021-08-03T05:42:05.549Z] 	at io.jenkins.plugins.casc.ConfigurationAsCode.configure(ConfigurationAsCode.java:307)
      [2021-08-03T05:42:05.549Z] 	at io.jenkins.plugins.casc.ConfigurationAsCode.init(ConfigurationAsCode.java:299)
      [2021-08-03T05:42:05.549Z] Caused: java.lang.reflect.InvocationTargetException
      [2021-08-03T05:42:05.549Z] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      [2021-08-03T05:42:05.549Z] 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      [2021-08-03T05:42:05.549Z] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      [2021-08-03T05:42:05.549Z] 	at java.lang.reflect.Method.invoke(Method.java:498)
      [2021-08-03T05:42:05.549Z] 	at hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:105)
      [2021-08-03T05:42:05.549Z] Caused: java.lang.Error
      [2021-08-03T05:42:05.549Z] 	at hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:111)
      [2021-08-03T05:42:05.549Z] 	at hudson.init.TaskMethodFinder$TaskImpl.run(TaskMethodFinder.java:181)
      [2021-08-03T05:42:05.549Z] 	at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:296)
      [2021-08-03T05:42:05.549Z] 	at jenkins.model.Jenkins$5.runTask(Jenkins.java:1160)
      [2021-08-03T05:42:05.549Z] 	at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:214)
      [2021-08-03T05:42:05.549Z] 	at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117)
      [2021-08-03T05:42:05.549Z] 	at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:68)
      [2021-08-03T05:42:05.549Z] 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      [2021-08-03T05:42:05.549Z] 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      [2021-08-03T05:42:05.549Z] 	at java.lang.Thread.run(Thread.java:748)
      [2021-08-03T05:42:05.549Z] Caused: org.jvnet.hudson.reactor.ReactorException
      [2021-08-03T05:42:05.549Z] 	at org.jvnet.hudson.reactor.Reactor.execute(Reactor.java:282)
      [2021-08-03T05:42:05.549Z] 	at jenkins.InitReactorRunner.run(InitReactorRunner.java:50)
      [2021-08-03T05:42:05.549Z] 	at jenkins.model.Jenkins.executeReactor(Jenkins.java:1193)
      [2021-08-03T05:42:05.549Z] 	at jenkins.model.Jenkins.<init>(Jenkins.java:991)
      [2021-08-03T05:42:05.549Z] 	at hudson.model.Hudson.<init>(Hudson.java:86)
      [2021-08-03T05:42:05.549Z] 	at hudson.model.Hudson.<init>(Hudson.java:82)
      [2021-08-03T05:42:05.549Z] 	at hudson.WebAppMain$3.run(WebAppMain.java:298)
      [2021-08-03T05:42:05.549Z] Caused: hudson.util.HudsonFailedToLoad
      [2021-08-03T05:42:05.549Z] 	at hudson.WebAppMain$3.run(WebAppMain.java:315)
      [2021-08-03T05:42:05.549Z] 2021-08-03 05:41:58.001+0000 [id=22]	INFO	jenkins.model.Jenkins#cleanUp: Stopping Jenkins
      

       

        Attachments

          Issue Links

            Activity

            rd89 Rita created issue -
            emenaceb Emilio Jose Mena Cebrian made changes -
            Field Original Value New Value
            Comment [ It seems to be due to the missing description field 

            Now DataBoundConfigurator is not able to resolve constructor with null values ]
            fcrespel Fabien Crespel made changes -
            Component/s configuration-as-code-plugin [ 23170 ]
            Component/s cas-plugin [ 17476 ]
            basil Basil Crow made changes -
            Link This issue relates to JENKINS-66470 [ JENKINS-66470 ]
            basil Basil Crow made changes -
            Assignee Oleg Nenashev [ oleg_nenashev ] Basil Crow [ basil ]
            Resolution Duplicate [ 3 ]
            Status Open [ 1 ] Resolved [ 5 ]

              People

              Assignee:
              basil Basil Crow
              Reporter:
              rd89 Rita
              Votes:
              5 Vote for this issue
              Watchers:
              8 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: