16

Operating system: Linux

git version: 2.26.2

Git repo provider of my repo: gitlab

Repo provider of the failing submodules: Github

.gitmodules

[submodule "libraries/stb"]
    path = libraries/stb
    url = https://github.com/nothings/stb.git
    branch = master
[submodule "libraries/harfbuzz"]
    path = libraries/harfbuzz
    url = https://github.com/harfbuzz/harfbuzz.git
    branch = master
[submodule "libraries/shaderc"]
    path = libraries/shaderc
    url = https://github.com/google/shaderc.git
    branch = master
[submodule "libraries/freetype2"]
    path = libraries/freetype2
    url = https://github.com/aseprite/freetype2.git
    branch = master
[submodule "libraries/VulkanMemoryAllocator"]
    path = libraries/VulkanMemoryAllocator
    url = https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator.git
    branch = master
[submodule "libraries/googletest"]
    path = libraries/googletest
    url = https://github.com/google/googletest.git
    branch = master
[submodule "libraries/Eigen"]
    path = libraries/Eigen
    url = https://gitlab.com/libeigen/eigen.git
    branch = master
[submodule "libraries/benchmark"]
    path = libraries/benchmark
    url = https://github.com/google/benchmark.git
[submodule "libraries/rapidcheck"]
    path = libraries/rapidcheck
    url = https://github.com/emil-e/rapidcheck.git
    branch = master
[submodule "libraries/magic_get"]
    path = libraries/magic_get
    url = https://github.com/apolukhin/magic_get.git
    branch = master

command and output:

git pull --recurse-submodules=true

Fetching submodule libraries/Eigen
Fetching submodule libraries/VulkanMemoryAllocator
Fetching submodule libraries/benchmark
Fetching submodule libraries/freetype2
Fetching submodule libraries/googletest
Fetching submodule libraries/harfbuzz
Could not access submodule 'libraries/magic_get'
Could not access submodule 'libraries/rapidcheck'
Could not access submodule 'libraries/shaderc'
Could not access submodule 'libraries/stb'

git submodule status:

git submodule status 
 a145e4adf5e71391d64c0ab150a8c26851cf332d libraries/Eigen (before-git-migration-159-ga145e4adf)
 755fd47121ce0c77ef11818e4987790ae99c2eba libraries/VulkanMemoryAllocator (v2.1.0-334-g755fd47)
 d3ad0b9d11c190cb58de5fb17c3555def61fdc96 libraries/benchmark (v1.5.0-56-gd3ad0b9)
 fbbcf50367403a6316a013b51690071198962920 libraries/freetype2 (VER-2-10-0)
 dcc92d0ab6c4ce022162a23566d44f673251eee4 libraries/googletest (release-1.8.0-2331-gdcc92d0a)
 89ad3c6cc520517af15174391a9725e634929107 libraries/harfbuzz (2.6.5-71-g89ad3c6c)

git tree

git ls-tree -r HEAD
160000 commit a145e4adf5e71391d64c0ab150a8c26851cf332d  Eigen
160000 commit 755fd47121ce0c77ef11818e4987790ae99c2eba  VulkanMemoryAllocator
160000 commit d3ad0b9d11c190cb58de5fb17c3555def61fdc96  benchmark
160000 commit fbbcf50367403a6316a013b51690071198962920  freetype2
160000 commit dcc92d0ab6c4ce022162a23566d44f673251eee4  googletest
160000 commit 89ad3c6cc520517af15174391a9725e634929107  harfbuzz
160000 commit 762a4ec1f4458a84bc19cd6efc1e993add90ec95  libigl
160000 commit 03afd0b83ce67062a105cfcbe80bbca152743f0a  magic_get
160000 commit 7bc7d302191a4f3d0bf005692677126136e02f60  rapidcheck
160000 commit 011139094ec790ff7f32ea2d80286255fc9ed18b  shaderc
160000 commit b42009b3b9d4ca35bc703f5310eedc74f584be58  stb

This used to work about 6 months ago

Makogan
  • 8,208
  • 7
  • 44
  • 112
  • Has anything changed with the repos that you failed to fetch? Maybe their URL? Maybe the branch master doesn't exist anymore? – SpiderPig1297 Oct 04 '20 at 09:25
  • Not to my knowledge. All of those are fairly popular libraries and maintained by large organizations. I would be shocked if they were to break dependencies nily willy – Makogan Oct 04 '20 at 16:00

1 Answers1

31

Just in case, make sure all submodules are initialized:

git submodule update --init --recursive

Then, try the pull --recurse-submodules=true again.

Somehow, activating the traces improve the situation:

git -c trace2.eventTarget=1 pull --recurse-submodules=true
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • 1
    Error persists after trying this method – Makogan Oct 04 '20 at 16:01
  • @Makogan Can you check which SHA1 is referenced by the missing submodules (`git submodule status` or see https://stackoverflow.com/q/20655073/6309)? The goal is to check if that reference does exist in the remote repository. – VonC Oct 04 '20 at 20:57
  • Ran the command, the requested submodules don;t seem to show up on the list – Makogan Oct 04 '20 at 21:32
  • @Makogan And `cd libraries` plus `git ls-tree -r HEAD`? Would you see any entry for those submodules? – VonC Oct 04 '20 at 21:34
  • They did appear when I rant that command under libraries – Makogan Oct 04 '20 at 21:46
  • @Makogan OK. Strange. for example: https://github.com/apolukhin/magic_get/commit/03afd0b83ce67062a105cfcbe80bbca152743f0a does exist, which means the repo does record an existing SHA. – VonC Oct 04 '20 at 21:51
  • @Makogan Activating trace2 (https://stackoverflow.com/a/56094711/6309, https://git-scm.com/docs/git-config#Documentation/git-config.txt-tarumask) should display more clues: `git -c trace2.eventTarget=1 pull --recurse-submodules=true` – VonC Oct 04 '20 at 21:56
  • @Makogan Also, for testing, try SSH instead of HTTPS for those GitHub URL: https://stackoverflow.com/a/31185110/6309 `git config "url.git@github.com:.insteadOf" https://github.com/` (assuming you have a working SSH key, already registered to your GitHub account) – VonC Oct 04 '20 at 21:58
  • 1
    The command seems to have worked, it pulled all the submodules i.e. the one with event target – Makogan Oct 04 '20 at 21:59
  • 1
    @Makogan The `git -c trace2.eventTarget=1 pull --recurse-submodules=true`? – VonC Oct 04 '20 at 21:59
  • 1
    @Makogan Strange! I have edited the answer accordingly. – VonC Oct 04 '20 at 22:00
  • I came here with the same problem. "git -c trace2.eventTarget=1 pull" removes the "Could not access submodule" error when trying to git pull the following repository: https://github.com/google/skywater-pdk - cloning is done from a Makefile in https://github.com/efabless/caravel-lite/blob/main/Makefile ("make pdk") which does not initialize all submodules on purpose, as not all are actually needed. This leads to the said error with git 2.25.1, though when not using "-c trace2.eventTarget=1". – DCTLib Dec 14 '21 at 13:24
  • @DCTLib Interesting. I wonder if the issue would persist with a more recent Git (2.34.1). – VonC Dec 14 '21 at 13:31
  • I had the same issue (Git 2.37) and I needed to remove the subdirectory first before the `--init` worked again. – Ray Oei Nov 21 '22 at 12:51
  • @RayOei Good point. If that subdirectory existed before the first update, it could indeed prevent the submodule initialization. – VonC Nov 21 '22 at 15:17