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

Can't push when labels file is removed #3070

Open geoffswift opened 2 days ago

geoffswift commented 2 days ago

Summary

If I decide I don't want the labels in example.labels-meta.xml any longer, I would expect to be able to simply delete the file.

When I try to push this change with sf project deploy start the cli fails:

Error (MetadataTransferError): Metadata API request failed: force-app/main/default/labels/example.labels-meta.xml: File or folder not found

Steps To Reproduce

Expected result

The deploy succeeds with the labels which were in the labels file are removed from the org.

Actual result

The push fails with:

Error (MetadataTransferError): Metadata API request failed: force-app/main/default/labels/team.labels-meta.xml: File or folder not found

Additional information

The problem is actually worse than described. I might have a git branch where a new labels file is added. If I deploy that branch but then switch back to trying to deploy main, then I can't because the file is similarly deleted by git.

Issue may not be limited to labels metadata.

System Information

{
  "architecture": "darwin-arm64",
  "cliVersion": "@salesforce/cli/2.61.8",
  "nodeVersion": "node-v20.12.0",
  "osVersion": "Darwin 24.0.0",
  "rootPath": "/Users/gswift@financialforce.com/src/cpm/node_modules/@salesforce/cli",
  "shell": "bash",
  "pluginVersions": [
    "@oclif/plugin-autocomplete 3.2.5 (core)",
    "@oclif/plugin-commands 4.0.16 (core)",
    "@oclif/plugin-help 6.2.13 (core)",
    "@oclif/plugin-not-found 3.2.22 (core)",
    "@oclif/plugin-plugins 5.4.10 (core)",
    "@oclif/plugin-search 1.2.10 (core)",
    "@oclif/plugin-update 4.5.10 (core)",
    "@oclif/plugin-version 2.2.14 (core)",
    "@oclif/plugin-warn-if-update-available 3.1.18 (core)",
    "@oclif/plugin-which 3.2.15 (core)",
    "@salesforce/analytics 1.4.26 (link) /Users/gswift@financialforce.com/src/cpm/node_modules/@salesforce/analytics",
    "@salesforce/cli 2.61.8 (core)",
    "apex 3.5.0 (core)",
    "api 1.2.2 (core)",
    "auth 3.6.65 (core)",
    "community 3.2.35 (link) /Users/gswift@financialforce.com/src/cpm/node_modules/@salesforce/plugin-community",
    "data 3.6.8 (core)",
    "deploy-retrieve 3.12.15 (core)",
    "info 3.4.9 (core)",
    "limits 3.3.32 (core)",
    "marketplace 1.2.26 (core)",
    "org 4.6.0 (core)",
    "packaging 2.8.10 (core)",
    "schema 3.3.34 (core)",
    "settings 2.3.23 (core)",
    "sobject 1.4.40 (core)",
    "source 3.5.21 (core)",
    "telemetry 3.6.15 (core)",
    "templates 56.3.21 (core)",
    "trust 3.7.32 (core)",
    "user 3.5.32 (core)"
  ]
}
github-actions[bot] commented 2 days ago

Thank you for filing this issue. We appreciate your feedback and will review the issue as soon as possible. Remember, however, that GitHub isn't a mechanism for receiving support under any agreement or SLA. If you require immediate assistance, contact Salesforce Customer Support.

github-actions[bot] commented 2 days ago

Hello @geoffswift :wave: None of the versions of sf you shared match the latest release.

Shared: 2.61.8 Latest: 2.62.6

Update to the latest version of Salesforce CLI (docs) and confirm that you're still seeing your issue. You can also try the rc and nightly releases! (docs)

After updating, share the full output of sf version --verbose --json

geoffswift commented 2 days ago

Issue is still reproducible with 2.62.6

System Information

{
  "architecture": "darwin-arm64",
  "cliVersion": "@salesforce/cli/2.62.6",
  "nodeVersion": "node-v20.12.0",
  "osVersion": "Darwin 24.0.0",
  "rootPath": "/Users/gswift@financialforce.com/src/cpm/node_modules/@salesforce/cli",
  "shell": "bash",
  "pluginVersions": [
    "@oclif/plugin-autocomplete 3.2.5 (core)",
    "@oclif/plugin-commands 4.1.3 (core)",
    "@oclif/plugin-help 6.2.14 (core)",
    "@oclif/plugin-not-found 3.2.22 (core)",
    "@oclif/plugin-plugins 5.4.14 (core)",
    "@oclif/plugin-search 1.2.11 (core)",
    "@oclif/plugin-update 4.6.3 (core)",
    "@oclif/plugin-version 2.2.14 (core)",
    "@oclif/plugin-warn-if-update-available 3.1.18 (core)",
    "@oclif/plugin-which 3.2.15 (core)",
    "@salesforce/analytics 1.4.26 (link) /Users/gswift@financialforce.com/src/cpm/node_modules/@salesforce/analytics",
    "@salesforce/cli 2.62.6 (core)",
    "apex 3.5.1 (core)",
    "api 1.3.1 (core)",
    "auth 3.6.65 (core)",
    "community 3.2.35 (link) /Users/gswift@financialforce.com/src/cpm/node_modules/@salesforce/plugin-community",
    "data 3.7.0 (core)",
    "deploy-retrieve 3.12.17 (core)",
    "info 3.4.9 (core)",
    "limits 3.3.32 (core)",
    "marketplace 1.2.26 (core)",
    "org 4.6.0 (core)",
    "packaging 2.8.11 (core)",
    "schema 3.3.34 (core)",
    "settings 2.3.23 (core)",
    "sobject 1.4.41 (core)",
    "source 3.5.21 (core)",
    "telemetry 3.6.15 (core)",
    "templates 56.3.22 (core)",
    "trust 3.7.33 (core)",
    "user 3.5.32 (core)"
  ]
}