Skip to content

[JENKINS-69435] Scripts can not get approved #875

Open

Description

@jenkins-infra-bot

Hi. In my case, there seems to be no way to "approve" a script.
I am logged in as a Jenkins admin, I edit the script and save it, which should result in automatic approval of the script, that is what he message is saying me.

The script edits get saved, but the script stays in the "not approved" state.
As a result it can not be run in a job, it is annoying because I use e.g. a short script to deactivate a job after each run. I use that script in a lot of jobs and all of those jobs  end with an error state.


Originally reported by artur2000, imported from: Scripts can not get approved
  • status: Open
  • priority: Major
  • component(s): script-security-plugin, scriptler-plugin
  • label(s): 2.346.3, LTS
  • resolution: Unresolved
  • votes: 2
  • watchers: 4
  • imported: 2025-12-09
Raw content of original issue

Hi. In my case, there seems to be no way to "approve" a script. I am logged in as a Jenkins admin, I edit the script and save it, which should result in automatic approval of the script, that is what he message is saying me.

The script edits get saved, but the script stays in the "not approved" state. As a result it can not be run in a job, it is annoying because I use e.g. a short script to deactivate a job after each run. I use that script in a lot of jobs and all of those jobs  end with an error state.

  • environment: Jenkins 2.361.1 LTS, Jenkins 2.346.3 LTS, debian, JDK 8 Windows 2019, JDK11 Scritpler 3.5

Activity

  1. jenkins-infra-bot commented on Sep 21, 2022

    @jenkins-infra-bot
    Author
    ioannis:
    • Original comment link
    • Raw content of original comment:

      Very annoying an unexpected behavior! Fortunately there is an equally annoying workaround. Go to Script approval console. Somehow unapproved scriptlets code appears in the list and you can approve it there.

      The same thing happens when you try to run an approved scriptlet after you edit it in the script UI.

      Every small edit requires that you

      1. run the edited scriptlet (fake run: since unapproved, it will not run)
      2. approve it in Script Approval 
      3. run it with the edits

    Very annoying an unexpected behavior! Fortunately there is an equally annoying workaround.
    Go to Script approval console. Somehow unapproved scriptlets code appears in the list and you can approve it there.

    The same thing happens when you try to run an approved scriptlet after you edit it in the script UI.

    Every small edit requires that you

    1. run the edited scriptlet (fake run: since unapproved, it will not run)
    2. approve it in Script Approval 
    3. run it with the edits
  2. jenkins-infra-bot commented on Jul 11, 2023

    @jenkins-infra-bot
    Author
    mcfilat:
    • Original comment link
    • Raw content of original comment:

      I'm uploading approvedScriptHashes in SHA-1 format to the server using jcasc . I can literally watch in the "jcasc view page" how when the scriptler page is activated, the latter takes all the hashes and converts them to sha-512. The problem is that after that, not a single script is actually approved. All scripts have green checkmarks, but inside the launch window there is a notification that the administrator must approve the script. How to get around or fix this?

    I'm uploading approvedScriptHashes in SHA-1 format to the server using jcasc . I can literally watch in the "jcasc view page" how when the scriptler page is activated, the latter takes all the hashes and converts them to sha-512. The problem is that after that, not a single script is actually approved. All scripts have green checkmarks, but inside the launch window there is a notification that the administrator must approve the script. How to get around or fix this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions