I have a problem with my trailhead "Quick Start: Salesforce DX". I'm trying to do this:

sfdx force:org:create -s -f config/project-scratch-def.json -a "default scratch org"

But become an Error: You do not have access to the [scratchorginfo] object

I make all right, step by step. Connected status is "Connected". How can I fix it?

2 Answers 2


you have to enable Dev Hub in your ORG. (Setup --> DevHub)

This successfully fixed the problem for me and was able access to the [ScratchOrgInfo] object and create my Scratch Org.

See the following for more resources:

Salesforce DX Setup Guide: https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_intro.htm

Specific to Dev Hub: https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_enable_devhub.htm

Longer Trailhead: 'Get Started with Salesforce DX': https://trailhead.salesforce.com/content/learn/projects/quick-start-salesforce-dx?trail_id=sfdx_get_started

  • This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker. - From Review
    – Reshma
    Commented Jan 8, 2019 at 6:08
  • 1
    I edited the post and provided more information/resources. My solution did not require clarification from the asker, he understood. However I understand that I should include as much relevant information as I can for any other users that view this post.
    – Z33dawg
    Commented Jan 8, 2019 at 16:24
  • If you get this error while using VSCode and sfdx, you'll want to access the tools menu (command - shift - P) and select "Authorize a Dev Hub". You then login to the org where you've enabled your Dev Hub and return to VSCode. You can then create a default scratch org Commented Oct 5, 2019 at 15:55
  • nice to the point. unlike salesforce community which starts with uninstall CLI :-)
    – PAS
    Commented Mar 24, 2023 at 18:14

I had faced the same issue. So what I did was:

  1. check-in ur terminal of Visual studio code : sfdx force:org:list --all and see which all are authorized org and search for D next to it. Here D refers to as flag for Dev Hub and see to that you have only one D flag. enter image description here

2)check if you have enabled Dev hub for the D flag authorized org. If not first login to that org and go to Setup > quick find > search for Dev Hub > Click on Dev Hub > Enable it as shown in the screenshot below. enter image description here

3)Always remember that whenever you are dealing with Visual studio code and Salesforce CLI topics in trailhead, you need to authorize and login only with your newly created Trailhead Playgrounds (note: create one and use it for all the VSC topics) not with the developer account that you have. enter image description here

4)Now when all this is done. You can sfdx force:org:list --clean to clean all the previous expired scratch orgs. enter image description here

5)Now give the scratch org command sfdx force:org:create -s -f config/project-scratch-def.json -a GeoAppScratch and check. You will get the success message as seen below. enter image description here

Please note that I have answered this as per my understanding and the way I got it to work. Correct me if I am wrong.

  • Please don't ask for answer acceptance, votes, or sharing on Salesforce Stack Exchange. Thank you!
    – David Reed
    Commented Jul 9, 2020 at 1:10
  • Hi David, sorry about that I wasn't aware of it. My only intension was if the process helped then voting as best answer can make it available for others who are viewing instead of reading through all comments(like myself being on end-user who have searched so many things to mix and match to get to that output). Commented Jul 14, 2020 at 1:10

You must log in to answer this question.

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