We have a common Group called Shared under which we have three repos:

:hugs: Please help fill in this template with all the details to help others help you more efficiently. Use formatting blocks for code, config, logs and ensure to remove sensitive data.

Problem to solve

We have a group called Shared and three repos:
A - Terraform code: it contains a curl command where it needs to fetch jar file and python zip file from package registry of other projects. Gitlab ci yaml file refers to B repo

B - Terraform actual gitlab pipeline code runs here

C- This is java repo where it has jar file in package registry which needs to downloaded to A repo

D - This contains Python zip file in package registry which needs to downloaded to A repo

In A repo im using Curl command along with JOB_TOKEN: CI_JOB_TOKEN and mentioned the respective project IDs to fetch the jar and zip files from repo C and repo D.

But in terraform apply, i get 401 unauthorized with error message “curl: (22) The requested URL returned error: 401”

Note: CI JOB TOKEN has been provided with required access to do cross repo fetching of files.

Please let me know how to resolve this issue

Steps to reproduce

Which troubleshooting steps have you already taken? Can you link to any docs or other resources so we know where you have been?

Configuration

Add the CI/CD configuration from .gitlab-ci.yml and other configuration if relevant (e.g. docker-compose.yml). Alternatively, create a public GitLab.com example project that provides all necessary files to reproduce the question.

Versions

Please select whether options apply, and add the version information.

  • Self-managed
  • GitLab.com SaaS
  • Dedicated
  • Self-hosted Runners

Versions

  • GitLab (Web: /help or self-managed system information sudo gitlab-rake gitlab:env:info):
  • GitLab Runner, if self-hosted (Web /admin/runners or CLI gitlab-runner --version):

Helpful resources

  1. Check the FAQ for helpful documentation, issues/bugs/feature proposals, and troubleshooting tips.
  2. Before opening a new topic, make sure to search for keywords in the forum search
  3. Check the GitLab and GitLab Runner projects for existing issues. If you encounter a bug, please create a bug report issue.
  4. Review existing troubleshooting docs.

Thanks for taking the time to be thorough in your request, it really helps! :blush: