Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Salesforce CLI Local Git Repository Corruption #2483

Closed
bjconover opened this issue Sep 21, 2023 · 10 comments
Closed

Salesforce CLI Local Git Repository Corruption #2483

bjconover opened this issue Sep 21, 2023 · 10 comments
Labels
more information required Issue requires more information or a response from the customer

Comments

@bjconover
Copy link

This has been an issue for the past couple of Salesforce CLI updates, but occasionally when you go to deploy an update to your org you will receive the following error or something similar:

An internal error caused this command to fail. Please file a bug report at https://github.com/isomorphic-git/isomorphic-git/issues with this error message: Invalid checksum in GitIndex buffer: expected 746e672f6173736574732f69636f6e732f737461 but saw 83e736f3a0e62161efb4e92134ffe7e8e7cafa9e

I found that when you rename a file or create a new file it can cause this system to get into this state.

To fix the issue, you need to go to the .sf\orgs(Org Id)\localSourceTracking directory and delete the index file that is populated. Once that is done when you deploy\retrieve files again the index file will be regenerated and the issue will be resolved.

I have fixed this issue several times, but it keeps popping back up again from time to time and I have to repeat the steps I listed up above to fix it.

@bjconover bjconover added the investigating We're actively investigating this issue label Sep 21, 2023
@github-actions
Copy link

Hello @bjconover 👋 It looks like you didn't include the full Salesforce CLI version information in your issue.
Please provide the output of version --verbose --json for the CLI you're using (sf or sfdx).

A few more things to check:

  • Make sure you've provided detailed steps to reproduce your issue.
    • A repository that clearly demonstrates the bug is ideal.
  • Make sure you've installed the latest version of Salesforce CLI. (docs)
    • Better yet, try the rc or nightly versions. (docs)
  • Try running the doctor command to diagnose common issues.
  • Search GitHub for existing related issues.

Thank you!

@github-actions github-actions bot added more information required Issue requires more information or a response from the customer and removed investigating We're actively investigating this issue labels Sep 21, 2023
@github-actions
Copy link

Thank you for filing this issue. We appreciate your feedback and will review the issue as soon as possible. Remember, however, that GitHub isn't a mechanism for receiving support under any agreement or SLA. If you require immediate assistance, contact Salesforce Customer Support.

@bjconover
Copy link
Author

{
"cliVersion": "@salesforce/cli/2.7.11",
"architecture": "win32-x64",
"nodeVersion": "node-v18.14.2",
"osVersion": "Windows_NT 10.0.19044",
"shell": "cmd.exe",
"rootPath": "C:\Users\bconover\AppData\Roaming\npm\node_modules\@salesforce\cli",
"pluginVersions": [
"@oclif/plugin-autocomplete 2.3.6 (core)",
"@oclif/plugin-commands 2.2.24 (core)",
"@oclif/plugin-help 5.2.18 (core)",
"@oclif/plugin-not-found 2.4.0 (core)",
"@oclif/plugin-plugins 3.3.2 (core)",
"@oclif/plugin-search 0.0.22 (core)",
"@oclif/plugin-update 3.2.0 (core)",
"@oclif/plugin-version 1.3.9 (core)",
"@oclif/plugin-warn-if-update-available 2.0.49 (core)",
"@oclif/plugin-which 2.2.32 (core)",
"@salesforce/cli 2.7.11 (core)",
"apex 2.3.12 (core)",
"auth 2.8.14 (core)",
"data 2.5.7 (core)",
"deploy-retrieve 1.17.6 (core)",
"info 2.6.40 (core)",
"limits 2.3.32 (core)",
"login 1.2.28 (core)",
"marketplace 0.1.1 (core)",
"org 2.10.5 (core)",
"schema 2.3.24 (core)",
"settings 1.4.27 (core)",
"sobject 0.2.6 (core)",
"source 2.10.32 (core)",
"telemetry 2.3.1 (core)",
"templates 55.5.10 (core)",
"trust 2.6.7 (core)",
"user 2.3.31 (core)"
]
}

@mdonnalley
Copy link
Contributor

I found that when you rename a file or create a new file it can cause this system to get into this state.

@bjconover does this occur every time that you rename or create a file? Have you noticed if it's a specific metadata type that triggers the issue?

If you're able to provide replication steps that would be a huge help. Thanks!

@github-actions
Copy link

Hello @bjconover 👋 None of the versions of sf you shared match the latest release.

Shared: 2.7.11
Latest: 2.9.8

Update to the latest version of Salesforce CLI (docs) and confirm that you're still seeing your issue.
You can also try the rc and nightly releases! (docs)

After updating, share the full output of sf version --verbose --json

@ImJohnMDaniel
Copy link

FWIW, I have been seeing this occur more and more frequently over the past few weeks. I have other developers seeing the same thing. Deleting the source tracking folder does help sometimes.

@bjconover
Copy link
Author

FWIW, I have been seeing this occur more and more frequently over the past few weeks. I have other developers seeing the same thing. Deleting the source tracking folder does help sometimes.

If you just rename the index file in the local source tracking that will fix the issue too. The system will generate a new index file and that will let you start making deployments again.

@bjconover
Copy link
Author

bjconover commented Sep 22, 2023

I found that when you rename a file or create a new file it can cause this system to get into this state.

@bjconover does this occur every time that you rename or create a file? Have you noticed if it's a specific metadata type that triggers the issue?

If you're able to provide replication steps that would be a huge help. Thanks!

The problem is intermittent, but I've had it happen on several occasions right after I renamed a LWC. But I've also had it happen when I make a code change and go to deploy it. I mentioned that I was having this issue to one of the consultants that was manning the Salesforce CLI station at Dreamforce 2023 on Tuesday, and he said he ran into the same issue and was able to fix it by deleting the index file. This is the fifth or six time this has happened to me over the past couple of CLI versions.

Here are a couple of other related errors I have gotten:
I have had it mention that the index file was empty. (Index file is empty (.git/index))

I've also seen it mention that the magic number is invalid. (Invalid dircache magic file number)

@github-actions
Copy link

This issue has not received a response in 7 days. It will auto-close in 7 days unless a response is posted.

@iowillhoit
Copy link
Contributor

We believe that this issue has been resolved. Please make sure you are using the latest version of sf (currently 2.11.8) and the latest version of the Salesforce VSCode extension. If you are still having issues, please open a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
more information required Issue requires more information or a response from the customer
Projects
None yet
Development

No branches or pull requests

4 participants