function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Danny PhamDanny Pham 

You do not have access to the [ScratchOrgInfo] object.

Hello,
 I follow the instruction and enable Dev Hub but I am still getting error 
 sfdx force:org:create -f config/project-scratch-def.json -a HelloWorldLightningWebComponent
You do not have access to the [ScratchOrgInfo] object
sfdx force:org:list --all
=== Orgs
     ALIAS   USERNAME                ORG ID              CONNECTED STATUS
───  ──────  ──────────────────────  ──────────────────  ────────────────
(D)  DevHub  dannyxxxxxx@.com           00Df4000004miAiEAI  Connected
Raj VakatiRaj Vakati
Can u  try to create or Authertixe the dev hub from the project folder once ..  BTW you are doing correct only 


https://rajvakati.com/2018/12/22/lightning-web-components/
Danny PhamDanny Pham
Hello rajvakati,
 Follow your instruction and get the same error
Starting SFDX: Create a Default Scratch Org...
08:14:36.533 sfdx force:org:create -f config\project-scratch-def.json --setalias helloWorld --durationdays 7 --setdefaultusername
ERROR: You do not have access to the [ScratchOrgInfo] object.
08:15:03.421 sfdx force:org:create -f config\project-scratch-def.json --setalias helloWorld --durationdays 7 --setdefaultusername ended with exit code 1

Thanks
/Danny
Raj VakatiRaj Vakati
Create a new trail account and try and i am not sure why its happening after you enabled the Scratch Org .. 


What is your profile ?? can u check you have an access on Scratch Org object
Danny PhamDanny Pham
Hello Raj,
 Thanks for your help! I was able figure out problem.
 step to resolve:
  Reset trail head account user. I was turn Dev Hub on Trail Head Account but log-in as my Developer Account
  After reset password, I was able to create scatch org
 Successfully created scratch org: 00DL0000005xmMIMAY

/Danny
SFDC Batch 28SFDC Batch 28
Hi Danny.. can you please help me...i am also facing the same issueUser-added image
Cherish Reddy 17Cherish Reddy 17
Hi SFDC Batch28,
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. 
User-added image 
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. 
Check if this is enabled by going to Setup> In quick find search for Dev Hub> select Dev Hub> enable it
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.
Never authorize with your developer login unless needed or told. Always authorize the trailhead playground org.
4)Now when all this is done. You can sfdx force:org:list --clean to clean all the previous expired scratch orgs.
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. 
User-added image

If you think I answered your question then please mark this as the best answer and share. 
 
HariprasathHariprasath
Hi All,

There are lot of possible wa, you can get this error while trying to create a scratch org.

1. The authenticated DevHub org might not be flaged as -D to create a scratch org. You can set the default org username as follows,

sfdx force:config:set defaultdevhubusername='Alias of Authenticated DevHub enabled org'

Also, if you have connected multiple DevHub orgs then you can perform the above command to set the correct default devehub.

That's it try to create the scratch org.

2. The DevHub -D flagged to a non DevHub org, which means In the default org you haven't enable the DevHub.

You can follow  Cherish Reddy 17 's Answer to enable the DevHub option to the connected org.

 
Brandon LeBoeufBrandon LeBoeuf
You must Enable Dev Hub

Search "Dev Hub" and click "Enable"
Mars Rover 1770Mars Rover 1770
@Brandon LeBoeuf: You gave the best answer of all! This allowed me to create a scratch org.
Abdul Faruk MollaAbdul Faruk Molla
I had faced the same issue. After Execute the below command it's working fine.
sfdx force:auth:web:login -d -a DevHub
Suraj Tripathi 47Suraj Tripathi 47
Hi Danny Pham,
Greetings!

Please follow these steps to solve this issue.
1. Uninstall the CLI from your system.
2. Download and install the latest version of CLI.
3. Download and install the latest version of VS Code.
4.Try to Re-authenticate your org in VS Code using the latest version of CLI.

If you find your Solution then mark this as the best answer. 

Thank you!

Regards,
Suraj Tripathi
Ravi Kanth GaddamRavi Kanth Gaddam
@Cherish Reddy17: thanks for providing the detailed information and insight, issue got resolved.