Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ProblemDeployingSettings error when trying to create a scratch org #323

Closed
keirbowden opened this issue Feb 28, 2020 · 30 comments
Closed

ProblemDeployingSettings error when trying to create a scratch org #323

keirbowden opened this issue Feb 28, 2020 · 30 comments
Labels
more information required Issue requires more information or a response from the customer owned by another team The Salesforce CLI team does not own this work but will pass on the information to the correct team. stale

Comments

@keirbowden
Copy link

Summary

Executing force:org:create fails with a ProblemDeployingSettings error

Steps To Reproduce:

  1. Create a scratch org config file as follows:
{
  "orgName": "BrightEvent",
  "country": "GB",
  "edition": "Developer",
  "features": [
    "Communities",
    "Sites",
    "SiteDotCom"
  ],
    "settings": {
        "communitiesSettings": {
            "enableNetworksEnabled": true
        }
    }
}

  1. Execute the command sfdx force:org:create, specifying the config file created in step 1

Expected result

Scratch org is created according to the configuration

Actual result

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

Additional information

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

@keirbowden
Copy link
Author

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?

@dstdia
Copy link

dstdia commented Mar 2, 2020

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": {
        ...
    }
}

@OscarScholten
Copy link

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
    }
  }
}

@dstdia
Copy link

dstdia commented Mar 3, 2020

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...)

@keirbowden
Copy link
Author

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.

@dstdia
Copy link

dstdia commented Mar 3, 2020

Saves me the hassle to return to the standalone installer... thanks!

@dstdia
Copy link

dstdia commented Mar 5, 2020

Updated to 7.49.1, issue seems to be gone for me

@keirbowden
Copy link
Author

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.

@clairebianchi clairebianchi added the owned by another team The Salesforce CLI team does not own this work but will pass on the information to the correct team. label Mar 9, 2020
@clairebianchi
Copy link
Collaborator

Thank you for reaching out. I am sending your issue to the PM for scratch orgs

@adamerstelle
Copy link

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.

@mnunezdm
Copy link

mnunezdm commented Jun 22, 2020

Apparently passing the v47.0 in the api version command argument workarounds this issue, seems to be affecting v48.0

image

sfdx force:org:create --apiversion=47.0 -f config/project-scratch-def.json

@mnunezdm
Copy link

any news?

@Mattue
Copy link

Mattue commented Mar 16, 2021

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
        }
    }
}

@dschibster
Copy link

dschibster commented Mar 17, 2021

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.

@mnunezdm
Copy link

Any news?

@gollmj
Copy link

gollmj commented Apr 28, 2021

Make sure you don't have restDeploy set to True. That was causing issues for me.
sfdx config:list
sfdx config:unset restDeploy

@ArmandGM
Copy link

ArmandGM commented May 7, 2021

Same error for me, none of the workarounds has worked for me :

sfdx-cli/7.100.0 win32-x64 node-v14.16.1

salesforcedx 51.12.0 (latest-rc)
├─ data 0.4.6
├─ custom-metadata 1.0.12
├─ apex 0.2.0
├─ org 1.6.5
├─ schema 1.0.6
├─ @salesforce/sfdx-plugin-lwc-test 0.1.7
├─ limits 1.2.0
├─ user 1.2.10
├─ templates 51.3.1
└─ salesforce-alm 51.6.23

@chfosli
Copy link

chfosli commented May 11, 2021

The ProblemDeployingSettings error I got was linked to this known issue: https://trailblazer.salesforce.com/issues_view?id=a1p4V000001qZtWQAU

If you have multiple DX projects with varying configurations within each project's project-scratch-def.json files, the system temporary folder that the Salesforce CLI uses to define the shape of the scratch org can include definition files from previous force:org:create executions. This can lead to errors during the scratch org creation that are not present on other machines or from previous scratch org creation events.

Workaround is to locate the folder and delete it manually.

@nvuillam
Copy link

@chfosli any idea where I can find this temporary folder on Windows ?
I didn't find anything in local and global .sfdx folders :/

@chfosli
Copy link

chfosli commented May 14, 2021

@chfosli any idea where I can find this temporary folder on Windows ?
I didn't find anything in local and global .sfdx folders :/

I found it here: C:\Users\UserName\AppData\Local\Temp\shape. I just deleted the shape folder.

@nvuillam
Copy link

I was getting mad by just deleting C:\Users\UserName\AppData\Local\Temp\shape.zip , thanks ! :)

@aniltiwari-tech
Copy link

@chfosli any idea where I can find this temporary folder on Windows ?
I didn't find anything in local and global .sfdx folders :/

I found it here: C:\Users\UserName\AppData\Local\Temp\shape. I just deleted the shape folder.

Any idea where can find this in Linux/Ubunutu?

@mnunezdm
Copy link

mnunezdm commented Jun 28, 2021

its in /tmp folder, just deleted shape folder and shape.zip and the issue was solved

@nvuillam
Copy link

nvuillam commented Jun 28, 2021

If you use sfdx hardis:scratch:create, shape folder & shape.zip are automatically deleted before the call to force:org:create :)

https://www.npmjs.com/package/sfdx-hardis

@Mattue
Copy link

Mattue commented Oct 22, 2021

In my case issue was that enableSetPasswordInApi removed from security settings. I moved this to features and it worked.

project-scratch-def.json before

{
    "orgName": "org name",
    "edition": "Developer",
    "features": [],
    "settings": {
        "securitySettings": {
            "passwordPolicies": {
                "enableSetPasswordInApi": true
            }
        }
    }
}

project-scratch-def.json after

{
  "orgName": "org name",
  "edition": "Developer",
  "features": ["EnableSetPasswordInApi"],
  "settings": {}
}

@linked-2
Copy link

linked-2 commented Nov 2, 2021

Hi All - any tips on this? - many thanks.
sfdx-cli/7.124.0 darwin-x64 node-v14.18.1
when I run sfdx update I see that I am running the most recent version.
def file looks like:
"orgName": "TestOnsite CRM",
"edition": "Enterprise",
"country": "FR",
"hasSampleData": false,
"language": "en_US",
"features": [
"API",
"AuthorApex",
"AddCustomApps:10",
"AddCustomTabs:30",
"Communities",
"ContactsToMultipleAccounts",
"MultiCurrency",
"ProcessBuilder",
"StateAndCountryPicklist",
"Workflow",
"ContactsToMultipleAccounts",
"SalesforceContentUser",
"CPQ",
"PersonAccounts",
"ForceComPlatform",
"Knowledge"
],
"settings": {
"accountSettings": {
"enableAccountTeams": true,
"showViewHierarchyLink": true,
"contactsToMultipleAccounts": true
},
"chatterSettings": {
"enableChatter": true
},
"communitiesSettings": {
"enableNetworksEnabled": true
},
"emailAdministrationSettings": {
"enableEnhancedEmailEnabled": true
},
"enhancedNotesSettings": {
"enableEnhancedNotes": true
},
"opportunitySettings": {
"enableOpportunityTeam": true,
"autoActivateNewReminders": true,
"promptToAddProducts": false
},
"languageSettings": {
"enableTranslationWorkbench": false
},
"name": {
"enableMiddleName": true,
"enableNameSuffix": true
},
"lightningExperienceSettings": {
"enableS1DesktopEnabled": true
},
"mobileSettings": {
"enableS1EncryptedStoragePref2": false
},
"nameSettings": {
"enableMiddleName": true,
"enableNameSuffix": true
},
"pathAssistantSettings": {
"pathAssistantEnabled": true
},
"knowledgeSettings": {
"enableKnowledge": true,
"enableLightningKnowledge": true
}

@CostaRonaro
Copy link

Hi
I fix this bug doing downgrade sfdx cli from sfdx-cli/7.172.0 to sfdx-cli/7.142.1 ignore node version.

@mshanemc
Copy link
Contributor

mshanemc commented Apr 3, 2023

@CostaRonaro are you still able to reproduce this error? We've haven't seen any of the API breaks mentioned above in a while.

If so, please share your scratch org definition file?

@mshanemc mshanemc added the more information required Issue requires more information or a response from the customer label Apr 3, 2023
@CostaRonaro
Copy link

@mshanemcbut I haven't had that problem anymore, but I haven't updated the CLI either

@github-actions
Copy link

This issue has not received a response in 7 days. It will auto-close in 7 days unless a response is posted.

@github-actions github-actions bot added the stale label Apr 11, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
more information required Issue requires more information or a response from the customer owned by another team The Salesforce CLI team does not own this work but will pass on the information to the correct team. stale
Projects
None yet
Development

No branches or pull requests