question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

sfdx force:source:retrieve Cannot read property 'metadataName' of undefined

See original GitHub issue

Summary

A particular metadata type added to package.xml causes cannot read property of undefined error

Steps To Reproduce:

  1. Add the below to package.xml file
<types>
    <members>*</members>
    <name>Audience</name>
</types>
  1. sfdx force:source:retrieve --manifest
  2. 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:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:40 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
dencinascommented, Apr 3, 2020

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?

2reactions
rvwatchcommented, Apr 1, 2020

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!

Read more comments on GitHub >

github_iconTop Results From Across the Web

ERROR running force:source:retrieve: Cannot read property ...
I am trying to retrieve the Salesforce metadata in VS Code with the below command, sfdx force:source ...
Read more >
SFDX ERROR: Cannot read property 'fileName' of undefined.
I am getting an error when trying to do a sfdx retrieve: ERROR: Cannot read property 'fileName' of undefined.
Read more >
k test1234 –wait 10 -v DevHub. Please do replace the xxx ...
Cannot retrieve reports and Dashboards via sfdx force:source:retrieve hot 25 Retrieve Source from Org results in "Cannot read property 'describer' of ...
Read more >
salesforce developer - SFDX: Retrieve Source from Org
If the command you run doesn't explicitly mention username/alias - check what happens when you open the default org ( sfdx force:org:open ) ......
Read more >
Unable to retrieve cms managed content type metadata via sdfx
... in my dev org via sfdx, but I'm running into the following error: ERROR running force:source:retrieve: Cannot read property 'metadataName' of undefined...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found