1

I have a VS Code Salesforce project setup to connect to a sandbox.

This is a non-SFDX project.

When i retrieve the components using a manifest file, I am running into this error.

Starting SFDX: Retrieve Source from Org The encrypted data is not properly formatted. 

I am using VS Code functionality to, right click on the package.xml manifest file and retrieve the components'.

Please suggest if any solution for this.

This is happening only in one sandbox and i have two other sandboxes, where i don't see this error.

Update : I tried deleting all the contents of .sfdx folder in the VS Code project folder and tried to retrieve again, but this didn't work.

3
  • uninstall Salesforce CLI and re-install it. Commented Aug 10, 2022 at 1:28
  • 1
    I'm having the same problem and the only workaround I've found is that when I run the SFDX: Authorize an Org command again, complete the authentication, and then re-start VS Code it starts working again. But then by the next day same problem re-appears. The only thing I haven't tried yet is uninstalling/re-installing VS Code and all extensions. I have a feeling it's something broken within the Salesforce Extension Pack extension with how my Org Alias settings are saved to my User. Running Deploy/Retrieve commands from the Terminal always works, however, so the CLI appears to not be the issue Commented Aug 19, 2022 at 22:26
  • The sandbox with which I was facing this problem got refreshed and I reauthorized the org in VS Code and voila....the problem went away. I didn't have to delete the VS Code project or create a new one. Didn't have to uninstall/install CLI as well. I had reauthorized the sandbox org, many times before sandbox refresh & it never worked. Very curious as to, how it fixed itself... :| Please post if anyone knows. Thanks. Commented Sep 1, 2022 at 17:36

1 Answer 1

1

I had the same problem for weeks, and the steps below worked for me:

1) Completely uninstall the Salesforce Extension Pack VS Code extension

(to uninstall all sub-components of the package). 

2) Uninstall Salesforce CLI:

MacOS / Linux

Run these commands from Terminal

sudo rm -rf /usr/local/sfdx sudo rm -rf /usr/local/lib/sfdx sudo rm -rf /usr/local/bin/sfdx sudo rm -rf ~/.local/share/sfdx ~/.config/sfdx ~/.cache/sfdx sudo rm -rf ~/Library/Caches/sfdx sudo rm -rf /usr/local/sf sudo rm -rf /usr/local/bin/sf 
Windows
  1. Select Start > Control Panel > Programs > Programs and Features.

  2. Select SFDX CLI, and click Uninstall.

  3. Inside your home directory, delete these two directories:

    .config\sfdx .config\sf 

If the CLI is still installed, delete the %LOCALAPPDATA%\sfdx directory in Program Files.

More info- https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_uninstall.htm

3) Re-install Salesforce CLI

Follow the steps on this page depending on your OS. I use MacOS, and the steps for installing the .pkg file worked easiest for me.

4) Re-install the Salesforce Extension Pack VS Code extension

I installed the "Expanded" version version this time, and had previously used the original version, but this shouldn't matter.

5) Re-start VS Code

That should do the trick. I immediately was able to deploy/retrieve to various sandboxes without even having to Re-authorize the orgs, when before completing these steps I was experiencing the SFDX bug.

2
  • 1
    Thanks Sam Howle Commented Sep 1, 2022 at 17:34
  • @AsifK No problem! If this resolved your issue please accept the answer. Otherwise let me know if you have follow-up questions and I'll do my best to help. Commented Sep 7, 2022 at 0:10

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.