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

sf project deploy quick returns SfError.wrap received type object but expects type Error or string #2962

Closed MarcDBehr closed 1 month ago

MarcDBehr commented 1 month ago

Note Before you submit your issue, make sure that:

  • You're using the latest version of Salesforce CLI.
  • You've searched both open and closed issues for related posts.
  • You've used the doctor command to diagnose common issues.
  • You understand that GitHub Issues don't adhere to any agreement or SLA.
    • If you require immediate assistance, use official channels such as Salesforce Customer Support.

Summary

After running a validate command and getting back the id for a quick deploy, if the quick deploy can't be run (something else happened in the org post the validate), a SfError.Wrap l message is displayed.

Steps To Reproduce

  1. Validate an deployment (sf project deploy start -d force-app/main/default/classes/ -o [org])
  2. Deploy a different change to the same org (thus invalidating the previous validation)
  3. Now attempt to deploy the change from step 1 (sf project deploy quick --job-id 0AfO800000XXXXXXXX -o [org])

Expected result

An error message that says the quick deploy failed

Actual result

Got the following message:

Error (CannotQuickDeployError): SfError.wrap received type object but expects type Error or string

System Information

bash

{
  "architecture": "darwin-arm64",
  "cliVersion": "@salesforce/cli/2.50.6",
  "nodeVersion": "node-v20.15.0",
  "osVersion": "Darwin 23.5.0",
  "rootPath": "/Users/xxx/.local/share/sf/client/2.50.6-6e9d7f7",
  "shell": "bash",
  "pluginVersions": [
    "@dxatscale/sfpowerscripts 25.5.3 (user)",
    "@oclif/plugin-autocomplete 3.1.6 (core)",
    "@oclif/plugin-commands 3.3.4 (user)",
    "@oclif/plugin-help 5.2.17 (user)",
    "@oclif/plugin-not-found 3.2.10 (core)",
    "@oclif/plugin-plugins 5.3.4 (core)",
    "@oclif/plugin-search 1.2.2 (core)",
    "@oclif/plugin-update 4.4.7 (core)",
    "@oclif/plugin-version 2.2.6 (core)",
    "@oclif/plugin-warn-if-update-available 3.1.8 (core)",
    "@oclif/plugin-which 3.2.6 (core)",
    "@salesforce/analytics 1.4.22 (user)",
    "@salesforce/cli 2.50.6 (core)",
    "apex 3.2.4 (core)",
    "auth 3.6.33 (core)",
    "data 3.5.5 (core)",
    "deploy-retrieve 3.9.13 (core)",
    "info 3.3.17 (core)",
    "limits 3.3.17 (core)",
    "marketplace 1.2.17 (core)",
    "org 4.3.4 (core)",
    "packaging 2.7.0 (core)",
    "schema 3.3.19 (core)",
    "settings 2.3.8 (core)",
    "sobject 1.4.19 (core)",
    "source 3.5.3 (core)",
    "telemetry 3.6.1 (core)",
    "templates 56.3.2 (core)",
    "trust 3.7.13 (core)",
    "user 3.5.17 (core)"
  ]
}

Additional information

github-actions[bot] commented 1 month 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.

MarcDBehr commented 1 month ago

If I try to deploy code with conflicts, I also get a similar error:

Error (1): SfError.wrap received type object but expects type Error or string

So the error may be in the error handler (SfError.wrap) code

git2gus[bot] commented 1 month ago

This issue has been linked to a new work item: W-16297490

mshanemc commented 1 month ago

good bug report, let's get that fixed.