Executing force:org:create fails with a ProblemDeployingSettings error
{
"orgName": "BrightEvent",
"country": "GB",
"edition": "Developer",
"features": [
"Communities",
"Sites",
"SiteDotCom"
],
"settings": {
"communitiesSettings": {
"enableNetworksEnabled": true
}
}
}
sfdx force:org:create, specifying the config file created in step 1Scratch org is created according to the configuration
Error creating the org, with the following JSON output:
{
"status": 1,
"name": "ProblemDeployingSettings",
"message": "Failed to deploy settings to scratch org.",
"exitCode": 1,
"commandName": "OrgCreateCommand",
"stack": "ProblemDeployingSettings: Failed to deploy settings to scratch org.\n at ALMError (/Users/Spare/.local/share/sfdx/node_modules/salesforce-alm/dist/lib/core/almError.js:50:19)\n at settings.createDeployDir.then.catch.err (/Users/Spare/.local/share/sfdx/node_modules/salesforce-alm/dist/lib/core/scratchOrgApi.js:672:37)\nOuter stack:\n at Function.wrap (/Users/Spare/.local/share/sfdx/node_modules/salesforce-alm/node_modules/@salesforce/core/lib/sfdxError.js:151:27)\n at OrgCreateCommand.catch (/Users/Spare/.local/share/sfdx/node_modules/salesforce-alm/dist/ToolbeltCommand.js:246:46)",
"warnings": []
}
or the following error, if run without the --json switch:
=== Component Failures [1]
TYPE FILE NAME PROBLEM
───── ───────────────────────────────────── ─────────────────────────────── ─────────────────────────────────────────────
Error shape/settings/OrgPreference.settings settings/OrgPreference.settings Not available for deploy for this API version
Removing the settings property allows the scratch org to be created successfully.
SFDX CLI Version(to find the version of the CLI engine run sfdx --version):
sfdx-cli/7.48.0-a71f8c6899 darwin-x64 node-v10.15.3
SFDX plugin Version(to find the version of the CLI plugin run sfdx plugins --core)
salesforcedx 48.3.1
├─ @salesforce/sfdx-plugin-lwc-test 0.1.5
├─ salesforcedx-templates 48.4.0
└─ salesforce-alm 48.4.0
sfdx-cli 7.48.0 (core)
OS and version:
MacOS 10.13.5
I've just tried this on another machine and I'm not seeing the issue. The versions of the Salesforce CLI and the plugins are identical across both machines. I also don't understand why on the machine that breaks it complains about OrgPreferenceSettings, as I don't have any of these. Is there some configuration built in to the CLI that has somehow not been updated?
This affects me too. It can be traced back to the enableEnhancedEmail flag, but this is current according to docs.
My setup:
sfdx-cli/7.48.0 darwin-x64 node-v13.9.0
salesforcedx 48.3.1 (core)
├─ salesforcedx-templates 48.4.0 (core)
├─ @salesforce/sfdx-plugin-lwc-test 0.1.5 (core)
└─ salesforce-alm 48.4.0 (core)
MacOS 10.14.6
scratch org config file:
{
"orgName": "DIABASE",
"edition": "Enterprise",
"country": "DE",
"language": "de_DE",
"settings": {
"activitiesSettings": {
"enableEmailTracking": true
},
"chatterSettings": {
"enableChatter": true
},
"emailAdministrationSettings": {
"enableEnhancedEmailEnabled": true
}
}
}
sfdx-project.json:
{
"packageDirectories": [
{
"path": "force-app",
"default": true,
....
}
],
"namespace": "...",
"sfdcLoginUrl": "https://login.salesforce.com",
"sourceApiVersion": "48.0",
"packageAliases": {
...
}
}
I've run into the same issue. I've tried reinstalling the CLI, re-authenticating against the DevHub, but that did not help.
I've filed a case with through the partner portal as well, if I get any feedback there, I'll post it here too.
My config file:
{
"orgName": "Scratch org",
"edition": "Developer",
"country": "NL",
"language": "nl_NL",
"features": ["AuthorApex", "DebugApex", "MaxApexCodeSize:20", "Communities"],
"settings": {
"apexSettings": {
"enableApexApprovalLockUnlock": true
},
"communitiesSettings": {
"enableNetworksEnabled" : true
},
"languageSettings": {
"enableTranslationWorkbench": true
},
"lightningExperienceSettings": {
"enableS1DesktopEnabled": true
}
}
}
Just a thought - are you both running SFDX as a node module? Or do you use the standalone (i.e. including a packaged Node.js & modules) installer? I switched to npm installation lately, and this correlates with the first occurences of this problem (but it also correlates with the spring release, so hard to identify the meaningful influences...)
I'm using the standalone - this started happening when I updated the CLI and plugins to the latest versions, but so far I've only seen it on one machine.
Saves me the hassle to return to the standalone installer... thanks!
Updated to 7.49.1, issue seems to be gone for me
Same thing is still happening for me on :
sfdx-cli 7.49.1
salesforcedx 48.4.1
Looks like #333 is the another flavour of this error.
Thank you for reaching out. I am sending your issue to the PM for scratch orgs
I just ran into this issue as well (and have reviewed #333 to see if it would help). I have a support ticket with Partner Support...will see how it goes and will post back when I'm up and running.
Apparently passing the v47.0 in the api version command argument workarounds this issue, seems to be affecting v48.0

sfdx force:org:create --apiversion=47.0 -f config/project-scratch-def.json
any news?
Downgrading to --apiversion=50.0 worked for me
sfdx force:org:create --apiversion=50.0 --definitionfile config/project-scratch-def.json
Environment
GitLab shell runner with docker
CLI version sfdx-cli/7.91.0-6a6ed69ebe linux-x64 node-v14.15.4
project-scratch-def.json
{
"orgName": "XXX",
"edition": "Developer",
"features": [],
"settings": {
"lightningExperienceSettings": {
"enableS1DesktopEnabled": true
},
"securitySettings": {
"passwordPolicies": {
"enableSetPasswordInApi": true
}
},
"mobileSettings": {
"enableS1EncryptedStoragePref2": false
}
}
}
I am still not able to create a Scratch Org with settings, here's the def I used:
{
"orgName": "Mass Action Scheduler",
"edition": "Enterprise",
"hasSampleData": false,
"features": [],
"settings": {
"mobileSettings": {
"enableS1EncryptedStoragePref2": false
},
"securitySettings": {
"sessionSettings": {
"lockerServiceCSP": true,
"lockerServiceFrozenRealm": true,
"enableClickjackNonsetupUser": false,
"enableClickjackNonsetupUserHeaderless": false
}
}
}
}
And this is the log that I received:
{
"status": 1,
"name": "ProblemDeployingSettings",
"message": "Failed to deploy settings to scratch org.",
"exitCode": 1,
"commandName": "OrgCreateCommand",
"stack": "ProblemDeployingSettings: Failed to deploy settings to scratch org.\n at ALMError (C:\\Users\\SFDX_LOCATION\\sfdx\\client\\7.91.0-6a6ed69ebe\\node_modules\\salesforce-alm\\dist\\lib\\core\\almError.js:50:19)\n at C:\\Users\\SFDX_LOCATION\\sfdx\\client\\7.91.0-6a6ed69ebe\\node_modules\\salesforce-alm\\dist\\lib\\core\\scratchOrgApi.js:653:37\n at runNextTicks (internal/process/task_queues.js:58:5)\n at processImmediate (internal/timers.js:434:9)\nOuter stack:\n at Function.wrap (C:\\Users\\SFDX_LOCATION\\sfdx\\client\\7.91.0-6a6ed69ebe\\node_modules\\@salesforce\\core\\lib\\sfdxError.js:171:27)\n at OrgCreateCommand.catch (C:\\Users\\SFDX_LOCATION\\sfdx\\client\\7.91.0-6a6ed69ebe\\node_modules\\salesforce-alm\\dist\\ToolbeltCommand.js:248:46)\n at async OrgCreateCommand._run (C:\\Users\\SFDX_LOCATION\\sfdx\\client\\7.91.0-6a6ed69ebe\\node_modules\\@salesforce\\command\\lib\\sfdxCommand.js:85:13)\n at async Config.runCommand (C:\\Users\\SFDX_LOCATION\\sfdx\\client\\7.91.0-6a6ed69ebe\\node_modules\\@oclif\\config\\lib\\config.js:173:24)\n at async Main.run (C:\\Users\\SFDX_LOCATION\\sfdx\\client\\7.91.0-6a6ed69ebe\\node_modules\\@oclif\\command\\lib\\main.js:27:9)\n at async Main._run (C:\\Users\\SFDX_LOCATION\\sfdx\\client\\7.91.0-6a6ed69ebe\\node_modules\\@oclif\\command\\lib\\command.js:43:20)\n at async Object.run (C:\\Users\\SFDX_LOCATION\\sfdx\\client\\7.91.0-6a6ed69ebe\\dist\\cli.js:121:21)",
"warnings": []
}
Switching to api Version 50.0 did not solve the issue for me either.
Switching to 47.0 however seems to have done the trick. Something went awry in one of the higher API versions.
Most helpful comment
Apparently passing the v47.0 in the api version command argument workarounds this issue, seems to be affecting v48.0