Cli: Audience: Unexpected file found in package with V7.65.2+

Created on 10 Jul 2020  路  15Comments  路  Source: forcedotcom/cli

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

*SFDX plugin Version
@oclif/plugin-autocomplete 0.1.5 (core)
@oclif/plugin-commands 1.3.0 (core)
@oclif/plugin-help 3.0.1 (core)
@oclif/plugin-not-found 1.2.4 (core)
@oclif/plugin-plugins 1.7.10 (core)
@oclif/plugin-update 1.3.10 (core)
@oclif/plugin-warn-if-update-available 1.7.0 (core)
@oclif/plugin-which 1.0.3 (core)
@salesforce/sfdx-trust 3.0.7 (core)
analytics 1.12.0 (core)
generator 1.1.3 (core)
salesforcedx 48.22.1 (core)
鈹溾攢 @salesforce/sfdx-plugin-lwc-test 0.1.5 (core)
鈹溾攢 salesforcedx-templates 48.18.0 (core)
鈹溾攢 custom-metadata 1.0.4 (core)
鈹斺攢 salesforce-alm 48.23.0 (core)
sfdx-cli 7.65.2 (core)

OS and version:
Windows 10 - 1909

Edit:

Work number for reference @W-7853917@

bug owned by another team

Most helpful comment

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):

sudo rm -rf /usr/local/sfdx
sudo rm -rf /usr/local/lib/sfdx
sudo rm -rf /usr/local/bin/sfdx
sudo rm -rf ~/.local/share/sfdx ~/.config/sfdx ~/.cache/sfdx
sudo rm -rf ~/Library/Caches/sfdx

And this one to install the v7.63.0:

sudo npm install [email protected] --global

Hope that helps 馃憤

All 15 comments

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

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):

sudo rm -rf /usr/local/sfdx
sudo rm -rf /usr/local/lib/sfdx
sudo rm -rf /usr/local/bin/sfdx
sudo rm -rf ~/.local/share/sfdx ~/.config/sfdx ~/.cache/sfdx
sudo rm -rf ~/Library/Caches/sfdx

And this one to install the v7.63.0:

sudo npm install [email protected] --global

Hope that helps 馃憤

Seeing the same thing here. Adding entries to .forceignore for the audience metadata doesn't help.

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 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:

salesforcedx 48.19.0 (48.19.0)
鈹溾攢 salesforce-alm 48.20.0
鈹溾攢 custom-metadata 1.0.7
鈹溾攢 @salesforce/sfdx-plugin-lwc-test 0.1.5
鈹斺攢 salesforcedx-templates 48.18.0
sfdx-cli 7.65.6 (core)

Hello, is there any update on this?

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 },

This is an annoying problem. I will try to check kgkjr solution!

@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.

Did some testing on windows SFDX CLI "Audience" doesn't work 7.65.0 onward till 7.83.0.

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.

Was this page helpful?
0 / 5 - 0 ratings