When creating a scratch org sfdx cli got timed out. Later on the scratch org was successfully created but the access token was not present in my sfdx cli.

I can see the scratch org info from the DevHub but how to access the scratch org if i do not have the password or token.

  • 2
    I'd just spin up a new scratch org. The one that timed out will expire after 7 days anyway.
    – David Reed
    Commented Apr 28, 2018 at 13:42
  • 1
    Can you open it from the command line using sfdx force:source:open? Do you have the url of the new scratch org? Commented Apr 30, 2018 at 16:47
  • 1
    No the cli wasn't able to store the alias nor the url/security token. So, i have no information about the scratch org. The devhub shows that it was successfully created and is listed under active scratch orgs
    – Raja Paul
    Commented May 1, 2018 at 17:59
  • 1
    The answer I posted here salesforce.stackexchange.com/a/258231/2929 might also be useful in this scenario
    – James
    Commented Apr 17, 2019 at 21:54

5 Answers 5

> sfdx force:user:password:generate -u YourOrgAlias

Successfully set the password "password" for user [email protected].
You can see the password again by running "sfdx force:user:display -u [email protected]".

Scratch orgs are meant to be temporary, and inconsequential to spin up and/or delete. You can always spin up another if one didn't work correctly.

If you're the tidy type (not that there's anything wrong with that), you could always delete the one that failed to deliver the OAuth token through the Dev Hub UI Active Scratch Orgs tab. (It is a standard object and deletable.)

Delete Scratch Orgs

  • That is true. But what if i have lost access to my scratch orgs because my machine was formatted or some other reason and i have some unfinished business with that scratch org. :p There should be some mechanism to access it. I tried forgot password with the username mentioned in DevHub , but no email is sent to my registered address
    – Raja Paul
    Commented Apr 29, 2018 at 8:38

If you committed your project to git and ensured that the .sfdx/ folder is included, you should see your org and config listed under the directory .sfdx/orgs

If so, you won't need the password. Simply set it as the default org for your project and you will be able to open and push/pull from it.

So execute this from within your project folder (after you find the org username using the method above):

sfdx force:config:set [email protected]

Also see https://salesforce.stackexchange.com/a/236428/11055


If a scratch org doesn't have password and it is disconnected from your sfdx cli workspace, you can't connect back to it. It is gone forever.

Always make sure to generate a password after you create a scratch org. That way you can connect to it from anywhere.


I used following command.

1. Authorise and set default user name with instance url.

sfdx force:auth:web:login --setdefaultdevhubusername --setalias Devxx --instanceurl https://CSxx.salesforce.com

2. config org user

sfdx force:config:set [email protected]

You must log in to answer this question.

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