Hi Team,
I am facing a weird issue in the GitLab pipeline while executing a job. The job clones another repository and it is getting executed whenever I pass any CI_COMMIT_TAG to the commit. This job runs successfully only once and then get failed in the next consecutive runs.
I am using GitLab Enterprise Edition 16.3.0-pre 1e04d6b7fa9 (SAAS)
Below is my parent pipeline which is triggering another pipeline from another project (Parent-Child)
Let me explain step by step:
-
Whenever I Tag a commit a job gets triggered which will trigger a pipeline from another project.
-
This trigger pipeline performs a git clone operation under a job.
-
The clone operation sometimes get succeed and then get failed consecutively in the next iterations with an access denied error.
Note that the working token is saved in GitLab Variables and is being called every time.
Both Parent and Child Sample pipelines are shown below.
Parent Pipeline:
default:
tags:
- docker-runner
stages:
- echo
- trigger
echo:
stage: echo
rules:
- if: $CI_COMMIT_BRANCH && $CI_COMMIT_MESSAGE =~ /Test GKE/
image:
name: alpine:latest
script:
- echo "Testing Job"
trigger:
stage: trigger
rules:
- if: $CI_COMMIT_TAG
trigger:
include:
- project: 'pranav-group/app-manifests'
ref: 'main'
file: 'test-gitlab-ci.yml'
strategy: depend
test-gitlab-ci.yml:
.common_stage: &common
tags:
- gke-runner
workflow:
rules:
- if: $CI_PIPELINE_SOURCE == "parent_pipeline"
stages:
- stage1
- lint
stage1:
<<: *common
stage: stage1
image:
name: ubuntu:22.04
before_script:
- apt-get update -y && apt-get install git -y
script:
- |
git clone https://$GITLAB_USER:$GITLAB_PASSWORD@gitlab.com/pranav-group/tf-deployment-demo.git
ls -al
allow_failure: true
Success output
Error Ouput:
Troubleshooting steps tried:
- I have tried the same pipeline with Kubernetes Runner as well as Docker Runner.
- Also for cloning the git repository I used both GitLab tokens as well as ssh-key method to perform the same steps but the results were the same.
- I have tried the same pipelines on self-hosted GitLab as well but no luck.
Kindly help in this issue and consider this as a bug may be.