0

I am trying to create a scratch orgs from visual studio, I authorise the dev hub successfully but when I try to create a scratch org it throw this error :

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

I tried with 3-4 dev hub orgs, all the dev hub org authorised successfully, but cant able to create scratch orgs. Please advise

3
  • Did you install the Salesforce DX pre-release version? Can you show us what version you are on and the output of sfdx force:org:list?
    – David Reed
    Commented Dec 25, 2018 at 12:31
  • Hi David, I updated to the latest version. still same. sfdx-cli: Updating CLI... already on latest version: 6.44.0-dead729fb5 sfdx-cli: Updating plugins... done
    – Tariq
    Commented Dec 26, 2018 at 5:31
  • sfdx-cli/6.44.0-dead729fb5 (darwin-x64) node-v8.9.4 this is my version of cli
    – Tariq
    Commented Dec 26, 2018 at 5:39

1 Answer 1

0

Run command %USERPROFILE%\.sfdx in windows. This will open folder which is host of .json files. All connected orgs .json files will be here.

Inside the file, has the hashes for current access token, refresh token, and all the other OAuth goodness that allows DX to access your org. So simply deleted that file using command:

rm [email protected]

That appears to have cleaned it all up, and I'm no longer bothered by the "invalid grant" message and the shadow org.

After this done try to create scratch org.

You must log in to answer this question.

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