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

RejectedAccessException: Scripts not permitted to use method hudson.plugins.git.GitSCM getBranches

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Critical Critical
    • git-plugin
    • None
    • jenkins instance configured with github organization plugin and github authorization too.
    • git plugin 4.1.0

      It seems that I get this exception which is NOT logged inside the script approver which means there is not way to approve it.

      org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: Scripts not permitted to use method hudson.plugins.git.GitSCM getBranches
      

      This happened with this pipeline https://github.com/pycontribs/powertape/blob/master/Jenkinsfile

       

      Now, the interesting thing is that if you configure a this project in jenkins using the pipeline type of of job and setting the source as SCM, it will work.

      So this problem is specific to this way of configuring the jobs.

          [JENKINS-42860] RejectedAccessException: Scripts not permitted to use method hudson.plugins.git.GitSCM getBranches

          Sorin Sbarnea created issue -
          Sorin Sbarnea made changes -
          Link New: This issue is related to JENKINS-37817 [ JENKINS-37817 ]
          Sorin Sbarnea made changes -
          Link New: This issue is related to JENKINS-37658 [ JENKINS-37658 ]
          Sorin Sbarnea made changes -
          Component/s New: pipeline [ 21692 ]
          Andrew Bayer made changes -
          Component/s New: github-branch-source-plugin [ 20858 ]
          Component/s Original: github-oauth-plugin [ 15900 ]
          Component/s Original: pipeline [ 21692 ]
          Andrew Bayer made changes -
          Assignee Original: Sam Gleske [ sag47 ] New: Kohsuke Kawaguchi [ kohsuke ]

          Albert V added a comment -

          Did you tried to go to $JENKINS_URL/scriptApproval/ and look if you have some signatures pending to approve?
          I had this problem and I had to update this page to add 4 different signatures. 

          Albert V added a comment - Did you tried to go to $JENKINS_URL/scriptApproval/ and look if you have some signatures pending to approve? I had this problem and I had to update this page to add 4 different signatures. 
          Mihai Stoichitescu made changes -
          Assignee Original: Kohsuke Kawaguchi [ kohsuke ] New: Mihai Stoichitescu [ stoiky ]
          Mihai Stoichitescu made changes -
          Assignee Original: Mihai Stoichitescu [ stoiky ] New: Kohsuke Kawaguchi [ kohsuke ]

          m4x1m0v3r This does not appear on `In-process Script Approval` unfortunately.

          Mihai Stoichitescu added a comment - m4x1m0v3r This does not appear on `In-process Script Approval` unfortunately.

            Unassigned Unassigned
            ssbarnea Sorin Sbarnea
            Votes:
            9 Vote for this issue
            Watchers:
            15 Start watching this issue

              Created:
              Updated:
              Resolved: