forcedotcom / cli

Salesforce CLI
https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/
BSD 3-Clause "New" or "Revised" License
488 stars 78 forks source link

Unable to deploy AccountRelationshipShareRule metadata with force:source:deploy #334

Closed crooms closed 2 years ago

crooms commented 4 years ago

Summary

When running sfdx force:source:deploy of a folder that contains AccountRelationshipShareRule metadata, sfdx fails with error ERROR running force:source:deploy: Unexpected file found in package directory:

If you run sfdx force:source:convert to convert to mdapi format, and deploy using sfdx force:mdap:deploy it works correctly.

Steps To Reproduce:

  1. Run sfdx force:source:deploy with a folder path that includes AccountRelationshipShareRule metadata.

Expected result

Command should pass and metadata is deployed.

Actual result

Errors with ERROR running force:source:deploy: Unexpected file found in package directory: C:\sample\app\main\default\accountRelationshipShareRules\AccountSharing.accountRelationshipShareRule

Additional information

As mentioned, works with mdapi deployment.

SFDX CLI Version(to find the version of the CLI engine run sfdx --version):

sfdx-cli/7.49.1-2b6ba86a25 win32-x64 node-v10.15.3

SFDX plugin Version(to find the version of the CLI plugin run sfdx plugins --core)

@oclif/plugin-autocomplete 0.1.5 (core)
@oclif/plugin-commands 1.2.3 (core)
@oclif/plugin-help 2.2.3 (core)
@oclif/plugin-not-found 1.2.3 (core)
@oclif/plugin-plugins 1.7.9 (core)
@oclif/plugin-update 1.3.9 (core)
@oclif/plugin-warn-if-update-available 1.7.0 (core)
@oclif/plugin-which 1.0.3 (core)
@salesforce/sfdx-trust 3.0.7 (core)
analytics 1.7.1 (core)
generator 1.1.2 (core)
salesforcedx 48.4.1 (core)
├─ @salesforce/sfdx-plugin-lwc-test 0.1.5 (core)
├─ salesforcedx-templates 48.5.0 (core)
└─ salesforce-alm 48.6.0 (core)

sfdx-cli 7.49.1 (core)

OS and version: Windows 10

crooms commented 4 years ago

As a workaround, we tried to use force:source:convert to convert the source into metadata API, but that command error'd with the same error as force:source:deploy

`ERROR running force:source:convert: Unexpected file found in package directory: C:\sample\app\main\default\accountRelationshipShareRules\AccountSharing.accountRelationshipShareRule

JAertgeerts commented 3 years ago

Even retrieving this using sfdx force:source:retrieve causes issues:

sfdx force:source:retrieve --json --loglevel fatal -m AccountRelationshipShareRule
{
  "status": 1,
  "name": "UnsupportedType",
  "message": "The specified metadata type is unsupported: [AccountRelationshipShareRule]",
  "exitCode": 1,
  "commandName": "SourceRetrieveCommand",
  "stack": "UnsupportedType: The specified metadata type is unsupported: [AccountRelationshipShareRule]\n    at Function.create (/Users/jan/.local/share/sfdx/client/7.82.0-3d0c527ac6/node_modules/salesforce-alm/node_modules/@salesforce/core/lib/sfdxError.js:160:16)\n    at /Users/jan/.local/share/sfdx/client/7.82.0-3d0c527ac6/node_modules/salesforce-alm/dist/lib/source/sourceElementsResolver.js:46:40\n    at Array.forEach (<anonymous>)\n    at SourceElementsResolver.parseTypeNamePairs (/Users/jan/.local/share/sfdx/client/7.82.0-3d0c527ac6/node_modules/salesforce-alm/dist/lib/source/sourceElementsResolver.js:42:23)\n    at SourceElementsResolver.getSourceElementsFromManifest (/Users/jan/.local/share/sfdx/client/7.82.0-3d0c527ac6/node_modules/salesforce-alm/dist/lib/source/sourceElementsResolver.js:32:21)\n    at SourceRetrieve.retrieveFromManifest (/Users/jan/.local/share/sfdx/client/7.82.0-3d0c527ac6/node_modules/salesforce-alm/dist/lib/source/sourceRetrieve.js:97:43)\n    at SourceRetrieve.retrieve (/Users/jan/.local/share/sfdx/client/7.82.0-3d0c527ac6/node_modules/salesforce-alm/dist/lib/source/sourceRetrieve.js:61:27)\n    at SourceRetrieveCommand.execute (/Users/jan/.local/share/sfdx/client/7.82.0-3d0c527ac6/node_modules/salesforce-alm/dist/lib/source/sourceRetrieveCommand.js:32:16)\n    at SourceRetrieveCommand.execLegacyCommand (/Users/jan/.local/share/sfdx/client/7.82.0-3d0c527ac6/node_modules/salesforce-alm/dist/ToolbeltCommand.js:149:29)\n    at SourceRetrieveCommand.run (/Users/jan/.local/share/sfdx/client/7.82.0-3d0c527ac6/node_modules/salesforce-alm/dist/commands/force/source/retrieve.js:32:16)\n    at SourceRetrieveCommand._run (/Users/jan/.local/share/sfdx/client/7.82.0-3d0c527ac6/node_modules/@salesforce/command/lib/sfdxCommand.js:93:40)\n    at Config.runCommand (/Users/jan/.local/share/sfdx/client/7.82.0-3d0c527ac6/node_modules/@oclif/config/lib/config.js:173:24)\n    at Main.run (/Users/jan/.local/share/sfdx/client/7.82.0-3d0c527ac6/node_modules/@oclif/command/lib/main.js:27:9)\n    at Main._run (/Users/jan/.local/share/sfdx/client/7.82.0-3d0c527ac6/node_modules/@oclif/command/lib/command.js:43:20)\n    at Object.run (/Users/jan/.local/share/sfdx/client/7.82.0-3d0c527ac6/dist/cli.js:32:20)",
  "warnings": []
}
mshanemc commented 2 years ago

This type is supported in the newer deploy/retrieve commands. Is the error gone?

no-response[bot] commented 2 years ago

This issue has been automatically closed because there has been no response to our request for more information from the original author. Currently, there is not enough information provided for us to take action. Please reply and reopen this issue if you need additional assistance.