forcedotcom / salesforcedx-vscode

Salesforce Extensions for VS Code
https://developer.salesforce.com/tools/vscode
BSD 3-Clause "New" or "Revised" License
954 stars 406 forks source link

When I "deploy this source to org" and the deploy fails it no longer shows the errors in the panel. #1411

Closed tophertoy closed 5 years ago

tophertoy commented 5 years ago

Summary

When I "deploy this source to org" and the deploy fails it no longer shows the errors in the panel.

Steps To Reproduce:

  1. Deploy an apex class to a salesforce org using VS code with an error in the class
  2. View the output panel e.g. https://www.dropbox.com/s/629htz6fzq6s9g8/Screenshot%202019-06-19%2011.13.59.png?dl=0

Expected result

Starting SFDX: Deploy Source to Org

11:08:31.439 sfdx force:source:deploy --sourcepath /Users/chris/Code/XeroAPI/force-app/main/default/classes/SaveXeroReponseData.cls --json --loglevel fatal
11:08:39.548 sfdx force:source:deploy --sourcepath /Users/chris/Code/XeroAPI/force-app/main/default/classes/SaveXeroReponseData.cls --json --loglevel fatal ended with exit code 1

Method does not exist or incorrect signature: void new(GLxero__XeroInvoice__c) from the type GLxero.InvoiceLockManager

Actual result

Starting SFDX: Deploy Source to Org

11:08:31.439 sfdx force:source:deploy --sourcepath /Users/chris/Code/XeroAPI/force-app/main/default/classes/SaveXeroReponseData.cls --json --loglevel fatal
11:08:39.548 sfdx force:source:deploy --sourcepath /Users/chris/Code/XeroAPI/force-app/main/default/classes/SaveXeroReponseData.cls --json --loglevel fatal ended with exit code 1

DeployFailed: Deploy failed.

Additional information

Feel free to attach a screenshot.

VS Code Version:

Version 1.35.1 (1.35.1)

SFDX CLI Version:

sfdx-cli/7.11.2-4a5bf6aa97 darwin-x64 node-v10.15.3

OS and version:

macOS High Sierra Version 10.13.6

stevevg commented 5 years ago

Same here, this happens also when pushing to default scratch org:

10:34:33.423 sfdx force:source:push --json --loglevel fatal ended with exit code 1

DeployFailed: Push failed.

VSCode 1.35.1

sfdx-cli/7.11.2-4a5bf6aa97 win32-x64 node-v10.15.3

Windows 10 1809 (Build 17763.557)

SF Extension Pack version: 46.1.0

NathanWenslaff commented 5 years ago

For reference, this appears to be the same issue I posted yesterday https://github.com/forcedotcom/salesforcedx-vscode/issues/1408

brpowell commented 5 years ago

The extensions rely on the JSON output of the CLI to show the failures and successes of this command. Even when I run the CLI command outside of the extensions I'm not getting any failure results, so we'll take a look on the CLI side of things.

vazexqi commented 5 years ago

This seems to be a bug in the CLI (sfdx-cli/7.11.2 darwin-x64 node-v10.15.3). When passed the --json flag, it doesn't return the error but encounters an error. Works fine without the --json flag. Our VS Code extensions rely on the output of --json thus we can't show any errors.

dreamhouse-sfdx on  master [!] via ⬢ v10.15.3
[I] ➜ sfdx force:source:push --json
{
    "status": 1,
    "name": "DeployFailed",
    "message": "Push failed.",
    "exitCode": 1,
    "commandName": "SourcePushCommand",
    "stack": "DeployFailed: Push failed.\n    at MetadataRegistry.initializeMetadataTypeInfos.then.catch.e (/Users/nchen/.nvm/versions/node/v10.15.3/lib/node_modules/sfdx-cli/node_modules/salesforce-alm/dist/lib/source/sourceApiCommand.js:63:31)\n    at tryCatcher (/Users/nchen/.nvm/versions/node/v10.15.3/lib/node_modules/sfdx-cli/node_modules/bluebird/js/release/util.js:16:23)\n    at Promise._settlePromiseFromHandler (/Users/nchen/.nvm/versions/node/v10.15.3/lib/node_modules/sfdx-cli/node_modules/bluebird/js/release/promise.js:510:31)\n    at Promise._settlePromise (/Users/nchen/.nvm/versions/node/v10.15.3/lib/node_modules/sfdx-cli/node_modules/bluebird/js/release/promise.js:567:18)\n    at Promise._settlePromise0 (/Users/nchen/.nvm/versions/node/v10.15.3/lib/node_modules/sfdx-cli/node_modules/bluebird/js/release/promise.js:612:10)\n    at Promise._settlePromises (/Users/nchen/.nvm/versions/node/v10.15.3/lib/node_modules/sfdx-cli/node_modules/bluebird/js/release/promise.js:687:18)\n    at Async._drainQueue (/Users/nchen/.nvm/versions/node/v10.15.3/lib/node_modules/sfdx-cli/node_modules/bluebird/js/release/async.js:138:16)\n    at Async._drainQueues (/Users/nchen/.nvm/versions/node/v10.15.3/lib/node_modules/sfdx-cli/node_modules/bluebird/js/release/async.js:148:10)\n    at Immediate.Async.drainQueues [as _onImmediate] (/Users/nchen/.nvm/versions/node/v10.15.3/lib/node_modules/sfdx-cli/node_modules/bluebird/js/release/async.js:17:14)\n    at runCallback (timers.js:705:18)\n    at tryOnImmediate (timers.js:676:5)\n    at processImmediate (timers.js:658:5)",
    "warnings": []
}

dreamhouse-sfdx on  master [!] via ⬢ v10.15.3 took 4s
[I] ➜ sfdx force:source:push
PROJECT PATH                                      ERROR
────────────────────────────────────────────────  ─────────────────────────────────────────────────────────────────────────────────────────────
force-app/main/default/classes/BotController.cls  Unexpected token ','. (9:47)
force-app/main/default/classes/BotController.cls  Invalid character in identifier: , (9:47)
force-app/main/default/classes/BotController.cls  Unexpected token ','. (9:47)
force-app/main/default/classes/BotController.cls  Constructor not defined: [BotController.HandlerMapping].<Constructor>(String, String) (23:17)
force-app/main/default/classes/BotController.cls  Invalid type: handlerClassName (9:47)
ERROR running force:source:push:  Push failed.
Szandor72 commented 5 years ago

In addition with https://github.com/forcedotcom/cli/issues/108 this bug impacts our team greatly.

tnoonan-salesforce commented 5 years ago

This issue is fixed in 7.12.3 of the toolbelt. Just run sfdx update...

FabienTaillon commented 5 years ago

I’m still having the issue even with the latest release. And it looks like I’m not the only one: https://salesforce.stackexchange.com/questions/267070/sfdx-wont-push-to-scratch-org-no-error-detail

lcampos commented 5 years ago

@FabienTaillon just to clarify, it looks like that thread is specific to executing the command without the --json flag which would be specific to doing deploys outside of the vscode extensions experience. Are you missing the error info when running SFDX: Deploy Source ... or SFDX: Push Source .. ?

Btw, I've been able to replicate the error in the thread and will work on a fix but want to make sure it's exclusive to running the source commands outside of the vscode extensions.

FabienTaillon commented 5 years ago

My bad, I was using source:push -f directly in the VS Code terminal because of conflicts in the Scratch Org, not the VS Code command palette.

lcampos commented 5 years ago

No worries, just wanted to confirm that at least we didn't miss something when using --json. We're working on the fix for the other scenario and we'll update on its progress in this new issue https://github.com/forcedotcom/cli/issues/123

amitkumarj1979 commented 5 years ago

Still not working for me, Using VSCode extensions v 46.11.0 CLI - 7.21.0 dx - 46.11.0.

Works for a specific file using Deploy this source. But when using Push Source to Default Org, no errors are coming even though the command failed

lcampos commented 5 years ago

@amitkumarj1979 I think what you are seeing is unrelated to this original issue, which was on the cli. Do you get an error output if you run the deploy directly in the terminal and using the --json flag?

We have a fix (PR #1597) which I think might address the issue you are seeing but would like to confirm.

amitkumarj1979 commented 5 years ago

the issue is not coming this morning, so I am able to see the errors in the output panel and also the Problems window. Will come back if i see it back. Thanks @lcampos

booknownick commented 3 years ago

Anyone else still seeing this issue?

Starting SFDX: Deploy Source to Org

09:33:18.669 sfdx force:source:deploy --sourcepath /Users/nickthurston/Documents/DocumentsNick’sMacBookPro/BookNow Software Dev Org/BookNow-Software-Dev-Org/force-app/main/default/classes/MembershipHandler.cls --json --loglevel fatal 09:33:23.845 sfdx force:source:deploy --sourcepath /Users/nickthurston/Documents/DocumentsNick’sMacBookPro/BookNow Software Dev Org/BookNow-Software-Dev-Org/force-app/main/default/classes/MembershipHandler.cls --json --loglevel fatal ended with exit code 1

gussamer commented 3 years ago

Also still seeing this error, I think the issue is with the VSCode extensions as running the sfdx command directly from the command line does return errors.

VSCode Output Window: 15:50:53.997 sfdx force:source:deploy --sourcepath [redacted path to source] --json --loglevel fatal 15:51:08.16 sfdx force:source:deploy --sourcepath [redacted path to source] --json --loglevel fatal ended with exit code 1

Command Line: sfdx force:source:deploy --sourcepath [redacted path to source] --json --loglevel fatal ... "lineNumber": "4", "problem": "Method does not exist or incorrect signature: void triggerHandler(String) from the type fflib_SObjectDomain", "problemType": "Error", "success": "false" }, ...

booknownick commented 3 years ago

@gussamer I resolved by changing the following setting to true: image

pgonzaleznetwork commented 2 years ago

@gussamer did you resolve this? I'm experiencing exactly what you describe. Works via the CLI but not through the vscode extension.

hanin77 commented 2 years ago

i'm having same issue how did you resolve the issue

MahiYakkanti27 commented 1 year ago

14:31:42.595 Starting SFDX: Deploy Source to Org

=== Deploy Errors PROJECT PATH ERRORS
──────────── ────────────────────────────────────────────────────────────────────────────── duplicate value found: duplicates value on record with id: Cannot find Lightning Component Bundle helloWorld.
Cannot find Lightning Component Bundle helloWorld.

14:31:52.346 ended SFDX: Deploy Source to Org