Closed k-capehart closed 1 month ago
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.
I have also been encountering this error and for me it subsides after I force quit VS Code and start it back up again. I'm not 100% what's been causing it though.
I have also been encountering this error and for me it subsides after I force quit VS Code and start it back up again. I'm not 100% what's been causing it though.
That doesn't seem to work for me. After restarting everything, I still get the error. 🤔
@k-capehart Interesting - I've never seen that one before. Can you provide the debug logs using theJSFORCE_LOG_LEVEL=DEBUG
env var and the --dev-debug
flag?
@mdonnalley Sure thing, here's what I got
@k-capehart Thanks! Can you give sf project delete tracking
a try?
@mdonnalley That seemed to work! I was able to successfully deploy and retrieve without seeing the error, although I ran it twice before it seemed to make a difference.
What's the root cause?
@k-capehart It's not my area of expertise but, as I understand it, the local source tracking information can enter a bad state , which could be for a variety of reasons. So in those cases, it's easiest to delete it all so that we can start tracking source again in a clean state.
Glad that you're up and running again - I'm going to close this issue if that's okay with you.
Thanks for your help! I'll keep that in mind if I come across a similar issue.
@k-capehart - Older versions of the deprecated plugin-source commands (e.g. force:source:deploy) used a different system for local source tracking. The newer commands use a library called, isomorphic-git. When switching between very old plugin-source commands and the new commands you might see issues with local source tracking so the recommendation is to delete the old tracking files and start fresh. It's possible to get into bad states in other ways but much less likely. Using the new plugin-deploy-retrieve plugin commands is the way to go.
Summary
I'm getting the following error whenever I try to deploy or retrieve in a developer sandbox:
Metadata API request failed: Could not find HEAD.
I get this error when:
sf project deploy start
andsf project retrieve start
SFDX: Deploy this Source to Org
andSFDX: Retrieve this Source From Org
using the Salesforce extension packI DO NOT get this error when:
sfdx force:source:deploy -p force-app/main/default
sf project deploy preview
andsf project retrieve preview
Strangely, even though this error appears consistently, the operation still finishes. I can still see my components deployed to my org after running the commands, even though there is an error.
Steps To Reproduce
I've only been able to reproduce this in the sandbox provided to me by my team. It is a Developer Sandbox made from an Enterprise Edition org, with Source Tracking enabled.
Expected result
The deployment should finish without errors.
Actual result
I get the error:
Metadata API request failed: Could not find HEAD.
Additional information
System Information