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

Role based stratedy can't be showed in Config as Code - java null ptr exeption

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 587.v2872c41fa_e51

      I want to try out config as code plugin.
      I went to Manage Jenkins -> Configuration as Code and then I clicked "View configuration"

      This is yaml output:

        authorizationStrategy:
          roleBased:
            roles:
              global: |-
                FAILED TO EXPORT
                org.jenkinsci.plugins.rolestrategy.casc.GrantedRoles#global: java.lang.NullPointerException
                  at java.util.regex.Matcher.getTextLength(Matcher.java:1283)
                  at java.util.regex.Matcher.reset(Matcher.java:309)
                  at java.util.regex.Matcher.<init>(Matcher.java:229)
                  at java.util.regex.Pattern.matcher(Pattern.java:1093)
                  at org.jenkinsci.plugins.rolestrategy.casc.PermissionFinder.findPermissionId(PermissionFinder.java:42)
                  at org.jenkinsci.plugins.rolestrategy.casc.RoleDefinition.getRole(RoleDefinition.java:48)
                  at org.jenkinsci.plugins.rolestrategy.casc.RoleDefinition.<init>(RoleDefinition.java:41)
                Caused: java.lang.reflect.InvocationTargetException
                  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
                  at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
                  at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
                  at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
                  at io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator.describe(DataBoundConfigurator.java:309)
                  at io.jenkins.plugins.casc.Attribute._describe(Attribute.java:329)
                  at io.jenkins.plugins.casc.Attribute.describe(Attribute.java:258)
                  at io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator.describe(DataBoundConfigurator.java:317)
                  at io.jenkins.plugins.casc.Attribute._describe(Attribute.java:329)
                  at io.jenkins.plugins.casc.Attribute.describe(Attribute.java:265)
                  at io.jenkins.plugins.casc.BaseConfigurator.compare(BaseConfigurator.java:392)
                  at org.jenkinsci.plugins.rolestrategy.casc.RoleBasedAuthorizationStrategyConfigurator.describe(RoleBasedAuthorizationStrategyConfigurator.java:92)
                  at org.jenkinsci.plugins.rolestrategy.casc.RoleBasedAuthorizationStrategyConfigurator.describe(RoleBasedAuthorizationStrategyConfigurator.java:32)
                  at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.lambda$convertToNode$de0cd4f8$1(HeteroDescribableConfigurator.java:282)
                  at io.vavr.CheckedFunction0.lambda$unchecked$52349c75$1(CheckedFunction0.java:247)
                  at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.convertToNode(HeteroDescribableConfigurator.java:282)
                  at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.lambda$describe$5(HeteroDescribableConfigurator.java:107)
                  at io.vavr.control.Option.map(Option.java:392)
                  at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.describe(HeteroDescribableConfigurator.java:107)
                  at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.describe(HeteroDescribableConfigurator.java:55)
                  at io.jenkins.plugins.casc.Attribute._describe(Attribute.java:329)
                  at io.jenkins.plugins.casc.Attribute.describe(Attribute.java:265)
                  at io.jenkins.plugins.casc.Configurator.describe(Configurator.java:181)
      

        1. image-2022-12-30-17-25-04-822.png
          224 kB
          Davide Cavestro
        2. image-2022-12-30-17-27-43-391.png
          40 kB
          Davide Cavestro
        3. image-2022-12-30-17-28-11-750.png
          38 kB
          Davide Cavestro
        4. image-2022-12-30-17-29-23-190.png
          225 kB
          Davide Cavestro

            mawinter69 Markus Winter
            dumam Bartosz Nowak
            Votes:
            3 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: