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
486 stars 78 forks source link

sfdx force:source:retrieve -m CustomMetadata fails #457

Closed mshanemc closed 4 years ago

mshanemc commented 4 years ago

Summary

sfdx force:source:retrieve -m CustomMetadata fails against non-scratch orgs

Steps To Reproduce:

Create a non-scratch org and auth to it sfdx force:source:retrieve -m CustomMetadata

I can't reproduce it with a scratch org because the command works against scratch orgs.

Expected result

Source retrieves

Actual result

$ sfdx force:source:retrieve -u platformers -m CustomMetadata ERROR running force:source:retrieve: The "path" argument must be of type string. Received type object

Additional information

Fails against both production and full sandbox Also fails when trying to pull using the OrgBrowser in vscode...same command underneath in the Output sfdx-cli/7.61.0 darwin-x64 node-v12.14.0

$ sfdx plugins --core @mshanemc/sfdx-migration-automatic 0.3.1 (link) /Users/shane.mclaughlin/code/sfdx-migration-automatic @oclif/plugin-autocomplete 0.2.0 @oclif/plugin-commands 1.2.3 (core) @oclif/plugin-not-found 1.2.4 (core) @oclif/plugin-plugins 1.7.10 (core) @oclif/plugin-warn-if-update-available 1.7.0 (core) @oclif/plugin-which 1.0.3 (core) @salesforce/analytics 0.17.0 (link) /Users/shane.mclaughlin/code/sfdx-analytics-plugin @salesforce/lwc-dev-server 2.2.0 ├─ @oclif/plugin-help 2.2.1 └─ @oclif/plugin-update 1.3.9 @salesforce/sfdx-diff 0.0.6 @salesforce/sfdx-trust 3.0.7 (core) analytics 1.7.1 (core) evergreen 0.22.10 └─ evergreen-build 0.11.1 generator 1.1.2 (core) salesforcedx 48.19.0 ├─ @salesforce/sfdx-plugin-lwc-test 0.1.5 ├─ custom-metadata 1.0.1 ├─ salesforce-alm 48.20.0 └─ salesforcedx-templates 48.18.0 sfdx-cli 7.61.0 (core) shane-sfdx-plugins 4.37.1 (link) /Users/shane.mclaughlin/code/shane-sfdx-plugins

OSX 10.15.5 (19F101)

mshanemc commented 4 years ago

I got this to work--it looks like if the cmdt object is in a packageDirectory that isn't the default, and the pull tries to put the CustomMetadata into a different packageDirectory that is the default, you get this error message.

mdonnalley commented 4 years ago

This is no longer reproducible with the latest version of the CLI

banderson5144 commented 3 years ago

How come using this command works sfdx force:source:retrieve -m CustomMetadata but if I specify a wildcard in a package.xml and do sfdx force:source:retrieve -x package.xml I get this error The specified metadata type is unsupported: [Custom?Metadata]

shanerk commented 3 years ago

Note CustomMetadata works but not Custommetadata (case sensitive).

alexferrari88 commented 3 years ago

In package.xml I add:

<types>
   <members>*</​members>
   <name>Custom​Metadata</name>
</types>

This is what the Salesforce documentation suggests. Yet I get the error: ERROR running force:source:retrieve: The specified metadata type is unsupported: [Custom​Metadata]

Using the command sfdx force:source:retrieve -m CustomMetadata as suggested by @banderson5144 here, it works.

This doesn't make much sense...

joelemmer-cko commented 3 years ago

@alexferrari88 Using:

<types>
   <members>*</​members>
   <name>Custom​Metadata</name>
</types>

works for me. It exports all metadata.

It would have been better for me to be able to specify the API name of the particular metadata object, or use some sort of filtering, but that doesn't seem possible.

The only other package.xml configuration that worked was to pull out specific metadata records by specifying their unique fullName. e.g.:

<types>
   <members>MyCustomMetadataObject.uniqueMetadataRecordName</​members>
   <name>Custom​Metadata</name>
</types>