sfdx force:source:retrieve Cannot read property 'metadataName' of undefined
See original GitHub issueSummary
A particular metadata type added to package.xml
causes cannot read property of undefined
error
Steps To Reproduce:
- Add the below to
package.xml
file
<types>
<members>*</members>
<name>Audience</name>
</types>
- sfdx force:source:retrieve --manifest
ERROR running force:source:retrieve: Cannot read property 'metadataName' of undefined
Expected result
Should be able to successfully retrieve org metadata
Actual result
sfdx force:source:retrieve
should successfully execute with no error and return exit code 0
Additional information
Feel free to attach a screenshot.
SFDX CLI Version:
sfdx-cli/7.19.0-c5be43915c win32-x64 node-v10.15.3
SFDX plugin Version
@oclif/plugin-commands 1.2.2 (core) @oclif/plugin-help 2.2.0 (core) @oclif/plugin-not-found 1.2.2 (core) @oclif/plugin-plugins 1.7.8 (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.5 (core) analytics 1.2.1 (core) generator 1.1.0 (core) salesforcedx 46.9.0 (core) ├─ force-language-services 46.13.0 (core) └─ salesforce-alm 46.12.0 (core)
sfdx-cli 7.19.0 (core)
OS and version:
Windows 10 Pro, version 1809, OSBuild 17763.615
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:40 (8 by maintainers)
Top GitHub Comments
Hi,
https://github.com/forcedotcom/cli/issues/151#issuecomment-607497525 We just updated to the latest versin yesterday but still not working.
We´ve been working working with SFDX for a while with Communities, Sales and Services Cloud, and since we udpate the sfdx-cli version we are getting Issues wit the Audiences, we don´t have any Audience define. Right now we have the versión sfdx-cli/7.53.0-839fc82926 win32-x64 node-v10.15.3. The previous versions that was working 7.48. We´ve been testing to run the pull command configuring apiVersion 48.0 and 46.0 and we are gettting the same results in both cases.
Here the errors:
$ sfdx force:source:pull -u dencinasDEVELOP_v2 WARNING: apiVersion configuration overridden at “48.0” ERROR running force:source:pull: You can’t retrieve the default audience.
$ sfdx force:source:pull -u dencinasDEVELOP_v2 --json { “status”: 1, “name”: “RetrieveFailed”, “message”: “You can’t retrieve the default audience.”, “exitCode”: 1, “commandName”: “SourcePullCommand”, “stack”: “RetrieveFailed: You can’t retrieve the default audience.\n at MdapiPullApi._processResults (C:\Users\David Encinas\AppData\Local\sfdx\client\7.53.0-839fc82926\node_modules\salesforce-alm\dist\lib\source\sourcePullApi.js:160:36)\n at MdapiPullApi._postRetrieve (C:\Users\David Encinas\AppData\Local\sfdx\client\7.53.0-839fc82926\node_modules\salesforce-alm\dist\lib\source\sourcePullApi.js:123:21)\n at MdapiPullApi.doPull (C:\Users\David Encinas\AppData\Local\sfdx\client\7.53.0-839fc82926\node_modules\salesforce-alm\dist\lib\source\sourcePullApi.js:86:31)\nOuter stack:\n at Function.wrap (C:\Users\David Encinas\AppData\Local\sfdx\client\7.53.0-839fc82926\node_modules\salesforce-alm\node_modules\@salesforce\core\lib\sfdxError.js:151:27)\n at SourcePullCommand.catch (C:\Users\David Encinas\AppData\Local\sfdx\client\7.53.0-839fc82926\node_modules\salesforce-alm\dist\ToolbeltCommand.js:246:46)”,
“warnings”: [ “apiVersion configuration overridden at "48.0"” ] }`
Any Ideas about when is going to be fixed. Do you have any workaround?
Hey All. Be sure to update to the latest version of the CLI. @AltiusRupert - Audience type should be fixed. I’ve also tested against NetworkBranding and had no issues retrieving it. Same with ConnectedApp.
ManagedContentType is a known issue. We’ve reached out to the team that owns that and hopefully will have a fix in the works soon.
@peternoges The latest version of the CLI will capture this specific error and prompt users to file an issue here. This particular error seems to occur mostly with community types. We’re working on filling our coverage gaps on these now and will hopefully be able to capture these before they become issues for our users soon.
Thanks for your patience!