Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gitlab runner has not acces to submodule

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' ([email protected]: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 '[email protected]: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 '[email protected]:user/hfdg.git' into submodule path 'C:/gitlab-runner/builds/765197b3/0/user/ttttttt/hfdg' failed
Failed to clone 'hfdg' a second time, aborting
like image 697
Luca Avatar asked Aug 03 '26 16:08

Luca


1 Answers

Another good reason for that is Allow access to this project with a CI_JOB_TOKEN settings in submodule project. So take a look into: Settings > CI/CD > Token Access

like image 173
prog76 Avatar answered Aug 07 '26 19:08

prog76



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!