This article is written as for Spring'21 (API 51) relase.

Following Org shape documentation I tried to create an scratch org based on OrgShape but got this error:

A fatal signup error occurred. Please try again. If you still see this error, contact Salesforce Support for assistance.

Documentation in section Limitations for Org Shape (Beta) list this exact error and suggest to try again. But error repeat every time. Not a solution then.

 

Stepes that you probably done already if you found this page by searching, skip to next senction then.

First you need to have authorized DevHub org - basically your production org with DevHub enabled and all its features.

sfdx auth:web:login --setdefaultdevhubusername --setalias MY_DEVHUB

Create org shape and note its record id:

sfdx force:org:shape:create -u MY_DEVHUB
Successfully created org shape for 3SR2H0000000AAAZZZ

you can check all org shapes list by:

sfdx force:org:shape:list

From this list we need ORG ID for MY_DEVHUB in my case it is 00D300000000zzzYYY

Now in your project folder /config edit file project-scratch-def.json to this form

{
    "orgName": "Scratch1",
    "sourceOrg": "00D300000000zzzYYY"
}

then run:

sfdx force:org:create -f .\config\project-scratch-def.json

and it end with error:

ERROR running force:org:create:  A fatal signup error occurred. Please try again. If you still see this error, contact Salesforce Support for assistance.

Lets try to find what is hidden behind this error message.

First open Workbench, log in to your production and run this SOQL Query (copy paste):

SELECT Id, CreatedDate, Status, Edition, Settings, Features FROM ShapeRepresentation WHERE Status = 'Active'

This query should return one record.

Create new file in /config shape-based-template.json, pase this:

{
  "orgName": "Scratch2",
  "edition": "Enterprise",
  "features": [

  ],

  "settings": {

  }
}

Now copy value of Features form query to your text editor it look like that:

APIENABLEOLDSOAP;BOTFOOTERPREFDEPRECATED;BOTSEINSTEINAIC2CENABLED

replace ; with ", " and add quotations at the begining and end to get "VAL1", "VAL2", "VAL3" and paste it inside features section.

Copy value from SOQL query Settings field and paste it to JSON formatter or use your prefered way to make it pretty printed.

Paste value to settings and save file.

Lets's try to create scratch org from shape-based-template.json

sfdx force:org:create -f .\config\shape-based-template.json

In my case I have got such erros, you may get different ones depended on your org configuration.

=== Component Failures [3]
TYPE   FILE                                        NAME                PROBLEM
─────  ──────────────────────────────────────────  ──────────────────  ───────────────────────────────────────────────────────
Error  shape/settings/CaseClassification.settings  CaseClassification  Not available for deploy for this organization
Error  shape/settings/DevHub.settings              DevHub              enableScratchOrgManagementPref
Error  shape/settings/Search.settings              Search              Required field is missing: documentContentSearchEnabled

Ok so now we can see what is an issue.

 

How to fix it?

Search inside shape-based-template.json for keywords.

1. Searching for "CaseClassification" reults in "caseClassificationSettings" found. Since is not avaliable to deploy then I have removed it.

2. Removed whole devHubSettings sections. Scratch org can't be a DavHub.

3. Found section searchSettings added "documentContentSearchEnabled": false

Rerun 

sfdx force:org:create -f .\config\shape-based-template.json

got two errors:

=== Component Failures [2]
TYPE   FILE                                        NAME                PROBLEM
─────  ──────────────────────────────────────────  ──────────────────  ──────────────────────────────────────────────────────
Error  shape/settings/CaseClassification.settings  CaseClassification  Not available for deploy for this organization
Error  shape/settings/Search.settings              Search              Required field is missing: optimizeSearchForCJKEnabled

So fix 1 did not help, fix 2 helped and fix 3 helped but another error in the same section appear. 

After short searching I have found Salesforce Knowledge Matadata API reference where required fields are listed.

so you need to extend searchSettings section by all required fields:

      "documentContentSearchEnabled": false,
      "optimizeSearchForCJKEnabled": false,
      "recentlyViewedUsersForBlankLookupEnabled": false,
      "searchSettingsByObject": {
      },
      "sidebarAutoCompleteEnabled": false,
      "sidebarDropDownListEnabled": false,
      "sidebarLimitToItemsIOwnCheckboxEnabled": false,
      "singleSearchResultShortcutEnabled": false,
      "spellCorrectKnowledgeSearchEnabled": false

That solved second issue and one left. 

=== Component Failures [1]
TYPE   FILE                                        NAME                PROBLEM
─────  ──────────────────────────────────────────  ──────────────────  ──────────────────────────────────────────────
Error  shape/settings/CaseClassification.settings  CaseClassification  Not available for deploy for this organization

There is no more CaseClassification section in config but is still pop up. 

After few hours breake from this topic bulb ? in my head light up. Thist must be a dependency, it requires that feature to be active. 

I found a list of avaliable Features and checked that CaseClassification exists and is required for Einstein Case Classification. It seems that some config in Settings section require this. 

Modified features section by adding at the end:

"CaseClassification"

and restored back previosuly removed "caseClassificationSettings" and "caseSettings".

Finally saw this:

Successfully created scratch org: 00D0t000000IAAABBB, username: This email address is being protected from spambots. You need JavaScript enabled to view it.

So we have fully working definition file.

 

Can we fix OrgShape config inside SF?

Luaunch again Workbench, log in to your production and run this SOQL Query (copy paste):

SELECT Id, CreatedDate, Status, Edition, Settings, Features FROM ShapeRepresentation WHERE Status = 'Active'

In a result table click on ID then click Update.

First edit Features by adding ;CaseClassification at the end.

Then edit Settings. From config file copy what is inside settings section and using JSON formatter (or other tool) minify it. Paste result into Settings field replacing old content.

 

Try to create scratch org based on project-scratch-def.json which is using OrgShape.

sfdx force:org:create -f .\config\project-scratch-def.json 

Unfortunetally despite of updating record it still show the same error. 

ERROR running force:org:create:  A fatal signup error occurred. Please try again. If you still see this error, contact Salesforce Support for assistance.

 

Do you need help with difficult errors, org cleanups on ther Salesforce topics? Contact me on LinkedIn or by email This email address is being protected from spambots. You need JavaScript enabled to view it..

Check also SF Consulting tab for more details what I can do.

 

Additional resources:

Org Shape discussion group https://trailblazers.salesforce.com/_ui/core/chatter/groups/GroupProfilePage?g=0F93A0000009TPk 

List of avaliable Settings

List of avaliable Features

   
© Paweł Woźniak