Skip to content
This repository has been archived by the owner on Mar 18, 2024. It is now read-only.

New error creating scratch orgs that have a defaultRecordType in project-scratch-def.json #942

Closed
jonathankretzmer opened this issue Apr 14, 2022 · 13 comments
Assignees
Labels
bug Something isn't working

Comments

@jonathankretzmer
Copy link
Contributor

Describe the bug

Receiving an error when attempting to set defaultRecordType in objectSettings within "project-scratch-def.json". Specifically applying the default record type to PersonAccount when using the PersonAccounts feature.

To Reproduce

project-scratch-def.json:

{
  "orgName": "Development Scratch Org",
  "edition": "Enterprise",
  "features": [
    "ContactsToMultipleAccounts",
    "PersonAccounts",
    "IndustriesActionPlan",
    "DocumentChecklist",
    "FinancialServicesUser:10",
    "FinancialServicesCommunityUser:10",
    "FlowSites",
    "DebugApex",
    "EnableSetPasswordInApi",
    "Communities"
  ],
  "settings": {
    "accountSettings": {
      "enableRelateContactToMultipleAccounts": true,
      "enableAccountHistoryTracking": true
    },
    "emailAdministrationSettings": {
      "enableEnhancedEmailEnabled": true
    },
    "experienceBundleSettings": {
      "enableExperienceBundleMetadata": true
    },
    "lightningExperienceSettings": {
      "enableS1DesktopEnabled": true
    },
    "chatterSettings": {
      "enableChatter": true
    },
    "communitiesSettings": {
      "enableNetworksEnabled": true
    },
    "industriesSettings": {
      "enableAccessToMasterListOfCoverageTypes": true
    }
  },
  "objectSettings": {
    "account": {
      "defaultRecordType": "PersonAccount"
    }
  }
}

pool-ci.json:

{
  "tag": "ci",
  "maxAllocation": 5,
  "expiry": 2,
  "batchSize": 5,
  "configFilePath": "config/project-scratch-def.json",
  "relaxAllIPRanges": false,
  "installAll": true,
  "enableSourceTracking": false,
  "retryOnFailure": true,
  "succeedOnDeploymentErrors": false,
  "fetchArtifacts": {
    "npm": {
      "scope": "@internal-salesforce"
    }
  }
}

Run command:
sfdx sfpowerscripts:orchestrator:prepare -v "devhub" -f config/pool-ci.json --loglevel=trace

Error message received:

Generate Scratch Orgs..
Creating Scratch Org 1 of 5..
Parameters: SO1 config/project-scratch-def.json 2
ProblemDeployingSettings: A scratch org was created with username [email protected], but the settings failed to deploy due to:
Invalid fullName, must end in a custom suffix ( for ex. __c )
Unable to provision scratch org 1 ..

The CLI command works fine when creating the scratch orgs on the same file:
sfdx force:org:create --definitionfile config\project-scratch-def.json --setdefaultusername --durationdays 1 -w 30 -v devhub

Expected behavior

Scratch Org Pool creation should create orgs as expected.

To rectify I needed to remove the "objectSettings" section of the "project-scratch-def.json" file.

Platform Details (please complete the following information):

  • OS: All
  • Version: Release:April 22, Version:13.0.11 and Version:13.0.12
  • Salesforce CLI(sfdx cli) Version: N/A
  • CI Platform: GitLab & CLI
@github-actions github-actions bot added the analysis To be decided on how to solution/fix label Apr 14, 2022
@azlam-abdulsalam
Copy link
Contributor

@jonathankretzmer can you confirm whether this was working in February 22 of sfpowerscripts?

@jonathankretzmer
Copy link
Contributor Author

This was previously working in the February 22 version, yes.

@azlam-abdulsalam
Copy link
Contributor

@jonathankretzmer Are you able to replicate this when used with sfdx force:org:beta:create? Looks like the underlying core lib is not fully incorporated

@jonathankretzmer
Copy link
Contributor Author

It looks as though your suspicion was correct, I get the same error when running sfdx force:org:beta:create

@azlam-abdulsalam
Copy link
Contributor

Lets create an issue with core lib

@azlam-abdulsalam azlam-abdulsalam added bug Something isn't working and removed analysis To be decided on how to solution/fix labels Apr 22, 2022
@azlam-abdulsalam azlam-abdulsalam self-assigned this Apr 22, 2022
@azlam-abdulsalam
Copy link
Contributor

@jonathankretzmer Where you able to create an issue in forcedotcom/cli?

@dieffrei
Copy link
Contributor

@azlam-abdulsalam, I had the same issue.
It is not only related to "defaultRecordType" but with the whole "objectSettings" attribute.
After I remove the attribute now, it is working.

@jonathankretzmer
Copy link
Contributor Author

I dropped the ball and forgot to log the issue with forcedotcom/cli. I have checked again to verify if the issue is still present and it, unfortunately, appears to be. Planning to submit an issue today, will keep you updated.

@jonathankretzmer
Copy link
Contributor Author

Logged the issue, bug confirmed and work item assigned.

@AndreyShestakovACN
Copy link

I tried to repeat the issue with and without defaultRecordType notation, and received errors in both cases:

ProblemDeployingSettings: A scratch org was created with username test-##########@example.com, but the settings failed to deploy due to:
Invalid fullName, must end in a custom suffix ( for ex. __c )
Invalid fullName, must end in a custom suffix ( for ex. __c )
Invalid fullName, must end in a custom suffix ( for ex. __c )
Invalid fullName, must end in a custom suffix ( for ex. __c )
Unable to provision scratch org  1 ..```
However, a scratch org has been created, and with the features as per scratch definition file (I opened scratch orgs and checked randomly a few features) **in both cases**.

sfpowerscripts  -- The DX@Scale CI/CD Orchestrator -Version:13.0.15 -Release:April 22

@azlam-abdulsalam
Copy link
Contributor

Thanks @jonathankretzmer for reporting it to cli team

@azlam-abdulsalam
Copy link
Contributor

@AndreyShestakovACN this issue also happens with object settings as well

@azlam-abdulsalam
Copy link
Contributor

This is fixed in 18.1.3 as part of core v3

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants