jlengstorf / netlify-plugin-gatsby-cache

185 stars 21 forks source link

Caused "Error fetching branch" #56

Closed LukeShu closed 3 years ago

LukeShu commented 3 years ago

We encountered an issue where when using the cache, Netlify would have an "Error fetching branch" during the "preparing repo" stage:

10:26:50 AM: Starting to prepare the repo for build
10:26:51 AM: Preparing Git Reference refs/heads/master
10:27:00 AM: Error fetching branch: https://github.com/datawire/getambassador.io refs/heads/master
10:27:00 AM: Creating deploy upload records
10:27:00 AM: Failing build: Failed to prepare repo
10:27:00 AM: Failed during stage 'preparing repo': exit status 1

The error first appeared seemingly spontaneously on multiple branches with unrelated changes. This error did not happen when doing a "Clear cache and deploy site", but the error would immediately return for the next cache-using deploy. We eventually resolved the issue by uninstalling then re-installing the "Gatsby cache" plugin, which seems to indite the plugin, though looking at the source of the plugin I'm flabbergasted at how this is possible.

There is a thread on the support forum with some more info: https://answers.netlify.com/t/cache-builds-fail-during-preparing-repo-step-error-fetching-branch/38856/

Perry has suggested that the package.json might be useful for tracking down the issue. I've also included the .gitmodules file, since that's the only other file that I would think might affect "Error fetching branch":

khussey commented 3 years ago

We are once again encountering the error with the plugin installed, even after having removed submodules from our repository.

jlengstorf commented 3 years ago

hey, folks — this plugin is being replaced by official Netlify Gatsby support. can you please try the official plugin (https://github.com/netlify/netlify-plugin-gatsby) and see if it clears up the issue? if not, the team maintaining that plugin can help you dig in further. thank you!