Abdeali Chandanwala
Abdeali Chandanwala

Reputation: 8828

error: cannot open .git/FETCH_HEAD: Bad message

On searching the internet I am getting solutions for error: cannot open .git/FETCH_HEAD: permissions denied. but in my case that does not seems to be the issue at all.

My error message is also different and when for the specific error message I find no results at all. Nevertheless I am using bit-bucket and have recently updated my Linux OS 20 focal

The error Message is

error: cannot open .git/FETCH_HEAD: Bad message

Can anyone help me out here.

Upvotes: 2

Views: 608

Answers (2)

Abdeali Chandanwala
Abdeali Chandanwala

Reputation: 8828

After spending some time, I deleted the project folder and did git clone once again.

Had to take the code backup done in recent commits. :(

Even if the file getting corrupted was the case - I am sure this will solve the problem but try this as last resort if possible.

Upvotes: 0

torek
torek

Reputation: 488453

The Bad message error occurs when an attempt to open a file fails with a system EBADMSG error. Most stock Linux file systems do not do that, but various add-ons may do so. For instance, the UBI file system appears to return this error for certain flash failures (see Reason for ubi filesystem corruption).

I have not been able to verify this, but it looks like some distributed file systems (such as Dropbox) might also produce such an error in some cases. The EncFS port also appears to produce such errors: see https://github.com/billziss-gh/winfsp/issues/156 for instance.

If these are the source of the error, your best bet is to use a more reliable file system and/or more reliable underlying hardware, probably.

Upvotes: 4

Related Questions