ERROR running force:org:create: getaddrinfo ENOTFOUND
battlestar-x-wing-50517.m y.salesforce.com
battlestar-x-wing-50517.my.salesforce.com:443
This means a related DevHub organization is expired, to check that either execute first command
$ sfdx force:config:get defaultdevhubusername
to determine the default DevHub org and then see the list of all orgs and find that org in that list or just execute command
$ sfdx force:org:list
to see the list of attached orgs and look for (D) text in the first column to find the default DevHub org and see if it is expired
Red "ENOTFOUND" message means that DevHub trial organization is expired.
There is no command to delete expired organization aliases. To do that manually one has to visit ~/.sfdx folder and manually delete json file which corresponds to expired organization.
Once the expired organization is deleted or if default DevHub points to non-existing alias or non-existing org, the following message is displayed on execution of scratch org creation command.
ERROR running force:org:create: No org configuration found for name
[email protected]
If the user on an organization doesn't have access to ScratchOrgInfo then the following message will be shown
ERROR running force:org:create: You do not have access to the
[ScratchOrgInfo] object
Still not sure about the last error
ERROR running force:org:create: An unknown server error occurred.
Please try again. If you still see this error, contact Salesforce
support for assistance. Include the information from "sfdx
force:data:record:get -s ScratchOrgInfo -i 2SR1t0000008UZEGA2 -u
[email protected]".
Apparantly it happens when the following org definition is used
{
"orgName": "BD DE Full Features Scratch Org",
"edition": "Developer",
"features": [
"API",
"AuthorApex",
"CascadeDelete",
"Chatbot",
"Communities",
"ContactsToMultipleAccounts",
"ContractApprovals",
"CustomerSelfService",
"CustomNotificationType",
"DebugApex",
"DefaultWorkflowUser",
"MultiCurrency",
"PersonAccounts",
"ProcessBuilder",
"StateAndCountryPicklist",
"TerritoryManagement",
"Workflow"
],
"orgPreferences" : {
"disabled": ["S1EncryptedStoragePref2"]
}
}
while if we remove DefaultWorkflowUser feature then Scratch org can be created successfully. Also, if we deploy scratch org with only DefaultWorkflowUser or DefaultWorkflowUser and Workflow feature it can be created successfully. Some combination of feature generates this error, not sure which one.