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 · 14 comments
Closed

Salesforce CLI Local Git Repository Corruption #2483

bjconover opened this issue Sep 21, 2023 · 14 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.

@lucabezerra
Copy link

  • CLI: @salesforce/cli/2.57.7 darwin-arm64 node-v20.16.0
  • VSCode's Salesforce CLI Integration plugin: v61.12.0
  • MacOS Sonoma 14.5
  • VSCode v1.93.0

I was getting the following error all the time when trying to "SFDX: Deploy This Source to Org" or "SFDX: Retrieve This Source from Org":

An internal error caused this command to fail. isomorphic-git error:
Index file is empty (.git/index)

After deleting the file suggested by the OP, the commands started working again. Is the error back?

Copy link

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

Shared: 2.7.11
Latest: 2.57.7

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

@nileshndethe
Copy link

nileshndethe commented Oct 4, 2024

I am facing similar issue when trying to retrieve the metadata using package.xml (using right click retrieve metadata from org option) even after updating the SF CLI to latest version i.e. 2.60

Error details: Metadata API request failed: An internal error caused this command to fail. isomorphic-git error:
Invalid checksum in GitIndex buffer: expected 169525ad9d6cc253f93b56a90051666f7263652d but saw 023e48b5e7966dd73e6fa09121ab74b7c1eb366f

here is the details of the "sf version --verbose --json"
{
"architecture": "win32-x64",
"cliVersion": "@salesforce/cli/2.60.13",
"nodeVersion": "node-v20.17.0",
"osVersion": "Windows_NT 10.0.22631",
"rootPath": "AppData\Local\sf\client\2.60.13-0cbb3a0",
"shell": "powershell",
"pluginVersions": [
"@ind-rcg/modeler-sfdx-cli-plugin 250.1019.0 (user) published 99 days ago (Thu Jun 27 2024)",
"@oclif/plugin-autocomplete 3.2.4 (core)",
"@oclif/plugin-commands 4.0.15 (core)",
"@oclif/plugin-help 6.2.12 (core)",
"@oclif/plugin-not-found 3.2.21 (core)",
"@oclif/plugin-plugins 5.4.9 (core)",
"@oclif/plugin-search 1.2.9 (core)",
"@oclif/plugin-update 4.5.9 (core)",
"@oclif/plugin-version 2.2.13 (core)",
"@oclif/plugin-warn-if-update-available 3.1.17 (core)",
"@oclif/plugin-which 3.2.14 (core)",
"@salesforce/cli 2.60.13 (core)",
"apex 3.4.10 (core)",
"api 1.2.2 (core)",
"auth 3.6.62 (core)",
"community 3.2.32 (user) published 20 days ago (Sat Sep 14 2024) (latest is 3.2.33)",
"data 3.6.7 (core)",
"deploy-retrieve 3.12.11 (core)",
"info 3.4.9 (core)",
"limits 3.3.32 (core)",
"marketplace 1.2.26 (core)",
"org 4.5.10 (core)",
"packaging 2.8.7 (core)",
"schema 3.3.32 (core)",
"settings 2.3.21 (core)",
"sobject 1.4.38 (core)",
"source 3.5.21 (core)",
"telemetry 3.6.15 (core)",
"templates 56.3.21 (core)",
"trust 3.7.31 (core)",
"user 3.5.31 (core)"
]
}

what should be done to resolve this issue?

Copy link

github-actions bot commented Oct 4, 2024

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

Shared: 2.7.11
Latest: 2.60.13

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

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

6 participants