Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to solve 'error: add_cacheinfo failed to refresh for path' when merging at a project containing a submodule

I have a project with a submodule. When trying to merge a branch (named release) into master, git identified some conflicts and raised the following error:

Fast-forwarding submodule path/to/submodule
Auto-merging path/to/submodule
error: add_cacheinfo failed to refresh for path 'path/to/submodule'; merge aborting.

It completely stopped the merge, as no evidence of it is shown with git status, although I can see some files from the branch release. If I run git merge --abort it also complains with:

fatal: There is no merge to abort (MERGE_HEAD missing).
like image 870
rjmAmaro Avatar asked Jul 23 '20 14:07

rjmAmaro


People also ask

How to fix add_cacheinfo failed to refresh for path?

error: add_cacheinfo failed to refresh for path 'a/b/c'; merge aborting. To fix this, first clean the leftovers of the aborted merge from the working directory with git stash && git clean -fd Then, checkout the offending file(s) and commit them to the target branch before the merge:

Why does Git add_cacheinfo failed for path?

1 add_cacheinfo failed for path ...is an internal error and should not occur. Either something inside Git is broken, or something inside your computer itself is broken / failing. If the problem persists on a different computer, that would suggest it's a bug in whatever version of Git you're using; you could try using a different version of Git.

What causes backend to fetch failed error?

If this happens, the website data gets piled up in the cache server memory, which causes a backend to fetch failed error. If a website’s server you are trying to reach is undergoing routine or temporary maintenance, it can cause a backend to fetch failed error.

Why am I getting an Error 503 backend fetch failed?

It happens because your request gets queued up. If you have activated an ad-blocker on your browser, it prevents ad content from being displayed on the screen. If you try to do so, an error 503 backend fetch failed message will be displayed on your screen.


1 Answers

First I had to reset my branch master with:

git reset --hard origin/master

and delete any files that stayed from the aborted merge (files that came from the release).

After, I updated the submodule to the latest version in both branches, with:

git submodule update --recursive --remote

After that I was able to run the merge without further problems with add_cacheinfo.

like image 120
rjmAmaro Avatar answered Sep 18 '22 20:09

rjmAmaro