sfdx-isv / territory-management-toolkit

The Territory Management Toolkit (TM-Tools) is a Salesforce CLI Plugin that provides tools for simplifying the migration of a Salesforce org from Territory Management (TM1) to Enterprise Territory Management (TM2).
BSD 3-Clause "New" or "Revised" License
9 stars 0 forks source link

Sharing Rules deployment failing (tmtools:tm2:load) #5

Closed VivekMChawla closed 5 years ago

VivekMChawla commented 5 years ago

Deployment of Sharing Rules during tmtools:tm2:load failing because 3 of 7 sharing rules are failing to deploy.

Reasons for failure are unclear because they are GACKs

DeployResult JSON:

"sharingRulesDeployment": {
    "checkOnly": false,
    "completedDate": "2019-08-20T15:22:40.000Z",
    "createdBy": "005S000000IdKjW",
    "createdByName": "User User",
    "createdDate": "2019-08-20T15:22:37.000Z",
    "details": {
        "componentFailures": [
            {
                "changed": false,
                "columnNumber": 27,
                "componentType": "SharingCriteriaRule",
                "created": false,
                "createdDate": "2019-08-20T15:22:39.000Z",
                "deleted": false,
                "fileName": "tm2-sharing-rules-deployment/sharingRules/Opportunity.sharingRules",
                "fullName": "Opportunity.Closed_Oppty_Visibility",
                "lineNumber": 3,
                "problem": "An unexpected error occurred. Please include this ErrorId if you contact support: 1874538978-31212 (-1375477895)",
                "problemType": "Error",
                "success": false
            },
            {
                "changed": false,
                "columnNumber": 27,
                "componentType": "SharingCriteriaRule",
                "created": false,
                "createdDate": "2019-08-20T15:22:39.000Z",
                "deleted": false,
                "fileName": "tm2-sharing-rules-deployment/sharingRules/Account.sharingRules",
                "fullName": "Account.Emerging_Markets",
                "lineNumber": 3,
                "problem": "An unexpected error occurred. Please include this ErrorId if you contact support: 1874538978-31100 (-1375477895)",
                "problemType": "Error",
                "success": false
            },
            {
                "changed": false,
                "columnNumber": 27,
                "componentType": "SharingCriteriaRule",
                "created": false,
                "createdDate": "2019-08-20T15:22:39.000Z",
                "deleted": false,
                "fileName": "tm2-sharing-rules-deployment/sharingRules/Lead.sharingRules",
                "fullName": "Lead.US_Leads",
                "lineNumber": 3,
                "problem": "An unexpected error occurred. Please include this ErrorId if you contact support: 1874538978-31157 (-1375477895)",
                "problemType": "Error",
                "success": false
            }
        ],
        "componentSuccesses": [
            {
                "changed": true,
                "componentType": "",
                "created": false,
                "createdDate": "2019-08-20T15:22:39.000Z",
                "deleted": false,
                "fileName": "tm2-sharing-rules-deployment/package.xml",
                "fullName": "package.xml",
                "success": true
            },
            {
                "changed": true,
                "componentType": "SharingOwnerRule",
                "created": true,
                "createdDate": "2019-08-20T15:22:39.000Z",
                "deleted": false,
                "fileName": "tm2-sharing-rules-deployment/sharingRules/Account.sharingRules",
                "fullName": "Account.MM",
                "id": "00sS000000008COIAY",
                "success": true
            },
            {
                "changed": true,
                "componentType": "SharingOwnerRule",
                "created": true,
                "createdDate": "2019-08-20T15:22:39.000Z",
                "deleted": false,
                "fileName": "tm2-sharing-rules-deployment/sharingRules/Lead.sharingRules",
                "fullName": "Lead.High_Touch_Leads",
                "id": "02AS0000000CcorMAC",
                "success": true
            },
            {
                "changed": true,
                "componentType": "SharingOwnerRule",
                "created": true,
                "createdDate": "2019-08-20T15:22:39.000Z",
                "deleted": false,
                "fileName": "tm2-sharing-rules-deployment/sharingRules/Opportunity.sharingRules",
                "fullName": "Opportunity.High_Touch_Opptys",
                "id": "00uS00000008RvwIAE",
                "success": true
            },
            {
                "changed": true,
                "componentType": "SharingOwnerRule",
                "created": true,
                "createdDate": "2019-08-20T15:22:39.000Z",
                "deleted": false,
                "fileName": "tm2-sharing-rules-deployment/sharingRules/Account.sharingRules",
                "fullName": "Account.High_Touch_US_Assistance",
                "id": "00sS000000008CNIAY",
                "success": true
            }
        ],
        "runTestResult": {
            "numFailures": 0,
            "numTestsRun": 0,
            "totalTime": 0
        }
    },
    "done": true,
    "id": "0AfS000000buG84KAE",
    "ignoreWarnings": false,
    "lastModifiedDate": "2019-08-20T15:22:40.000Z",
    "numberComponentErrors": 3,
    "numberComponentsDeployed": 4,
    "numberComponentsTotal": 7,
    "numberTestErrors": 0,
    "numberTestsCompleted": 0,
    "numberTestsTotal": 0,
    "rollbackOnError": true,
    "runTestsEnabled": false,
    "startDate": "2019-08-20T15:22:37.000Z",
    "status": "Failed",
    "success": false
}
VivekMChawla commented 5 years ago

This has been fixed.

An empty <valueField /> tag was causing the GACK.

Adding logic to prevent writing this tag to SharingCriteriaRule metadata during transformation fixed the issue.