Manual CI job not allow to be triggered with "You are not authorized to run this manual job" message

Can not run manual CI job

I have CI pipeline with multiple jobs. Once all the automatic jobs are finished there are some manual jobs that can be triggered.

These are rough steps contained in our pipeline:

  • Lint
  • Build
  • Pack
  • Store
  • Deploy (manual)

The issue that I am facing is with manual CI job Deploy. Sometimes the job cannot be triggered, the play button is greyed out and “You are not authorized to run this manual job” tooltip message is shown on hover.

I do not have any Protected environments set. User that is trying to trigger the job has all permissions (administrator).

This is a bit simplified version of the job:

  stage: deploy
    - if: '$CI_COMMIT_BRANCH == "develop" || $CI_COMMIT_BRANCH == "release" || $CI_COMMIT_BRANCH == "master" || $CI_PIPELINE_SOURCE == "merge_request_event"'
      when: manual
      allow_failure: true
    - when: never
  needs: ["JobA"]
    - .\upgrade.ps1 'C:\some\path' 'someParameter'
    name: qa/Server1
    - QAServer1

Why am I getting “You are not authorized to run this manual job”?

One reason might be that the job is obsolete, as explained here: Deployment safety | GitLab
The behavior has changed in version 15.5, it was improved but as a consequence this error started to appear in some of our pipelines where we have multiple deployments to the same environment

This is really bad UI and provides very little on what the issues it. I’m finding this error on builds that have completed most recently (i.e. the latest builds) but on different branches. Essentially our deploy can no longer be managed manually. Is there any workaround to this?

1 Like

We had the same issue. We had a problem with outdated deployments.
You can simply set it up under Settings > CI/CD > General Pipelines.
Unselect the “Prevent outdated deployment jobs” box.