1

I am trying to push a lot of source from a Dev Org into a Scratch Org using:

sfdx force:source:push

It gets to:

SOURCE PROGRESS | ...... 287/348 Components

And then I am getting a load of problems/errors, but the first 9 are quite odd:

reached maximum number of custom objects

There are 27 folders in the objects folder in the source.

I created the Scratch Org using:

sfdx force:org:create --definitionfile .\config\project-scratch-def.json --targetusername my-scratch-org1

I just used the default project-scratch-def.json

{
  "orgName": "Demo company",
  "edition": "Developer",
  "features": [],
  "settings": {
    "lightningExperienceSettings": {
      "enableS1DesktopEnabled": true
    },
    "securitySettings": {
      "passwordPolicies": {
        "enableSetPasswordInApi": true
      }
    },
    "mobileSettings": {
      "enableS1EncryptedStoragePref2": false
    }
  }
}

Since then, I've deleted the scratch org, and I have tried to create more suitable org Shape using:

sfdx force:org:shape:create --loglevel TRACE

And I've updated the project-scratch-def.json to:

{
  "orgName": "My Scratch Org 2",
  "sourceOrg": "00D4K0000038xzt"
}

but when I run this command:

sfdx force:org:create --definitionfile .\config\project-scratch-def.json --targetusername my-scratch-org2

I get this error:

ERROR running force:org:create: No such column 'SourceOrg' on sobject of type ScratchOrgInfo

And when I run:

sfdx force:org:shape:list

I get a lot of:

ERROR: ERROR: getaddrinfo ENOTFOUND .....
ERROR: ERROR: getaddrinfo ENOTFOUND .....
ERROR: ERROR: getaddrinfo ENOTFOUND .....
ERROR: ERROR: getaddrinfo ENOTFOUND .....
ERROR: ERROR: getaddrinfo ENOTFOUND .....
ERROR: ERROR: getaddrinfo ENOTFOUND .....

Then it hangs for a long time before saying:

ERROR running force:org:shape:list: Error authenticating with the refresh token due to: authentication failure

  1. What is stopping the scratch org from being created from the shape?
  2. Why am I getting all those errors when I list off the shapes?
5
  • How many objects do you have in the org? That error seems weird? Commented Nov 1, 2020 at 2:14
  • @MohithShrivastava - 27 i think. I've updated the question.
    – Robs
    Commented Nov 1, 2020 at 2:30
  • Have you enabled dev hub and also whitelisted the dev hub from which you want to generate the org shapes? Commented Nov 1, 2020 at 2:38
  • @MohithShrivastava - yes, Dev Hub is enabled, and Enable Org Shape for Scratch Orgs (Beta) is On in the source org, and the Dev Hub is white listed.
    – Robs
    Commented Nov 1, 2020 at 2:46
  • Also make sure you have the perms provided listed here developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/… Commented Nov 1, 2020 at 3:03

2 Answers 2

4

You can use the edition as Partner Developer if you are an ISV as documented here

Also to get the exact shape of the org as similar to the one you have tried using the winter 21 org shape feature. This will auto-build the features you need to enable and also add settings and licenses.

One key thing to note if you are using the Org Shape feature is to make sure you have enabled and assigned permission sets documented here

3
  • 1
    Going back to the original project-scratch-def.json and changing the edition to Partner Developer got rid of the reached maximum number of custom objects error
    – Robs
    Commented Nov 1, 2020 at 2:54
  • Ok is your source org ID and the Dev Hub both same? If not one needs to whitelist 15 digit ID Commented Nov 1, 2020 at 3:01
  • My Dev Hub is our Production Org, and the Source Org is a separate Partner Developer org
    – Robs
    Commented Nov 1, 2020 at 9:23
3

Scratch Orgs only support the minimum number of custom objects (50) by default. You can add more by using "features":["AddCustomObjects:X"], where X is value from 1-30. See the Features section of the documentation. Note that Scratch Orgs are not meant to be an entire reproduction of your production org, which may have hundreds of custom objects (e.g. Unlimited Edition). You will need to break up your metadata into multiple packages. You may also try an Org Shape to mimic the licenses and limits of your production org, although it is unclear if this would match the CustomObject limits as well.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .