Skip to content

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

Closed

Description

@stoevie

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@

Activity

  1. 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
  2. lonegroover commented on Jul 10, 2020

    @lonegroover

    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

  3. 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
  4. adrianrodriguezSFDC commented on Jul 16, 2020

    @adrianrodriguezSFDC

    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 👍

  5. keirbowden commented on Jul 16, 2020

    @keirbowden

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

  6. reda-benhemmouche commented on Jul 21, 2020

    @reda-benhemmouche

    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.

  7. rvwatch commented on Jul 21, 2020

    @rvwatch
    Contributor

    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!

  8. gbutt commented on Jul 23, 2020

    @gbutt

    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)
    
  9. brianesel commented on Aug 27, 2020

    @brianesel

    Hello, is there any update on this?

  10. added
    bug
    on Sep 8, 2020
  11. kgkjr commented on Sep 9, 2020

    @kgkjr

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

  12. Gachdel commented on Oct 1, 2020

    @Gachdel

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

  13. ImJohnMDaniel commented on Oct 12, 2020

    @ImJohnMDaniel

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

  14. kgkjr commented on Oct 12, 2020

    @kgkjr

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

  15. abhisheksaxena7 commented on Nov 16, 2020

    @abhisheksaxena7

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

  16. added
    owned by another team
    on Jan 14, 2021
  17. github-actions commented on Jan 14, 2021

    @github-actions

    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.

  18. amphro commented on Jan 14, 2021

    @amphro
    Contributor

    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.

  19. RCMoonpie commented on Apr 1, 2021

    @RCMoonpie

    ...the best way to get Audience added is for everyone with the ability to file a support ticket to do so.

    @amphro : Please elaborate: where are you talking about filing a support ticket? Here on GitHub, directly with Salesforce, or ???

  20. YodaDaCoda commented on Apr 22, 2021

    @YodaDaCoda

    Tried raising a case with Salesforce Support.

    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.

    patch --forward --reject-file - --input "metadataTypeInfos.json.patch" "metadataTypeInfos.json"

    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.

  21. msimonis commented on Oct 19, 2021

    @msimonis

    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.json with no luck. Any other workarounds besides using a metadata deploy and forceignorning audiences?

  22. msimonis commented on Oct 27, 2021

    @msimonis

    I was able to resolve this issue by completely uninstalling sfdx, and removing local configuration (via #470 (comment)), and then re-installing it.

  23. eltoroit commented on Nov 24, 2021

    @eltoroit

    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.

    ➜  ~ sfdx plugins
    @oclif/plugin-autocomplete 0.3.0
    @salesforce/lwc-dev-server 2.11.0
    etcopydata 0.6.6-Beta (link) /Users/aperez/DO NOT BACKUP/GitProjects/ETCopyData
    etgitter 0.0.0 (link) /Users/aperez/DO NOT BACKUP/GitProjects/Current/ETGitterRoot/etgitter
    salesforcedx 52.0.0
    ├─ data 0.4.11
    ├─ apex 0.2.2
    ├─ templates 51.5.0
    ├─ custom-metadata 1.0.12
    ├─ @salesforce/sfdx-plugin-lwc-test 0.1.7
    ├─ limits 1.2.1
    ├─ schema 1.0.7
    ├─ org 1.6.6
    ├─ user 1.3.0
    └─ salesforce-alm 52.0.0
    

    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.

  24. shetzel commented on Nov 29, 2021

    @shetzel
    Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugowned by another team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions