I created a Project with Manifest some time ago and worked on it but today I need to modify some classes but when I try to Retrieve Source in Manifest from Org I hit the following error:

Error authenticating with the refresh token due to: expired access/refresh token

I even Authorize an Org again and it works but when I try to fetch the code from the Org I hit the same error. Also I navigated to the Org's Setup, checked in Connected Apps OAuth Usage, and for Salesforce CLI the user count it's 1.

Do I need to refresh the Org's token in order to have access again?

  • what command do you use? If you are using VsCode build-in thing, try using terminal. Please copy-paste here command that VsCode is running for retrieve, probably it specifies incorrect username. You can check it in "Output" -> "Salesforce CLI"
    – ytiq
    Apr 6, 2021 at 14:09
  • @ytiq I'm using cmd+shift+P and then selecting Retrieve Source in Manifest from Org and all I'm getting on the Output is this: '20:27:57.124 Starting SFDX: Retrieve Source from Org Error authenticating with the refresh token due to: expired access/refresh token' Apr 6, 2021 at 18:32
  • @JorgeValdés - Can you please authorize org again and make sure the alias you're using is the default one. So that SF will use it for retrieving the metadata.
    – Ysr Shk
    Apr 7, 2021 at 5:49
  • and check you .sfdx/sfdx-config.json file to make sure that you use correct alias for the org name
    – ytiq
    Apr 7, 2021 at 6:09
  • @ytiq I'm using the default one and I also tried using a new one but I get the same error. I had to create a new Project with Manifest and then I authorize an Org but I named it different, that's the only way I found to retrieve the metadata from SF. Apr 7, 2021 at 6:10

2 Answers 2


Had the same issue, it is when use the extension on the command palette. Go to the terminal and run:

sfdx force:source:retrieve -x manifest/package.xml
  • 1
    Hi Carlos, welcome to SFSE! No need to sign your posts, it's actually discouraged here.
    – Adrian Larson
    Sep 9, 2021 at 18:05

Reauthorize the Org and then re start your VS Code Application, worked for me.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.