Using $CI_JOB_TOKEN Gives 404 Error On Triggering Pipelines

Viewed 479
2 Answers

Could you please make sure the ref=master is correct? Recently master was changed to main your API call might be hitting a non-existent branch hence 404

Check also your GitLab version:

With GitLab 14.1 (July 2021), you have:

Default branch name redirect

Default branch name redirect

As part of the larger effort to rename Git’s default initial branch in a GitLab project from master to main, we are adding an automatic redirect to streamline the transition. Previously, when projects renamed the default branch, current URLs would result in 404 Not Found. This is a frustrating experience when you are trying to navigate between branches. Now, if you navigate to a file or directory path whose default branch was renamed, you will be redirected to the updated path automatically.

See Documentation and Issue.

So your problem might not exist with 14.1.

Related