2

I am getting this when I retrieve code from my Org. I was able to authorize an org successfully, but when I go to the Org Browser and try to pull in data of a custom object that is when I get this error SFDX: Retrieve Source from Org failed to run

I saw a post suggesting to reinstall Salesforce CLI, I tried that it didn't work for me.

Please advice, I am behind on my work because of this.

This is what I see on my terminal when I right click and run retrieve from org enter image description here

2
  • Could someone help me here, I am loosing a lot of time with this error.
    – sumchans
    Apr 26, 2021 at 21:55
  • Is this is a known issue? It was working for me till Friday.
    – sumchans
    Apr 27, 2021 at 2:49

6 Answers 6

3

If anybody experiences this issue, the workaround would be to turn off Experimental Deploy Retrieve on settings under User and workspace. enter image description here

1

This happened to me when I refreshed a sandbox and tried to retrieve the sources from the org.

Before refreshing the sandbox, I had no errors at all. After refreshing, I was unable to get anything done. I reconnected with the org several times, I tried deleting sources in Visual Studio, I tried to retrieve at several levels (package.xml, directories, ...). It all led to the same not very helpful error.

Then I restarted Visual Studio. It had some error about the extension host, I restarted it. And only then was I able to retrieve the sources from the org.

1
  • I read comments saying the latest update to CLI broke it and the only workaround was to turn that experimental feature off. It took me a whole day to figure out what was actually going on, and with the workaround applied, it worked all of a sudden.
    – sumchans
    Apr 29, 2021 at 16:04
1

Under the manifest folder, you will see package.xml file. Right click on it and choose 'SFDX: Retrieve Source in manifest from Org'. IT will run successfully without a fail. IT worked for me.

2
  • The presence of a package.xml file is not a given (sfdx force:project:create does not create one for you unless you specify -x/--manifest). The question itself doesn't mention a manifest file either (the "org browser" is being used), so this isn't a really good fit/solution for this particular question.
    – Derek F
    Dec 28, 2022 at 19:28
  • This worked for me, thanks! Sep 22, 2023 at 20:20
0

Check to make sure your versions match your org version API version in VisualStudio.

  1. Open - https://.my.salesforce.com/services/wsdl/metadata
  • The header comment will show your API version:
  • Salesforce.com Metadata API version ##.0
  1. In Visual Studio check the following file values -
  • sfdx-project.json and check sourceApiVersion value.
  • Package.xml check ##.#

You may need to restart VisualStudio after making these changes. Additionally, I've had to go to CLI and revert to a prior version. Most recently I had to revert from 56.5.1 to 55.4.1. To change the CLI version go to Extension VS code >> Search for Salesforce CLI Integration >> near Uninstall button there is a drop-down >> Install another version.

1
  • 1
    Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
    – Community Bot
    Nov 22, 2022 at 7:17
0

I had an issue with this as well and the solution ended up being simple, I had selected too many items to pull from my Org. I cleaned up my package.xml by only selecting what I needed (classes, flows, etc.) and the pull finished successfully.

0

When I ran into this issue, I had a file stored locally that didn't match what was in Production. I noticed this error in the Output tab:

\force-app\main\default\flows\Loan_Flow.flow-meta-old.xml: Could not infer a metadata type
14:14:45.401 Starting SFDX: Retrieve Source from Org

I didn't need the file so I deleted it and was then able to successfully Retrieve Source from Org.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .