0

Log:

client.go:14:2: reading gitlab.ts.gitlab.aws.de/ds/l2/clients/go.mod at revision clients/v1.0.1: git ls-remote -q origin in /go/pkg/mod/cache/vcs/ad4f553af57fde4fbbbf8d60479616afffd6533ec6a1e4523ec2c79b31b16845: exit status 128:
    remote: The project you were looking for could not be found or you don't have permission to view it.
    fatal: repository 'https://gitlab.ts.gitlab.aws.de/ds/l2.git/' not found

Locally I have no problems to load my private Go-Package:

require gitlab.ts.gitlab.aws.de/ds/l2/clients v1.0.1

But once I want to run tests in the GitLab Pipeline it starts to point to the wrong repository. This is the changes I have made in my gitlab-ci.yml:

  GOPRIVATE: gitlab.ts.gitlab.aws.de

test:
  image: golang:1.24
  stage: test
  before_script:
    - git config --global url."https://gitlab-ci-token:${PROJECT_ACCESS_TOKEN}@gitlab.ts.gitlab.aws.de/".insteadOf "https://gitlab.ts.gitlab.aws.de/"

I tried clearing the mod cache but somehow the runner tries to clone from https://gitlab.ts.gitlab.aws.de/ds/l2.git/, do you know why?

4
  • It looks like the go.mod inside your clients repo is declaring module gitlab.ts.gitlab.aws.de/ds/l2 instead of gitlab.ts.gitlab.aws.de/ds/l2/clients. That why Go drops the /clients part and tries to fetch from .../ds/l2.git. Locally it is working only because of cache. Fix by updating the module line in clients/go.mod to match the full import path (gitlab.ts.gitlab.aws.de/ds/l2/clients) and retagging, or use a replace directive in your root go.mod as a temporary workaround. Commented Sep 10 at 9:02
  • I alredy checked that, but thank you! :) This is the go.mod in the lib im trying to load: module gitlab.ts.gitlab.aws.de/ds/l2/clients go 1.24.1 Commented Sep 10 at 9:43
  • I also tagged it @KamranKhalid Commented Sep 10 at 9:48
  • i fixed it with a .netrc file Commented Sep 10 at 11:33

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.