4

Problem

Need to figure out how to install Salesforce EDA through Salesforce CI in a Scratch org by running sfdx force:package:install so that CI tools can automatically test packages dependent on EDA by installing EDA through Salesforce CLI first.

Workaround

A known functioning workaround is to install EDA through a web browser by going to the EDA installation URL and installing in the Scratch org after obtaining the username/password via sfdx force:user:password:generate (as answered in this earlier question)

Prerequisites

The account defaultRecordType must be set as documented in the Scratch Org Definition File and mentioned by Anmol Kumar in the answer below:

config/project-scratch-def.json

{
  "orgName": "Demo company",
  "edition": "Developer",
  "features": [],
  "settings": {
    "lightningExperienceSettings": {
      "enableS1DesktopEnabled": true
    },
    "securitySettings": {
      "passwordPolicies": {
        "enableSetPasswordInApi": true
      }
    },
    "mobileSettings": {
      "enableS1EncryptedStoragePref2": false
    },
    "chatterSettings" : {
      "enableChatter": true
    }  
    
  },
  "objectSettings": {
    "account": {
       "defaultRecordType": "default"
    }
 }
}

This fixes the error below:

Waiting for the package install request to complete. Status = IN_PROGRESS
ERROR:  Encountered errors installing the package!,Installation errors:
1) Accounts Missing Organization Feature: Account.RecordType
ERROR running force:package:install:  Installation errors:
1) Accounts Missing Organization Feature: Account.RecordType

Observed Behavior

When I execute

sfdx force:package:install --loglevel=trace -p 04t1R000001E42DQAS -u contact-heda-scratch -w 5 

on the command prompt the following error message is displayed:

Waiting for the package install request to complete. Status = IN_PROGRESS (x 20 times)
ERROR:  Encountered errors installing the package!,Installation errors:
1) Unexpected Error, Details: The package installation failed. Please provide the following information to the publisher:  Organization Name: Demo company Organization ID: 00D1g0000009r0f Package: EDA Version: 1.103 Error Message: The post install script failed.
ERROR running force:package:install:  Installation errors:
1) Unexpected Error, Details: The package installation failed. Please provide the following information to the publisher:  Organization Name: Demo company Organization ID: 00D1g0000009r0f Package: EDA Version: 1.103 Error Message: The post install script failed.

What I've tried so far

Inspecting EDA Post Install Script in Github
I tried taking a peek at the Post Install Script for EDA in Github here: https://github.com/SalesforceFoundation/EDA/blob/05f9e29fab56250f6bf48b2e50cadf9ab78da6ed/src/classes/STG_InstallScript.cls

Unfortunately, without clearer error messaging I can't figure out where the problem lies.

Successfully Installed EDA through Chrome

I've managed to successfully install EDA through the EDA installer link in Chrome. After doing that I was able to retrieve the Package Version ID by running sfdx force:package:installed:list

ID                  Package ID          Package Name  Namespace  Package Version ID  Version Name  Version
──────────────────  ──────────────────  ────────────  ─────────  ──────────────────  ────────────  ──────────
0A31k0000000fYiCAI  03336000000DlP2AAK  EDA           hed        04t1R000001E42DQAS  Release       1.103.0.12

The log messages from the successful installation (through Chrome) are given below:

2020-08-29 03:11:07 Options:
2020-08-29 03:11:07   dependencies: [{'ref': '5612c7aef1a9a9356fca3c67c9bedbee0c45bb7f', 'repo_name': 'EDA', 'subfolder': 'unpackaged/pre/acc_record_types', 'repo_owner': 'SalesforceFoundation'}]
2020-08-29 03:11:07   namespaced_org: False
2020-08-29 03:11:07   purge_on_delete: True
2020-08-29 03:11:07   include_beta: False
2020-08-29 03:11:07   allow_newer: True
2020-08-29 03:11:07   allow_uninstalls: False
2020-08-29 03:11:07   security_type: FULL
2020-08-29 03:11:08 Org info updated, writing to keychain
2020-08-29 03:11:08 Beginning task: UpdateDependencies
2020-08-29 03:11:08 
2020-08-29 03:11:08 Preparing static dependencies map
2020-08-29 03:11:08 Dependencies:
2020-08-29 03:11:08   - ref: 5612c7aef1a9a9356fca3c67c9bedbee0c45bb7f
2020-08-29 03:11:08     repo_name: EDA
2020-08-29 03:11:08     repo_owner: SalesforceFoundation
2020-08-29 03:11:08     subfolder: unpackaged/pre/acc_record_types
2020-08-29 03:11:08 Deploying unmanaged metadata from /unpackaged/pre/acc_record_types of SalesforceFoundation/EDA
2020-08-29 03:11:09 Pending
2020-08-29 03:11:10 [InProgress]: Processing Type: CustomObject
2020-08-29 03:11:11 [InProgress]: Processing Type: CustomObject
2020-08-29 03:11:12 [InProgress]: Processing Type: CustomObjectTranslation
2020-08-29 03:11:14 [Done]
2020-08-29 03:11:15 [Success]: Succeeded
Metadata
Metadata
Required
completed
2020-08-29 03:11:15 Options:
2020-08-29 03:11:15   dependencies: [{'ref': '5612c7aef1a9a9356fca3c67c9bedbee0c45bb7f', 'repo_name': 'EDA', 'subfolder': 'unpackaged/pre/contact_key_affl_fields', 'repo_owner': 'SalesforceFoundation'}]
2020-08-29 03:11:15   namespaced_org: False
2020-08-29 03:11:15   purge_on_delete: True
2020-08-29 03:11:15   include_beta: False
2020-08-29 03:11:15   allow_newer: True
2020-08-29 03:11:15   allow_uninstalls: False
2020-08-29 03:11:15   security_type: FULL
2020-08-29 03:11:17 Org info updated, writing to keychain
2020-08-29 03:11:17 Beginning task: UpdateDependencies
2020-08-29 03:11:17 
2020-08-29 03:11:17 Preparing static dependencies map
2020-08-29 03:11:17 Dependencies:
2020-08-29 03:11:17   - ref: 5612c7aef1a9a9356fca3c67c9bedbee0c45bb7f
2020-08-29 03:11:17     repo_name: EDA
2020-08-29 03:11:17     repo_owner: SalesforceFoundation
2020-08-29 03:11:17     subfolder: unpackaged/pre/contact_key_affl_fields
2020-08-29 03:11:17 Deploying unmanaged metadata from /unpackaged/pre/contact_key_affl_fields of SalesforceFoundation/EDA
2020-08-29 03:11:17 Pending
2020-08-29 03:11:18 [InProgress]: Processing Type: CustomObject
2020-08-29 03:11:19 [InProgress]: Processing Type: CustomObject
2020-08-29 03:11:21 [Done]
2020-08-29 03:11:22 [Success]: Succeeded
Metadata
Metadata
Required
completed
2020-08-29 03:11:22 Options:
2020-08-29 03:11:22   name: EDA
2020-08-29 03:11:22   namespace: hed
2020-08-29 03:11:22   version: 1.103
2020-08-29 03:11:22   activateRSS: True
2020-08-29 03:11:22   retries: 5
2020-08-29 03:11:22   retry_interval: 5
2020-08-29 03:11:22   retry_interval_add: 30
2020-08-29 03:11:22   security_type: FULL
2020-08-29 03:11:23 Org info updated, writing to keychain
2020-08-29 03:11:24 Beginning task: InstallPackageVersion
2020-08-29 03:11:24 
2020-08-29 03:11:24 Installing EDA release: 1.103
2020-08-29 03:11:24 Pending
2020-08-29 03:11:24 [Pending]: next check in 1 seconds
2020-08-29 03:11:26 [InProgress]: Processing Type: InstalledPackage (x 144 times)
...
2020-08-29 03:14:48 [InProgress]: Processing Type: InstalledPackage
2020-08-29 03:14:49 [InProgress]: Processing Type: InstalledPackage
2020-08-29 03:14:50 [InProgress]: next check in 1 seconds
2020-08-29 03:14:52 [Done]
2020-08-29 03:14:53 [Success]: Succeeded
Managed Package
Managed Package
Required
completed
2020-08-29 03:14:53 Options:
2020-08-29 03:14:53   dependencies: [{'ref': '5612c7aef1a9a9356fca3c67c9bedbee0c45bb7f', 'repo_name': 'EDA', 'subfolder': 'unpackaged/post/case_behavior_record_types', 'unmanaged': False, 'repo_owner': 'SalesforceFoundation', 'filename_token': '___NAMESPACE___', 'namespace_token':     '%%%NAMESPACE%%%', 'namespace_inject': 'hed'}]
2020-08-29 03:14:53   namespaced_org: False
2020-08-29 03:14:53   purge_on_delete: True
2020-08-29 03:14:53   include_beta: False
2020-08-29 03:14:53   allow_newer: True
2020-08-29 03:14:53   allow_uninstalls: False
2020-08-29 03:14:53   security_type: FULL
2020-08-29 03:14:54 Org info updated, writing to keychain
2020-08-29 03:14:54 Beginning task: UpdateDependencies
2020-08-29 03:14:54 
2020-08-29 03:14:54 Preparing static dependencies map
2020-08-29 03:14:54 Dependencies:
2020-08-29 03:14:54   - filename_token: ___NAMESPACE___
2020-08-29 03:14:54     namespace_inject: hed
2020-08-29 03:14:54     namespace_token: %%%NAMESPACE%%%
2020-08-29 03:14:54     ref: 5612c7aef1a9a9356fca3c67c9bedbee0c45bb7f
2020-08-29 03:14:54     repo_name: EDA
2020-08-29 03:14:54     repo_owner: SalesforceFoundation
2020-08-29 03:14:54     subfolder: unpackaged/post/case_behavior_record_types
2020-08-29 03:14:54 Deploying unmanaged metadata from /unpackaged/post/case_behavior_record_types of SalesforceFoundation/EDA
2020-08-29 03:14:55 Replacing namespace tokens with hed__
2020-08-29 03:14:55   objects/Case.object: Replaced %%%NAMESPACE%%% with "hed__"
2020-08-29 03:14:55 Pending
2020-08-29 03:14:56 [InProgress]: Processing Type: CustomObject
2020-08-29 03:14:57 [InProgress]: Processing Type: CustomObject
2020-08-29 03:14:59 [InProgress]: Processing Type: CustomObject
2020-08-29 03:15:00 [InProgress]: next check in 1 seconds
2020-08-29 03:15:02 [Done]
2020-08-29 03:15:03 [Success]: Succeeded
Metadata
Metadata
Required
completed
2020-08-29 03:15:03 Options:
2020-08-29 03:15:03   dependencies: [{'ref': '5612c7aef1a9a9356fca3c67c9bedbee0c45bb7f', 'repo_name': 'EDA', 'subfolder': 'unpackaged/post/course_connection_record_types', 'unmanaged': False, 'repo_owner': 'SalesforceFoundation', 'filename_token': '___NAMESPACE___', 'namespace_token':     '%%%NAMESPACE%%%', 'namespace_inject': 'hed'}]
2020-08-29 03:15:03   namespaced_org: False
2020-08-29 03:15:03   purge_on_delete: True
2020-08-29 03:15:03   include_beta: False
2020-08-29 03:15:03   allow_newer: True
2020-08-29 03:15:03   allow_uninstalls: False
2020-08-29 03:15:03   security_type: FULL
2020-08-29 03:15:04 Org info updated, writing to keychain
2020-08-29 03:15:04 Beginning task: UpdateDependencies
2020-08-29 03:15:04 
2020-08-29 03:15:04 Preparing static dependencies map
2020-08-29 03:15:04 Dependencies:
2020-08-29 03:15:04   - filename_token: ___NAMESPACE___
2020-08-29 03:15:04     namespace_inject: hed
2020-08-29 03:15:04     namespace_token: %%%NAMESPACE%%%
2020-08-29 03:15:04     ref: 5612c7aef1a9a9356fca3c67c9bedbee0c45bb7f
2020-08-29 03:15:04     repo_name: EDA
2020-08-29 03:15:04     repo_owner: SalesforceFoundation
2020-08-29 03:15:04     subfolder: unpackaged/post/course_connection_record_types
2020-08-29 03:15:04 Deploying unmanaged metadata from /unpackaged/post/course_connection_record_types of SalesforceFoundation/EDA
2020-08-29 03:15:05 Replacing namespace tokens with hed__
2020-08-29 03:15:05   objectTranslations/___NAMESPACE___Course_Enrollment__c-ca.objectTranslation: renamed to objectTranslations/hed__Course_Enrollment__c-ca.objectTranslation
2020-08-29 03:15:05   objectTranslations/___NAMESPACE___Course_Enrollment__c-en_GB.objectTranslation: renamed to objectTranslations/hed__Course_Enrollment__c-en_GB.objectTranslation
2020-08-29 03:15:05   objectTranslations/___NAMESPACE___Course_Enrollment__c-es.objectTranslation: renamed to objectTranslations/hed__Course_Enrollment__c-es.objectTranslation
2020-08-29 03:15:05   objectTranslations/___NAMESPACE___Course_Enrollment__c-es_MX.objectTranslation: renamed to objectTranslations/hed__Course_Enrollment__c-es_MX.objectTranslation
2020-08-29 03:15:05   objectTranslations/___NAMESPACE___Course_Enrollment__c-fr.objectTranslation: renamed to objectTranslations/hed__Course_Enrollment__c-fr.objectTranslation
2020-08-29 03:15:05   objects/___NAMESPACE___Course_Enrollment__c.object: renamed to objects/hed__Course_Enrollment__c.object
2020-08-29 03:15:05   package.xml: Replaced %%%NAMESPACE%%% with "hed__"
2020-08-29 03:15:05 Pending
2020-08-29 03:15:05 [InProgress]: Processing Type: CustomObject
2020-08-29 03:15:07 [Done]
2020-08-29 03:15:08 [Success]: Succeeded
Metadata
Metadata
Required
completed
2020-08-29 03:15:08 Options:
2020-08-29 03:15:08   dependencies: [{'ref': '5612c7aef1a9a9356fca3c67c9bedbee0c45bb7f', 'repo_name': 'EDA', 'subfolder': 'unpackaged/post/facility_display_name', 'unmanaged': False, 'repo_owner': 'SalesforceFoundation', 'filename_token': '___NAMESPACE___', 'namespace_token': '%%%NAMESPACE%%%',     'namespace_inject': 'hed'}]
2020-08-29 03:15:08   namespaced_org: False
2020-08-29 03:15:08   purge_on_delete: True
2020-08-29 03:15:08   include_beta: False
2020-08-29 03:15:08   allow_newer: True
2020-08-29 03:15:08   allow_uninstalls: False
2020-08-29 03:15:08   security_type: FULL
2020-08-29 03:15:10 Org info updated, writing to keychain
2020-08-29 03:15:10 Beginning task: UpdateDependencies
2020-08-29 03:15:10 
2020-08-29 03:15:10 Preparing static dependencies map
2020-08-29 03:15:10 Dependencies:
2020-08-29 03:15:10   - filename_token: ___NAMESPACE___
2020-08-29 03:15:10     namespace_inject: hed
2020-08-29 03:15:10     namespace_token: %%%NAMESPACE%%%
2020-08-29 03:15:10     ref: 5612c7aef1a9a9356fca3c67c9bedbee0c45bb7f
2020-08-29 03:15:10     repo_name: EDA
2020-08-29 03:15:10     repo_owner: SalesforceFoundation
2020-08-29 03:15:10     subfolder: unpackaged/post/facility_display_name
2020-08-29 03:15:10 Deploying unmanaged metadata from /unpackaged/post/facility_display_name of SalesforceFoundation/EDA
2020-08-29 03:15:10 Replacing namespace tokens with hed__
2020-08-29 03:15:10   objectTranslations/___NAMESPACE___Facility__c-ca.objectTranslation: renamed to objectTranslations/hed__Facility__c-ca.objectTranslation
2020-08-29 03:15:10   objectTranslations/___NAMESPACE___Facility__c-en_GB.objectTranslation: renamed to objectTranslations/hed__Facility__c-en_GB.objectTranslation
2020-08-29 03:15:10   objectTranslations/___NAMESPACE___Facility__c-es.objectTranslation: renamed to objectTranslations/hed__Facility__c-es.objectTranslation
2020-08-29 03:15:10   objectTranslations/___NAMESPACE___Facility__c-es_MX.objectTranslation: renamed to objectTranslations/hed__Facility__c-es_MX.objectTranslation
2020-08-29 03:15:10   objectTranslations/___NAMESPACE___Facility__c-fr.objectTranslation: renamed to objectTranslations/hed__Facility__c-fr.objectTranslation
2020-08-29 03:15:10   objects/___NAMESPACE___Facility__c.object: Replaced %%%NAMESPACE%%% with "hed__"
2020-08-29 03:15:10   objects/___NAMESPACE___Facility__c.object: renamed to objects/hed__Facility__c.object
2020-08-29 03:15:10   package.xml: Replaced %%%NAMESPACE%%% with "hed__"
2020-08-29 03:15:10 Pending
2020-08-29 03:15:11 [InProgress]: Processing Type: CustomObject
2020-08-29 03:15:13 [Done]
2020-08-29 03:15:14 [Success]: Succeeded

enter image description here

3 Answers 3

2

Disclosure: I am a member of the Salesforce.org Release Engineering team

The source of truth for how to install and set up any Salesforce.org product is its CumulusCI automation. CumulusCI is a free and open source build orchestration tool on top of Salesforce DX, and is created and maintained by Salesforce.org. The recommended route to build scratch orgs for Salesforce.org products, including EDA, is to use CumulusCI; the process of building a project, such as another managed package, on top of a product like EDA or NPSP is taught in our Trailhead module, Build Applications with CumulusCI.

If you do not wish to use CumulusCI, you can review the product's automation to determine how to compose a sequence of Salesforce DX commands to prepare your scratch org. Because EDA does not have managed package dependencies, this would consist of deploying the contents of EDA's unpackaged/pre directory from its GitHub repository. However, the product's setup automation may change, and we recommend using CumulusCI to consume the automation we define directly.

3

Looks like a known issue

Please specify a defaultRecordType in your scratch org definition file

config/project-scratch-def.json

{
    "orgName": "MyCompany",
    "edition": "Developer",
    "objectSettings": {
        "account": {
            "defaultRecordType": "default"
        }
    }
}
3
  • I've tried your steps and they did resolve the initial error I was seeing. However, now the post installation script fails. I've updated the question to point out the new error I'm seeing. PS: I think your config snippet is actually from the config/project-scratch-def.json file right?
    – Omair Inam
    Aug 29, 2020 at 11:55
  • yes, it should be project-scratch-def.json. you may need to raise a case with Appexchange product team to get more information as post-install script failure is mostly because of the product Aug 29, 2020 at 12:07
  • I've posted a question on the powerofushub for EDA here. Is that what you were referring to or should I be going to a different website to raise a case?
    – Omair Inam
    Aug 29, 2020 at 12:52
2

Disclosure: I am part of the EDA team at Salesforce.

I also formally suggest using CumulusCI to managed installing EDA. It is what we use to spin up our scratch orgs.

EDA has a number of unpackaged dependencies prior to install. The install script utilizes those dependencies to appropriately configure an EDA org and will explicitly fail without some of them.

Please investigate the CumulusCI plan install from a recent pull of the repo to see the steps that the installer currently uses.

You must log in to answer this question.

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