You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Audience: Unexpected file found in package with V7.65.2+ #470
bugIssue or pull request that identifies or fixes a bugowned by another teamThe Salesforce CLI team does not own this work but will pass on the information to the correct team.
This morning, when I pushed our metadata to an empty scratch-org, I got this error:
ERROR running force:source:push: Unexpected file found in package directory: C:\Projects\SF\force-app\main\default\audience\Default_abc.audience-meta.xml
yesterday with the same metadata no problem.
When I rollback to sfdx-cli/7.63.0-c897e8bb1a win32-x64 node-v10.20.1 there is no problem
Steps To Reproduce:
sfdx force:source:push -u scrchorg
Expected result
no error and all metadata pushed correctly
Actual result
ERROR running force:source:push: Unexpected file found in package directory: C:\Projects\SF\force-app\main\default\audience\Default_abc.audience-meta.xml
Additional information
SFDX CLI Version
sfdx-cli/7.65.2-0f0403b8cc win32-x64 node-v10.21.0
changed the title [-]sfdx push - Unaxpected file found in package with V7.65.2[/-][+]sfdx push - Unexpected file found in package with V7.65.2[/+]on Jul 10, 2020
We have the same issue, also with audience files. Fails with V7.65.2 but worked fine with earlier versions. Deploying the audience files using force:mdapi:deploy works fine. We've hit the problem on MacOs and Linux
changed the title [-]sfdx push - Unexpected file found in package with V7.65.2[/-][+]Audience: Unexpected file found in package with V7.65.2+[/+]on Jul 15, 2020
Reacted by Victor Garcia Zarco, Keir Bowden, yilingz10, Nerea Leguinazabal, Reda, Jose Carlos Diaz, mbarbarelli, testname, Dave Humm, Zakaria SEMRI and 1 more
I get the same error with the command: sfdx force:source:convert -r force-app/main/default/ -d src/
Thanks @arcsalesforce 👍 for the solution, it works for me.
The Audience type was removed from the CLI as a result of some breaking changes that were introduced after it was turned on. The Audience type owners have been notified and are currently working on a "known issues" doc for this type and will also begin working on a fix for this. The ETA on that fix is still unknown.
In the meantime, you should be able to get past the deploy issues by adding this to your .forceignore: **/audience/Default_<your audience type name>.audience-meta.xml
On pull/retrieve, it will display the error message but should ultimately skip the audience type and pull the rest of the files properly.
mdapi:retrieve and deploy should also be viable options for this type in the meantime, but those haven't been fully validated.
Let me know if either doesn't work for you. Thanks for your patience!
I think I have identified the root cause.
The metadataTypeInfos.json file is missing the Audience information.
file is located at: sfdx\client\7.73.2-feef087df8\node_modules\salesforce-alm\metadata
If you add the following to the file the Audience information will transmit during deploy.
@kgkjr -- Are there any other files that might need to be changed? The solution that you proposed does not appear to work in the 7.75.1-5585088c75 client on MacOS.
@clairebianchi -- Is there any update that you can share on this one?
@kgkjr -- Are there any other files that might need to be changed? The solution that you proposed does not appear to work in the 7.75.1-5585088c75 client on MacOS.
I am unfamiliar with the MacOS SFDX CLI and have not used the 7.75 version yet, so unsure if something was changed in the structure.
@clairebianchi
Do we have any update on the status of this issue? Due to the Audience metadata type, this has to be a manual step for all the deployments and I am unable to automate its deployment.
We have determined that the issue you reported exists in code owned by another team that uses only the official support channels. To ensure that your issue is addressed, open an official Salesforce customer support ticket with a link to this issue. We encourage anyone experiencing this issue to do the same to increase the priority. We will keep this issue open for the community to collaborate on.
I know how widespread and how frustrating this issue is. For whatever reason, we are getting big pushback from the team that owns this entity. It is less than ideal, but the best way to get Audience added is for everyone with the ability to file a support ticket to do so.
Salesforce has different support departments and the question raised here falls within our Developer Support. Our records indicate that your account is entitled to Standard Support and therefore we need to direct you to our Developer Support forums where there is a wealth of information to assist you.
Gee, thanks Salesforce.
If you can find your metadataTypeInfos.json file, you can apply this patch file with the following command to get audience deployments working again. Not sure if the audience section has been removed from the metadataTypeInfos for a reason, but putting it back in works for me.
NB: sometimes there's a metadataTypeInfos.json inside the .sfdx folder in your repo. Modifying this file doesn't seem to work for me. You've gotta find the file from the installed salesforce-alm node module that the sfdx command is using. Updating sfdx will mean you need to patch the metadataTypeInfos again.
From what I can tell, the metadataTypeInfos.json file simply tells sfdx how to decompose the monolithic xml retrieved from Salesforce's SOAP endpoints into multiple separate files (e.g. decomposing an object's metadata into fields, recordTypes, listViews, etc) and how to re-compose it again for a deployment. Given the audience section seems to specify that audience metadata is not decomposed, I highly doubt there's any downsides to adding the section back.
We are getting this error message when trying to do a pull from a scratch org:
ERROR running force:source:pull: You can't retrieve the default audience.
This error message prevents pulling any other type of metadata!
Actually, two of my peers are getting that error quite consistently but I never get it. We checked out versions, plugins, etc and we found my computer shows these extensions which are not shown on their computers.
I asked them to install the salesforcedx plugin, but they can't install it because it has been deprecated and is not installable anymore. So I ask them to install an old version of sfdx by first following the steps here #470 comment to completely remove sfdx and then install sudo npm install -g [email protected].
That version (7.87.0) gives a slightly different message:
We can’t retrieve the specified metadata object: Audience. Certain metadata types, like Default are not currently supported by the CLI.
File a bug here: https://github.com/forcedotcom/cli/issues and provide the name of the unsupported metadata type
This means that we are not able to pull the audience (we would need to retrieve it) but we are able to pull other metadata!!
If we go back to the current version (7.127.0) the error comes back. I have asked one of my peers to do an sfdx plugins:install salesforcedx while on 7.87.0 before the update to 7.127.0 and see if it breaks again, so far it's looking promising.
@eltoroit - If you are on a recent CLI version then you cannot have the salesforcedx plugin installed. I would install the latest version of the CLI and make sure that plugin is not listed. If it is, then run sfdx plugins:uninstall salesforcedx. I believe the @salesforce/lwc-dev-server plugin is known to cause problems with CLI versions so you might want to try uninstalling that plugin as well.
The Audience metadata type is now supported by push/pull and deploy/retrieve in the latest CLI versions and plugins so ensure you are using them and it should work.
bugIssue or pull request that identifies or fixes a bugowned by another teamThe Salesforce CLI team does not own this work but will pass on the information to the correct team.
Activity
[-]sfdx push - Unaxpected file found in package with V7.65.2[/-][+]sfdx push - Unexpected file found in package with V7.65.2[/+]lonegroover commentedon Jul 10, 2020
We have the same issue, also with audience files. Fails with V7.65.2 but worked fine with earlier versions. Deploying the audience files using force:mdapi:deploy works fine. We've hit the problem on MacOs and Linux
[-]sfdx push - Unexpected file found in package with V7.65.2[/-][+]Audience: Unexpected file found in package with V7.65.2+[/+]adrianrodriguezSFDC commentedon Jul 16, 2020
Facing the same issue here. We have downgraded temporarily to version 7.63.0.
Type the following commands to uninstall the current version (taken from here):
And this one to install the v7.63.0:
Hope that helps 👍
keirbowden commentedon Jul 16, 2020
Seeing the same thing here. Adding entries to .forceignore for the audience metadata doesn't help.
reda-benhemmouche commentedon Jul 21, 2020
I get the same error with the command:
sfdx force:source:convert -r force-app/main/default/ -d src/Thanks @arcsalesforce 👍 for the solution, it works for me.
rvwatch commentedon Jul 21, 2020
The Audience type was removed from the CLI as a result of some breaking changes that were introduced after it was turned on. The Audience type owners have been notified and are currently working on a "known issues" doc for this type and will also begin working on a fix for this. The ETA on that fix is still unknown.
In the meantime, you should be able to get past the deploy issues by adding this to your .forceignore:
**/audience/Default_<your audience type name>.audience-meta.xmlOn pull/retrieve, it will display the error message but should ultimately skip the audience type and pull the rest of the files properly.
mdapi:retrieve and deploy should also be viable options for this type in the meantime, but those haven't been fully validated.
Let me know if either doesn't work for you. Thanks for your patience!
gbutt commentedon Jul 23, 2020
I rolled back the salesforcedx plugin version from 48.22.x to 48.19.0 and that resolved this error (and several others I don't recall at the moment.)
Here are my versions:
brianesel commentedon Aug 27, 2020
Hello, is there any update on this?
kgkjr commentedon Sep 9, 2020
I think I have identified the root cause.
The metadataTypeInfos.json file is missing the Audience information.
file is located at: sfdx\client\7.73.2-feef087df8\node_modules\salesforce-alm\metadata
If you add the following to the file the Audience information will transmit during deploy.
"Audience": { "metadataName": "Audience", "isAddressable": true, "isSourceTracked": true, "ext": "audience", "hasContent": false, "defaultDirectory": "audience", "nameForMsgs": "Audience", "nameForMsgsPlural": "Audiences", "contentIsBinary": false, "hasStandardMembers": false, "deleteSupported": true, "decompositionConfig": { "strategy": "nonDecomposed", "workspaceStrategy": "nonDecomposed", "commitStrategy": "fineGrainTracking", "metadataName": "Audience", "useSparseComposition": false, "decompositions": [], "contentStrategy": "nonDecomposedContent" }, "hasVirtualSubtypes": false },Gachdel commentedon Oct 1, 2020
This is an annoying problem. I will try to check kgkjr solution!
ImJohnMDaniel commentedon Oct 12, 2020
@kgkjr -- Are there any other files that might need to be changed? The solution that you proposed does not appear to work in the 7.75.1-5585088c75 client on MacOS.
@clairebianchi -- Is there any update that you can share on this one?
kgkjr commentedon Oct 12, 2020
I am unfamiliar with the MacOS SFDX CLI and have not used the 7.75 version yet, so unsure if something was changed in the structure.
abhisheksaxena7 commentedon Nov 16, 2020
@clairebianchi
Do we have any update on the status of this issue? Due to the Audience metadata type, this has to be a manual step for all the deployments and I am unable to automate its deployment.
github-actions commentedon Jan 14, 2021
We have determined that the issue you reported exists in code owned by another team that uses only the official support channels. To ensure that your issue is addressed, open an official Salesforce customer support ticket with a link to this issue. We encourage anyone experiencing this issue to do the same to increase the priority. We will keep this issue open for the community to collaborate on.
amphro commentedon Jan 14, 2021
I know how widespread and how frustrating this issue is. For whatever reason, we are getting big pushback from the team that owns this entity. It is less than ideal, but the best way to get Audience added is for everyone with the ability to file a support ticket to do so.
RCMoonpie commentedon Apr 1, 2021
@amphro : Please elaborate: where are you talking about filing a support ticket? Here on GitHub, directly with Salesforce, or ???
YodaDaCoda commentedon Apr 22, 2021
Tried raising a case with Salesforce Support.
Gee, thanks Salesforce.
If you can find your
metadataTypeInfos.jsonfile, you can apply this patch file with the following command to get audience deployments working again. Not sure if theaudiencesection has been removed from the metadataTypeInfos for a reason, but putting it back in works for me.patch --forward --reject-file - --input "metadataTypeInfos.json.patch" "metadataTypeInfos.json"NB: sometimes there's a
metadataTypeInfos.jsoninside the.sfdxfolder in your repo. Modifying this file doesn't seem to work for me. You've gotta find the file from the installedsalesforce-almnode module that thesfdxcommand is using. Updatingsfdxwill mean you need to patch the metadataTypeInfos again.From what I can tell, the
metadataTypeInfos.jsonfile simply tells sfdx how to decompose the monolithic xml retrieved from Salesforce's SOAP endpoints into multiple separate files (e.g. decomposing an object's metadata into fields, recordTypes, listViews, etc) and how to re-compose it again for a deployment. Given the audience section seems to specify that audience metadata is not decomposed, I highly doubt there's any downsides to adding the section back.msimonis commentedon Oct 19, 2021
Is there any update on this issue? We are running into this issue with the latest version of the CLI on a Windows 10 environment.
We have tried updating the
metadataTypeInfos.jsonwith no luck. Any other workarounds besides using a metadata deploy and forceignorning audiences?msimonis commentedon Oct 27, 2021
I was able to resolve this issue by completely uninstalling sfdx, and removing local configuration (via #470 (comment)), and then re-installing it.
eltoroit commentedon Nov 24, 2021
We are getting this error message when trying to do a pull from a scratch org:
ERROR running force:source:pull: You can't retrieve the default audience.This error message prevents pulling any other type of metadata!
Actually, two of my peers are getting that error quite consistently but I never get it. We checked out versions, plugins, etc and we found my computer shows these extensions which are not shown on their computers.
I asked them to install the
salesforcedxplugin, but they can't install it because it has been deprecated and is not installable anymore. So I ask them to install an old version of sfdx by first following the steps here #470 comment to completely remove sfdx and then installsudo npm install -g [email protected].That version (7.87.0) gives a slightly different message:
This means that we are not able to
pullthe audience (we would need toretrieveit) but we are able topullother metadata!!If we go back to the current version (7.127.0) the error comes back. I have asked one of my peers to do an
sfdx plugins:install salesforcedxwhile on 7.87.0 before the update to 7.127.0 and see if it breaks again, so far it's looking promising.shetzel commentedon Nov 29, 2021
@eltoroit - If you are on a recent CLI version then you cannot have the salesforcedx plugin installed. I would install the latest version of the CLI and make sure that plugin is not listed. If it is, then run
sfdx plugins:uninstall salesforcedx. I believe the@salesforce/lwc-dev-serverplugin is known to cause problems with CLI versions so you might want to try uninstalling that plugin as well.The Audience metadata type is now supported by push/pull and deploy/retrieve in the latest CLI versions and plugins so ensure you are using them and it should work.