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

Cannot resolve permission for ID: View/Create

    XMLWordPrintable

Details

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

    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

            sheddar Artur added a comment -

            I'm facing the same issue.

            Jenkins version: 2.308
            Role-based Authorization Strategy: 3.2.0
            Matrix Authorization Strategy Plugin: 2.6.8
            Configuration as Code Plugin: 1.52

            2021-08-31 14:20:00.719+0000 [id=30]    SEVERE  jenkins.InitReactorRunner$1#onTaskFailed: Failed ConfigurationAsCode.init
            java.lang.IllegalStateException: Cannot resolve permission for ID: View/Create
                    at org.jenkinsci.plugins.rolestrategy.casc.RoleDefinition.getRole(RoleDefinition.java:52)
                    at org.jenkinsci.plugins.rolestrategy.casc.RoleDefinition.<init>(RoleDefinition.java:41)
            Caused: java.lang.reflect.InvocationTargetException
                    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
                    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
                    at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
                    at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
                    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, null, java.lang.String, 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:267)
                    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:267)
                    at io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator.configure(DataBoundConfigurator.java:82)
                    at org.jenkinsci.plugins.rolestrategy.casc.RoleBasedAuthorizationStrategyConfigurator.instance(RoleBasedAuthorizationStrategyConfigurator.java:58)
                    at org.jenkinsci.plugins.rolestrategy.casc.RoleBasedAuthorizationStrategyConfigurator.instance(RoleBasedAuthorizationStrategyConfigurator.java:34)
                    at io.jenkins.plugins.casc.BaseConfigurator.configure(BaseConfigurator.java:267)
                    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:351)
                    at io.jenkins.plugins.casc.BaseConfigurator.check(BaseConfigurator.java:287)
                    at io.jenkins.plugins.casc.ConfigurationAsCode.lambda$checkWith$8(ConfigurationAsCode.java:777)
                    at io.jenkins.plugins.casc.ConfigurationAsCode.invokeWith(ConfigurationAsCode.java:713)
            Caused: io.jenkins.plugins.casc.ConfiguratorException: jenkins: error configuring 'jenkins' with class io.jenkins.plugins.casc.core.JenkinsConfigurator configurator
                    at io.jenkins.plugins.casc.ConfigurationAsCode.invokeWith(ConfigurationAsCode.java:719)
                    at io.jenkins.plugins.casc.ConfigurationAsCode.checkWith(ConfigurationAsCode.java:777)
                    at io.jenkins.plugins.casc.ConfigurationAsCode.configureWith(ConfigurationAsCode.java:762)
                    at io.jenkins.plugins.casc.ConfigurationAsCode.configureWith(ConfigurationAsCode.java:638)
                    at io.jenkins.plugins.casc.ConfigurationAsCode.configure(ConfigurationAsCode.java:307)
                    at io.jenkins.plugins.casc.ConfigurationAsCode.init(ConfigurationAsCode.java:299)
            Caused: java.lang.reflect.InvocationTargetException
                    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
                    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
                    at hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:105)
            Caused: java.lang.Error
                    at hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:111)
                    at hudson.init.TaskMethodFinder$TaskImpl.run(TaskMethodFinder.java:181)
                    at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:296)
                    at jenkins.model.Jenkins$5.runTask(Jenkins.java:1160)
                    at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:214)
                    at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117)
                    at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:68)
                    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
                    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
                    at java.base/java.lang.Thread.run(Thread.java:829)
            
            

             

             

            sheddar Artur added a comment - I'm facing the same issue. Jenkins version: 2.308 Role-based Authorization Strategy: 3.2.0 Matrix Authorization Strategy Plugin: 2.6.8 Configuration as Code Plugin: 1.52 2021-08-31 14:20:00.719+0000 [id=30] SEVERE jenkins.InitReactorRunner$1#onTaskFailed: Failed ConfigurationAsCode.init java.lang.IllegalStateException: Cannot resolve permission for ID: View/Create at org.jenkinsci.plugins.rolestrategy.casc.RoleDefinition.getRole(RoleDefinition.java:52) at org.jenkinsci.plugins.rolestrategy.casc.RoleDefinition.<init>(RoleDefinition.java:41) Caused: java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490) 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 , null , java.lang. String , 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:267) 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:267) at io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator.configure(DataBoundConfigurator.java:82) at org.jenkinsci.plugins.rolestrategy.casc.RoleBasedAuthorizationStrategyConfigurator.instance(RoleBasedAuthorizationStrategyConfigurator.java:58) at org.jenkinsci.plugins.rolestrategy.casc.RoleBasedAuthorizationStrategyConfigurator.instance(RoleBasedAuthorizationStrategyConfigurator.java:34) at io.jenkins.plugins.casc.BaseConfigurator.configure(BaseConfigurator.java:267) 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:351) at io.jenkins.plugins.casc.BaseConfigurator.check(BaseConfigurator.java:287) at io.jenkins.plugins.casc.ConfigurationAsCode.lambda$checkWith$8(ConfigurationAsCode.java:777) at io.jenkins.plugins.casc.ConfigurationAsCode.invokeWith(ConfigurationAsCode.java:713) Caused: io.jenkins.plugins.casc.ConfiguratorException: jenkins: error configuring 'jenkins' with class io.jenkins.plugins.casc.core.JenkinsConfigurator configurator at io.jenkins.plugins.casc.ConfigurationAsCode.invokeWith(ConfigurationAsCode.java:719) at io.jenkins.plugins.casc.ConfigurationAsCode.checkWith(ConfigurationAsCode.java:777) at io.jenkins.plugins.casc.ConfigurationAsCode.configureWith(ConfigurationAsCode.java:762) at io.jenkins.plugins.casc.ConfigurationAsCode.configureWith(ConfigurationAsCode.java:638) at io.jenkins.plugins.casc.ConfigurationAsCode.configure(ConfigurationAsCode.java:307) at io.jenkins.plugins.casc.ConfigurationAsCode.init(ConfigurationAsCode.java:299) Caused: java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:105) Caused: java.lang.Error at hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:111) at hudson.init.TaskMethodFinder$TaskImpl.run(TaskMethodFinder.java:181) at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:296) at jenkins.model.Jenkins$5.runTask(Jenkins.java:1160) at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:214) at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117) at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:68) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang. Thread .run( Thread .java:829)    

            Configuration As Code plugin is loaded before loading View class now for some reason.

            It only happens the first time you launch Jenkins.

            ¿Are there no views defined  (and loaded) that time? 

            emenaceb Emilio Jose Mena Cebrian added a comment - Configuration As Code plugin is loaded before loading View class now for some reason. It only happens the first time you launch Jenkins. ¿Are there no views defined  (and loaded) that time? 
            chulkilee Chulki Lee added a comment -

            I hit this error from fresh jenkins install.

             

            Current workaround: comment out View related permission on the first boot - then log in, and then restart jenkins with those permissions.

             

            Is there a way to fix it without this manual workaround? If View is the built-in feature, can we enforce loading it before the cas plugin?

             

            chulkilee Chulki Lee added a comment - I hit this error from fresh jenkins install.   Current workaround: comment out View related permission on the first boot - then log in, and then restart jenkins with those permissions.   Is there a way to fix it without this manual workaround? If View is the built-in feature, can we enforce loading it before the cas plugin?  
            basil Basil Crow added a comment -

            This duplicates JENKINS-66470 and is being addressed in jenkinsci/jenkins#5723.

            basil Basil Crow added a comment - This duplicates JENKINS-66470 and is being addressed in jenkinsci/jenkins#5723 .

            People

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

              Dates

                Created:
                Updated:
                Resolved: