Have noticed it can be very difficult to successfully create scratch orgs. Wondering if something I am doing is contributing that. Sometimes it works. Sometimes it doesn't.
I have tried both of these variations of the commands:
- sf org create scratch (never worked for me - ever)...
sf org create scratch --alias scratch --wait 30 --set-default --duration-days 30 --definition-file config/project-scratch-def.json
- sfdx force:org:create (takes 5-10 attempts - perhaps affected by the lunar cycle?)
sfdx force:org:create -a scratch -w 30 -s -d 30 -f config/project-scratch-def.json
Here's my project-scratch-def.json...
{
"orgName": "My Scratch Org",
"edition": "Developer",
"adminEmail": "[email protected]",
"description": "2GP development",
"hasSampleData": true,
"features": ["EnableSetPasswordInApi", "MultiCurrency", "SalesUser"],
"settings": {
"businessHoursSettings": {
"businessHours": [
{
"name": "Default",
"active": true,
"default": true,
"timeZoneId": "America/New_York",
"mondayStartTime": "08:00:00.000Z",
"mondayEndTime": "18:00:00.000Z",
"tuesdayStartTime": "08:00:00.000Z",
"tuesdayEndTime": "18:00:00.000Z",
"wednesdayStartTime": "08:00:00.000Z",
"wednesdayEndTime": "18:00:00.000Z",
"thursdayStartTime": "08:00:00.000Z",
"thursdayEndTime": "18:00:00.000Z",
"fridayStartTime": "08:00:00.000Z",
"fridayEndTime": "18:00:00.000Z"
}
]
},
"currencySettings": {
"enableMultiCurrency": false
},
"lightningExperienceSettings": {
"enableS1DesktopEnabled": true
},
"mobileSettings": {
"enableS1EncryptedStoragePref2": false
},
"opportunitySettings": {
"enableOpportunityTeam": true
}
}
}
Previously, I tried turning on Change Data Capture on the Opportunity object in the scratch file to find that metadata (PlatformEventChannelMember) isn't supported. I took it out and still have challenges.
Could my scratch definition file be causing my problems? Does turning on features and settings increase the likelihood of failure?
Any words of wisdom from more experienced Salesforce developers out there?