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

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

Closed nebc-jasonfung closed 4 years ago

nebc-jasonfung commented 5 years ago

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
* Audience
  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

clairebianchi commented 5 years ago

@tbg-jasonfung run DEBUG=* sfdx force:source:retrieve with whatever other params you want to add and that will give you the stack trace.

no-response[bot] commented 5 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.

ivorocha90 commented 4 years ago

I'm working on a community project using SFDX and I'm facing this issue too. As soon as I place the Audience metadata in package.xml and perform a source retrieve, I got the same error message as mentioned by the OP.

Trying to create the files manually, and then refresh them with "SFDX: Retrieve source from Org" gives the error: "Unexpected file found in package directory".

Also tried to retrieve the Audiences via Workbench, then performed a mdapi:convert command and an error is thrown too. It just seems that SFDX-CLI does not support the Audience metadata files.

I can provide more details if needed.

Thanks.

ybiyani commented 4 years ago

I am facing the same issue but cannot determine the cause of the error @clairebianchi can I send you the file for review?

clairebianchi commented 4 years ago

@ybiyani I have added this to our backlog, we have confirmed it is a bug.

RupertBarrow commented 4 years ago

I discovered that this does not behave identically when API version 47.0 or 46.0 are mentioned in the package.xml file :

matiasalessandrinitn commented 4 years ago

I tested that

I discovered that this does not behave identically when API version 47.0 or 46.0 are mentioned in the package.xml file :

* API 46.0 produces OK result

* API 47.0 generates the "ERROR running force:source:retrieve:  Cannot read property 'metadataName' of undefined" error message

I tested that and I still having the same issue. If I run sfdx:force:source:pull I get this message "No source tracking support for type: Audience. For details, visit https://developer.salesforce.com/docs/metadata-coverage and select your API version. Skipping..."

rvwatch commented 4 years ago

@tbg-jasonfung Trying to dig into this one and struggling to repro the exact issue. Would you or anyone else in this thread be able to set up a generic repo with your set-up that causes this retrieve issue?

Thanks!

nebc-jasonfung commented 4 years ago

@rvwatch Our codebase has changed quite a bit since I logged this ticket - however I'm able to reproduce the problem with a different metadata included in package.xml:

<types>
    <members>*</members>
    <name>NetworkBranding</name>
</types>

Here is the debug log:

 sfdx:SourceWorkspaceAdapter DEBUG retrievedContentPath: C:\Users\jason\AppData\Local\Temp\sdx_sourceRetrieve_1578581516478\unpackaged\networkBranding\cbWebsite.networkBranding +0ms
  sfdx:SourceWorkspaceAdapter DEBUG processMdapiFileProperty retrieveRoot: C:\Users\jason\AppData\Local\Temp\sdx_sourceRetrieve_1578581516478 +1ms
  sfdx:SourceWorkspaceAdapter DEBUG processMdapiFileProperty aggregateFullName: cbCharities +0ms
  sfdx:SourceWorkspaceAdapter DEBUG processMdapiFileProperty aggregateMetadataPath: undefined +1ms
  sfdx:SourceWorkspaceAdapter DEBUG processMdapiFileProperty this.forceIgnore.accepts(aggregateMetadataPath): true +0ms
  sfdx:SourceWorkspaceAdapter DEBUG processMdapiFilePropertykey: NetworkBranding__cbCharities +0ms
  sfdx:SourceWorkspaceAdapter DEBUG processMdapiFileProperty aggregateSourceElement.retrievedMetadataPath: C:\Users\jason\AppData\Local\Temp\sdx_sourceRetrieve_1578581516478\unpackages
  sfdx:SourceWorkspaceAdapter DEBUG retrievedContentPath: C:\Users\jason\AppData\Local\Temp\sdx_sourceRetrieve_1578581516478\unpackaged\networkBranding\cbCharities.networkBranding +0m
  sfdx:SourceWorkspaceAdapter DEBUG processMdapiFileProperty retrieveRoot: C:\Users\jason\AppData\Local\Temp\sdx_sourceRetrieve_1578581516478 +1ms
  sfdx:core TRACE Setup child 'SourceUtil' logger instance +10s
ERROR running force:source:retrieve:  Cannot read property 'metadataName' of undefined
  sfdx:SourceRetrieveCommand ERROR [ '\u001b[1mERROR running force:source:retrieve: \u001b[22m',
  sfdx:SourceRetrieveCommand   '\u001b[31mCannot read property \'metadataName\' of undefined\u001b[39m' ] +2m
  sfdx:analytics Sending cmd error log: { commandName: 'force:source:retrieve',
  commandParams: 'manifest,loglevel,wait',
  commandTimestamp: 1578581511014,
  hubOrgId: '',
  toolbeltVersion: '7.36.0-b1c4e9c7c8 47.10.0',
  sourceApiVersion: '47.0',
  origin: 'sfdx-cli/7.36.0-b1c4e9c7c8 win32-x64 node-v10.15.3',
  artifactName: '<GDPR_HIDDEN>',
  orgType: 'unknown',
  errorName: 'TypeError',
  errorMessage: '<GDPR_HIDDEN>',
  errorStack: '<GDPR_HIDDEN>',
  __errorWhitelist__: undefined } +2m
  sfdx:core TRACE Setup child 'SpawnedTelemetry' logger instance +0ms
  sfdx:SpawnedTelemetry DEBUG 'SFDX_DISABLE_INSIGHTS': false +0ms
  sfdx:SpawnedTelemetry WARN Insights logging in enabled. This can be disabled by setting SFDX_DISABLE_INSIGHTS=true +1ms
  sfdx:SpawnedTelemetry DEBUG starting child process +1ms
  sfdx:SpawnedTelemetry DEBUG child process started at PID: 23364 +58ms
  sfdx:SpawnedTelemetry DEBUG Waiting 3000 ms to stop child process +0ms
  sfdx:core TRACE Setup child 'TelemetryReporter' logger instance +0ms
  sfdx:TelemetryReporter DEBUG 'SFDX_DISABLE_INSIGHTS': false +0ms
  sfdx:TelemetryReporter WARN Insights logging in enabled. This can be disabled by setting SFDX_DISABLE_INSIGHTS=true +1ms
  sfdx:TelemetryReporter DEBUG creating appInsightsClient +1ms
  sfdx:SpawnedTelemetry DEBUG stopping child process +3s
  sfdx:SpawnedTelemetry DEBUG Stopped child process +2ms
  lazy-require saving type cache to C:\Users\jason\AppData\Local\sfdx\module-types.json +2m
  lazy-require no changes to save +0ms
  sfdx:analytics using C:\Users\jason\AppData\Local\sfdx\analytics.log for usage error logging +3s
  sfdx:analytics spawned usage " C:\Users\jason\AppData\Local\sfdx\client\7.36.0-b1c4e9c7c8\bin\node.exe C:\Users\jason\AppData\Local\sfdx\client\7.36.0-b1c4e9c7c8\node_modules\@salesforce\plugin-analytics\lib\processes\logUsage " +44ms

I hope the above is useful

rvwatch commented 4 years ago

Thanks, @tbg-jasonfung ! I'll give that a try.

svinuesa commented 4 years ago

Hello,

I am having the same issue with ManagedContentType

sfdx force:source:retrieve -m ManagedContentType ERROR running force:source:retrieve: Cannot read property 'metadataName' of undefined 15:19:51.186 sfdx force:source:retrieve -m ManagedContentType ended with exit code 1

Thanks,

kvijay460 commented 4 years ago

Hello,

I am having the same issue with ManagedContentType

sfdx force:source:retrieve -m ManagedContentType ERROR running force:source:retrieve: Cannot read property 'metadataName' of undefined 15:19:51.186 sfdx force:source:retrieve -m ManagedContentType ended with exit code 1

Thanks,

This could be valid error because I see ManagedContentType is not yet supported until Metadata Version 48. Here's the supported components list: https://developer.salesforce.com/docs/metadata-coverage/48

svinuesa commented 4 years ago

Hello, I am having the same issue with ManagedContentType sfdx force:source:retrieve -m ManagedContentType ERROR running force:source:retrieve: Cannot read property 'metadataName' of undefined 15:19:51.186 sfdx force:source:retrieve -m ManagedContentType ended with exit code 1 Thanks,

This could be valid error because I see ManagedContentType is not yet supported until Metadata Version 48. Here's the supported components list: https://developer.salesforce.com/docs/metadata-coverage/48

Thank you @kvijay460 ! This is helpful link.

rvwatch commented 4 years ago

@tbg-jasonfung I've tried to repro this issue on both mac and windows and so far haven't had any problems running source:retrieve against any of the mentioned types. Would you or anyone else in this thread be willing to send over a generic repo that can consistently reproduce this issue or potentially send over the contents of your scratch-def.json file as well? The debug is missing the actual error output so it's difficult to track this one down.

ulistaerk commented 4 years ago

Same here. Reducing the metadata from 47 to 46 fixes this issue and returns: === WARNING: The following metadata isn’t in your org. If it’s not new, someone deleted it from the org. Entity type 'xxx' is not available in this api version You do not have the proper permissions to access Layout.

sfdx-cli/7.36.0-b1c4e9c7c8 win32-x64 node-v10.15.3

highered1 commented 4 years ago

Can confirm same result and that changing the API version to 46 in the package.xml file solved the problem.

Error message in VSCode was the following: Cannot read property Metadataname of undefined.

kristualdandamudi commented 4 years ago

Same issue Happened while retrieve Audience Metadata.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">    
    <types>
    <members>xxxx</members>
    <members>xxxx123</members>
    <members>xxx369</members>
    <members>xxxx36988</members>
    <name>Audience</name>
   </types>
    <version>46.0</version>
</Package>

version : sfdx-cli/7.43.1-ef237e8b37 win32-x64 node-v10.15.3 Error: sfdx force:source:retrieve -x manifest/package.xml ERROR running force:source:retrieve: Cannot read property 'metadataName' of undefined

rvwatch commented 4 years ago

Unfortunately, I've been unable to replicate this issue locally. I'm concerned I'm missing a specific step in regards to how you're running/creating communities and then setting up an Audience or Network Branding type that might be the key for a repro of this issue.

FYI, I've been using this example repo: https://github.com/trailheadapps/ebikes-lwc. I'm able to auth to my dev hub, spin up a scratch org, open that scratch org and create a community and a Network Branding type via UI, then retrieve that type to my local project without a problem.

Let me know what I need to change in this setup or if I need to be approaching this from a different angle.

Thanks for your patience and help with this!

@tbg-jasonfung @kristualdandamudi @highered1 @ulistaerk ?

nebc-jasonfung commented 4 years ago

Unfortunately, I've been unable to replicate this issue locally. I'm concerned I'm missing a specific step in regards to how you're running/creating communities and then setting up an Audience or Network Branding type that might be the key for a repro of this issue.

FYI, I've been using this example repo: https://github.com/trailheadapps/ebikes-lwc. I'm able to auth to my dev hub, spin up a scratch org, open that scratch org and create a community and a Network Branding type via UI, then retrieve that type to my local project without a problem.

Let me know what I need to change in this setup or if I need to be approaching this from a different angle.

Thanks for your patience and help with this!

@tbg-jasonfung @kristualdandamudi @highered1 @ulistaerk ?

@rvwatch I've realised your repo doesn't contain a package.xml file or a Manifest directory - think to reproduce the issue it shouldn't be spinning up a scratch org?

rvwatch commented 4 years ago

I've also been simply creating my own package.xml file with the updated entries as described and ran multiple retrieves against it. I'll attempt a "manifest" project as well, but I'm fairly certain the results will be the same. Hopefully, I'm wrong and it triggers the error! That would be a great direction to head if so.

rvwatch commented 4 years ago

@tbg-jasonfung or @kristualdandamudi , How are you going about setting up your audience types? I'd like to see a detailed breakdown I can follow so I'm matching your process.

kristualdandamudi commented 4 years ago

@rvwatch , i am not using scratch org, so i already community exist in my sandbox. so i trying to pull all meta data related my community by using below package.xml. with below command: sfdx force:source:retrieve --manifest c:\Users\xxx\Documents\SFDX\abc\manifest\package.xml

`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">   
    <types>
    <members>abc</members>
    <name>CustomSite</name>
  </types>
  <types>
    <members>abc</members>
    <name>Network</name>
  </types>
  <types>
    <members>abc1</members>
    <name>SiteDotCom</name>
  </types>
  <types>
    <members>xxxx</members>
    <members>xxxx123</members>
    <members>xxx369</members>
    <members>xxxx36988</members>
    <name>Audience</name>
   </types>
   <types>
        <members>cbabc</members>
        <name>NetworkBranding</name>
    </types>
 <version>46.0</version>
</Package>`

result : ERROR running force:source:retrieve: Cannot read property 'metadataName' of undefined

then i removed Audience meta data types from package.xml then tried with same pull command result: Now i got all community metadata files.

tedka commented 4 years ago

as others have stated - seems to be an issue with v47, changing to 46 works...

rbeachHYP commented 4 years ago

So I was running into this issue with ManagedContentType and was in fact able to include it if I used version 46 in my package.xml manifest file but was not able to include it if I changed the version to 47 or 48 (even though the API I'm retrieving from is 48).

I'm confused as to why it's working when I change to 46 because if I'm reading the Metadata Coverage webpage correctly, it's saying that ManagedContentType is NOT supported in 46 but IS supported in 47 and 48, no? The checkmarks on that page indicate supported, not unsupported, no?

nebc-jasonfung commented 4 years ago

@tbg-jasonfung or @kristualdandamudi , How are you going about setting up your audience types? I'd like to see a detailed breakdown I can follow so I'm matching your process.

@rvwatch I've just had a look at our orgs communities set up and followed this guide to get our audience type set up. It doesn't appear that we have any! Sorry that I can't help any further.

rvwatch commented 4 years ago

UPDATE: source:retrieve should work with the Audience type after this week's release. We're still hitting some issues with source:pull and the Audience type, but this will hopefully be taken care of soon. In the meantime, we've updated the error messaging for this issue to be a bit more clear with steps for the users to take.

Thanks for your patience and the help tracking this one down! We should have any remaining gaps for types like this filled soon.

samkarnati commented 4 years ago

I would be interested with the new Salesforce CLI release for Audience

AltiusRupert commented 4 years ago

Hi Ricardo (@rvwatch), I've spotted the same problem with the following metadata types :

Will your change fix all these ?

peternoges commented 4 years ago

I notice it with ManagedContentType. How would a salesforce developer using vscode and sfdx 'know' which metadata type(s) cause this generic error during sfdx force:source:retrieve? Can we get more verbose logs somehow during a retrieve? I tried setting --loglevel DEBUG however the terminal still showed me the generic error as :

{"name":"sfdx","hostname":"DESKTOP-MYID","pid":MYPID,"log":"SourceRetrieveCommand","level":50,"msg":"[\n 'ERROR running force:source:retrieve: ',\n \"Cannot read property 'metadataName' of undefined\"\n]","time":"2020-03-18T19:11:05.180Z","v":0}

Furthermore, ~/.sfdx/sfdx.log was refreshed as expected during my attempt but doesnt show me any finer detail about the error, so sadly I dont know which metadatatypes are causing retrieve failures.

Thanks for the info,

rvwatch commented 4 years ago

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!

dencinas commented 4 years ago

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?

rebekamaia commented 4 years ago

Hi,

#151 (comment) 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?

Same here.

SFDX version: sfdx-cli/7.53.0-839fc82926 win32-x64 node-v10.15.3

Error:

sfdx force:source:pull --json { "status": 1, "name": "RetrieveFailed", "message": "Não é possível recuperar o público padrão.", "commandName": "SourcePullCommand", "stack": "RetrieveFailed: Não é possível recuperar o público padrão.\n at MdapiPullApi._processResults (C:\Users\rebeka.franca\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\rebeka.franca\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\rebeka.franca\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\rebeka.franca\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\rebeka.franca\AppData\Local\sfdx\client\7.53.0-839fc82926\node_modules\salesforce-alm\dist\ToolbeltCommand.js:246:46)",
"warnings": [] }

Someone has any workaround?

Thanks! :)

luizfaleiro commented 4 years ago

I'm having the exact same issue as @dencinas . I've tried to downgrade the SFDX plugins, but the error persistis. Does anyone came up with a workaround already? Thanks in advance!

luizfaleiro commented 4 years ago

Hi,

#151 (comment) 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?

I've found a workaround that allowed me to pull from my scratch org. I uninstalled Salesforce CLI from my computer then I installed again from https://developer.salesforce.com/tools/sfdxcli (version 7.36.0). A warning saying "No source format support for type Audience..." is displayed, but I was able to run sfdx force:source:pull. Not ideal, but it works for now.

lsaggu commented 4 years ago

I'm having issues as well with ManagedContentType - I've tried every which way to retrieve via VSCode and Workbench. Workbench shows me the following error:

Metadata API received improper input. Please ensure file name and capitalization is correct. Load of metadata from db failed for metadata of type:ManagedContentType and file name:news.

Good to know that ManagedContentType is being looked into @rvwatch.

RupertBarrow commented 4 years ago

CMSConnectSource

Here is another one :

ERROR running force:source:retrieve: We can’t retrieve the specified metadata object: CMSConnectSource. Certain metadata types, like CMSConnectSource are not currently supported by the CLI.

with SFDX version

sfdx-cli/7.53.0-839fc82926 darwin-x64 node-v10.15.3

pablogrs commented 4 years ago

I am getting the same with the latest cli

sfdx update
sfdx-cli: Updating CLI from 7.53.0-839fc82926 to 7.54.4-8ff9ba9cc5... done

I get

sfdx force:source:pull -f -u test-@example.com
ERROR running force:source:pull:  You can’t retrieve the default audience
erocheleau commented 4 years ago

Seems that this issue is the dump of all the metadata not supported errors? I've run into the problem described here: https://github.com/forcedotcom/cli/issues/351

And it was closed as a duplicate of this issue even if the symptoms are not the same.

I'm getting this error message:

Entity type 'WaveApplication' is not available in this organization
Entity type 'WaveDataflow' is not available in this organization
Entity type 'WaveDashboard' is not available in this organization
Entity type 'WaveDataset' is not available in this organization
Entity type 'WaveXmd' is not available in this organization

I tried disabling Einstein Analytics in my scratch org but it still won't work with sfdx force:source:pull

ChuckJonas commented 4 years ago

FYI, If you start getting this host undefined error on every command it could be due to an installed plugin. sfdx plugin:uninstall anything you have recently added and it may go away.

amphro commented 4 years ago

This thread is too hard to follow now and is starting to be used as a catch-all. The audience problem is tracked in #470 and for any other metadata types with similar issues, point to an existing issue for that type or create a new issue with reproducing steps and repository.