Warm tip: This article is reproduced from stackoverflow.com, please click

Gitlab runner has not acces to submodule

发布于 2020-03-27 15:41:33

I create a new Project with a Submodule and want to run a gitlab-ci.yml. But every time the runner tells me he has no access or cant find the project. The runner is an shared runner on a windows 10 system (required). It works for older projects but not for new projects.

Have you some ideas what i do wrong?

What i already do:

  • test on another runner
  • use fetch and clone for runner
  • run manualy git clone --recursive git@gitlab.... on the runner VM
  • clone repo recursive on my current pc and it worked!
  • The first answer

CI-Script:

stages:
  - build

variables:
  ARTIFACTS_OUTPUT_PATH: "./builds"
  GIT_SUBMODULE_STRATEGY: recursive

test_123:
    stage: build
    only:
        - tags
        - triggers
        - schedules
        - web
    script: 
        - some commands

    artifacts:
        paths:
          - ./builds/*
    tags:
        - windows

The error:

<!-- language: lang-sh -->
Cloning into 'C:/gitlab-runner/builds/765197b3/0/user/ttttttt'...
Submodule 'hfdg' (git@gitlab.XXXXXXXX:user/hfdg.git) registered for path 'hfdg'
Cloning into 'C:/gitlab-runner/builds/765197b3/0/user/ttttttt/hfdg'...
remote: 
remote: ========================================================================
remote: 
remote: The project you were looking for could not be found.
remote: 
remote: ========================================================================
remote: 
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
fatal: clone of 'git@gitlab.XXXXXXXX:user/hfdg.git' into submodule path 'C:/gitlab-runner/builds/765197b3/0/user/ttttttt/hfdg' failed
Failed to clone 'hfdg'. Retry scheduled
Cloning into 'C:/gitlab-runner/builds/765197b3/0/user/ttttttt/hfdg'...
remote: 
remote: ========================================================================
remote: 
remote: The project you were looking for could not be found.
remote: 
remote: ========================================================================
remote: 
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
fatal: clone of 'git@gitlab.XXXXXXXX:user/hfdg.git' into submodule path 'C:/gitlab-runner/builds/765197b3/0/user/ttttttt/hfdg' failed
Failed to clone 'hfdg' a second time, aborting
Questioner
Luca
Viewed
54
Luca 2020-02-10 05:16

The problem was that the gitlab-runner wasn't assignt to subrepo. So the Runner hast no acces to the subrepo.