Why can’t I deploy my Unlocked Package back in to my own Sandbox org?

The Background

We are a super-sized Performance Edition organization with a number of enhanced limits, and migrating our “happy soup” to DX Unlocked packages.

We previously had problems creating some of our Unlocked Packages, and eventually came up with a configuration file that allowed us to create these packages.

The Configuration

Our config file used for all of the packages is as follows:

    "features": [
    "settings": {
        "accountSettings": {
            "enableAccountTeams": true
        "orgPreferenceSettings": {
            "networksEnabled": true
        "nameSettings": {
            "enableMiddleName": true,
            "enableNameSuffix": true

The Problem

Now, we’re trying to install these packages in to a Sandbox for testing purposes before we try to go live. The installer runs for about 5 minutes, then gives us the following installation error:

ERROR: Encountered errors installing the package!,Installation errors:

1) Custom Relationship Limit Exceeded, Details: Cannot create new relationship. Each object can have no more than 40 custom relationships, including Master-Detail and Lookup relationships.

The sandbox we’re attempting to install to is a copy from production that should have the same “extra custom relationships” settings as production itself. The metadata for this Unlocked Package includes all of the custom relationships we need to successfully deploy the remaining packages.

Is this a current limitation of Unlocked Packages? How is it we’re allowed to create packages we cannot install? Do I need to remove one or more fields from my package and/or sandbox to get this to work? All the new features suggests that we should be able to do this without too much difficulty, but the docs are not clear on how to proceed.

The Question

How do we, as a super-sized org, get our sandboxes and scratch orgs to work with our super-sized configuration Unlocked Packages?


Apparently, our org limits were reduced? Here’s our current org limits, both in the Sandbox and Production. I’ll need to follow up with Support.

Object Limits


If this is not a new sandbox, have you recently refreshed it?

If not, try and refresh/spawn a new one. Sandboxes do not automatically get production changes, you need to refresh them.

You could also try matching production licenses as below if you can’t refresh or spawn a new one:

To match licenses, log in to your sandbox. From Setup, enter Company
n in the Quick Find box, select Company Information, and
then click Match Production Licenses. You get an alert when the
matching process starts. After all licenses have been matched in
sandbox, you get a confirmation email. The confirmation email is sent
to the user who initiates the license copy.

But certainly a refresh/new sandbox would be better as this “should” copy your exact production settings.

Source : Link , Question Author : sfdcfox , Answer Author : Nico W

Leave a Comment