Synchronizing submodule url intermittently fails with “fatal: not a git repository” in CI

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Summary

Intermittently, checking out the submodules for our project in one of our CI jobs fails, with the following output:

Updating/initializing submodules...
Submodule 'subprojects/gvdb' (https://gitlab-ci-token:[MASKED]@gitlab.gnome.org/GNOME/gvdb.git) registered for path 'subprojects/gvdb'
Synchronizing submodule url for 'subprojects/gvdb'
fatal: not a git repository: subprojects/gvdb/../../.git/modules/subprojects/gvdb

Re-running that CI job succeeds. The problem happens maybe 1 in 10 CI runs, very roughly.

Relevant configuration:

Output from a successful submodule fetch:

Updating/initializing submodules with git depth set to 1...
Submodule 'subprojects/gvdb' (https://gitlab-ci-token:[MASKED]@gitlab.gnome.org/GNOME/gvdb.git) registered for path 'subprojects/gvdb'
Synchronizing submodule url for 'subprojects/gvdb'
Cloning into '/builds/GNOME/glib/subprojects/gvdb'...
Submodule path 'subprojects/gvdb': checked out '0854af0fdb6d527a8d1999835ac2c5059976c210'
Entering 'subprojects/gvdb'
Entering 'subprojects/gvdb'

Steps to reproduce

Since it’s an intermittent issue and I don’t fully understand what’s causing it, I’m afraid I can’t give reproducer instructions, sorry.

Example Project

https://gitlab.gnome.org/GNOME/glib/

Unfortunately it’s not on gitlab.com.

What is the current bug behavior?

Submodule fetch intermittently fails.

What is the expected correct behavior?

Submodule fetch works reliably.

Results of GitLab environment info

I don’t have immediate access to this, but can get specific information off our sysadmins if that would be helpful — just say what you need.

Results of GitLab application Check

Same

Edited by 🤖 GitLab Bot 🤖