Git clone failing - probably due to submodules

wai-website.netlify.app uses quite a few submodules and the default checkout during triggered deploy often fails. A manual delete cache and deploy does work. Local Builds when I init the submodules never show that error.

4:48:01 PM: Preparing Git Reference refs/heads/master
4:48:04 PM: Error fetching branch: https://x-access-token:v1.7e36a794c35c4666191b58213c07c012f034b1a4@github.com/w3c/wai-website refs/heads

An example is Netlify App

To init the modules in a local build I submodule init and submodule update --remote

The default Netlify build git clone is obviously doing something like --recursive as the submodules are processed. But I have no visibility into that. And I can see no way to alter the clone options used

In addition, the actual options I would like to use to init and update all the submodules is only available in new git versions of clone.

So I’m guess I could be successful here if I can disable the default git clones broken submodule handling and add an git submodule update --init -remote to the build commend

One thought is that this build is not the only thing that might update the submodules. Another process runs occasionally. Could this cause a clash with the Netlify build caching? If so how to stop it?

Hi, @slim, the first thing I would is to “relink” the repository to the site here:

https://app.netlify.com/sites/wai-website/settings/general#site-information

If that doesn’t resolve the issue, please let us know. The “re-linking” instructions are just the change repo instructions but then re-linking the same repo instead of a different one. Those instructions can be found here:

https://docs.netlify.com/configure-builds/repo-permissions-linking/#change-linked-repository

1 Like

Thanks @luke I’ll give it a go. I’ve been relinking other repos when the GitHub PR integration has stopped working.

@luke that did the trick - I had to clear cache and deploy first but subsequent plain deploy builds work. Thanks