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

Push fails with "Expected file at path: force-app\main\core\ReadMe.md-meta.xml" when ReadMe.md files are added under force-app directory #691

Closed pk1772 closed 3 years ago

pk1772 commented 3 years ago

Summary

After updating cli version to 7.76.1 running force:source:push fails with the following error - ERROR running force:source:push: Expected file at path: C:\Users\pk1772\Documents\Dev\force-app\main\core\ReadMe.md-meta.xml

Steps To Reproduce:

  1. Add "*/ReadMe." to .forceignore file.
  2. Add a ReadMe.md file in the under force-app\ directory
  3. Run sfdx force:source:push to push the changes

Expected result

It should not treat ReadMe.md file as custom metadata and it should be ignored as defined in .forceignore

Actual result

sfdx force:source:push fails with:

ERROR running force:source:push: Expected file at path: C:\Users\pk1772\Documents\Dev\force-app\main\core\ReadMe.md-meta.xml

Additional information

SFDX CLI Version

sfdx-cli/7.76.1-f301d5641f win32-x64 node-v12.18.3

SFDX plugin Version

@oclif/plugin-autocomplete 0.1.5 (core) @oclif/plugin-commands 1.3.0 (core) @oclif/plugin-help 3.2.0 (core) @oclif/plugin-not-found 1.2.4 (core) @oclif/plugin-plugins 1.9.1 (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.4.3 (core) alias 1.1.2 (core) analytics 1.12.1 (core) config 1.1.9 (core) generator 1.1.3 (core) salesforcedx 50.1.1 (core) ├─ custom-metadata 1.0.10 (core) ├─ templates 50.1.0 (core) ├─ salesforce-alm 50.1.1 (core) ├─ @salesforce/sfdx-plugin-lwc-test 0.1.7 (core) └─ apex 0.1.1 (core) sfdx-cli 7.76.1 (core)

OS and version image

shetzel commented 3 years ago

@pk1772 - I tried to reproduce this on windows with the same plugin versions and it ignored the ReadMe.md file. That said, there are others reporting problems with forceignore behavior (see #684 and #690) and we are addressing them. The fixes will go into the next release candidate update either today or tomorrow.

One thing you can try to debug this is to modify the installed files to find out why it's not being ignored. Depending on how you installed the CLI the source is in different locations. For a default installer installation, the files will be within a path like, C:\Users\pk1772\AppData\local\sfdx and the file you're looking for is forceIgnore.js. I would add debugging to ensure the proper forceignore file is being used and the filepath passed to denies/accepts is correct.

shetzel commented 3 years ago

@pk1772 - I left some details in the other issues about how this is happening. I'm going to close this one but please reference the others for those details. Thanks for reporting!

reddykrupananda commented 2 years ago

@shetzel I'm encountering the same issue, here is the toolset inforamtion

VERSION sfdx-cli/7.125.0 win32-x64 node-v16.13.0 @salesforce/analytics 1.0.1 @salesforce/sfdx-scanner 2.12.0 isvte-sfdx-plugin 1.1.12