Cli: Deployment errors not shown after upgrade to 7.43.1

Created on 27 Jan 2020  ·  11Comments  ·  Source: forcedotcom/cli

After the last upgrade to version 7.43.1, when deploying with sfdx force:source:deploy, the deployment errors are not printed to the console.

With 7.42.1, this was the output of a failed deployment:

$ C:/Users/pawel/AppData/Roaming/npm/sfdx force:source:deploy --checkonly -p src/view/classes/
Job ID | 0Af5E000013kvy0SAA
SOURCE PROGRESS | ███████████████████████████░░░░░░░░░░░░░ | 6/9 Files

=== Component Failures [3]
TYPE   FILE                                                                     NAME                          PROBLEM
─────  ───────────────────────────────────────────────────────────────────────  ────────────────────────────  ───────────────────────────────────────────────────────
Error  sdx_sourceDeploy_1580119589702/classes/VisitExecutionController.cls      VisitExecutionController      Unexpected token '@'.
Error  sdx_sourceDeploy_1580119589702/classes/VisitExecutionController.cls      VisitExecutionController      Unexpected token '@'.
Error  sdx_sourceDeploy_1580119589702/classes/VisitExecutionControllerTest.cls  VisitExecutionControllerTest  Dependent class is invalid and needs recompilation:
                                                                                                               Class VisitExecutionController : Unexpected token '@'.

After the upgrade, I only get the following:

$ sfdx force:source:deploy --checkonly -p src/view/classes/
Job ID | 0Af5E000013kwkESAQ
SOURCE PROGRESS | ███████████████████████████░░░░░░░░░░░░░ | 6/9 Files

If i use --json output, I can see the errors in the new version, but this is not very human-friendly workaround.

This is my current version of sfdx-cli:

$ sfdx plugins --core
@oclif/plugin-autocomplete 0.1.5 (core)
@oclif/plugin-commands 1.2.3 (core)
@oclif/plugin-help 2.2.3 (core)
@oclif/plugin-not-found 1.2.3 (core)
@oclif/plugin-plugins 1.7.9 (core)
@oclif/plugin-update 1.3.9 (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.4.1 (core)
generator 1.1.2 (core)
salesforcedx 47.16.0 (core)
├─ salesforcedx-templates 47.17.0 (core)
└─ salesforce-alm 47.15.0 (core)

sfdx-cli 7.43.1 (core)
shane-sfdx-plugins 4.15.0

Most helpful comment

The progress bar also does not work with Jenkins, so the only way we can get any feedback at all is by using --json. Even when using JSON, we do not get feedback on what errors are encountered until after the entire deployment is complete (which can be over an hour in orgs with a lot of test code)

We should be able to set a flag that reverts to the standard, text-based output.

All 11 comments

The progress bar also does not work with Jenkins, so the only way we can get any feedback at all is by using --json. Even when using JSON, we do not get feedback on what errors are encountered until after the entire deployment is complete (which can be over an hour in orgs with a lot of test code)

We should be able to set a flag that reverts to the standard, text-based output.

Yeah, this is really annoying to be honest

@pfronczak We made a fix last week that should address this, Please let me know if you are still facing this issue. Also, you can now disable the progress bar with and environment var, set

SFDX_USE_PROGRESS_BAR = false

@clairebianchi this looks great, thank you

Status:  Succeeded
jobid:  0Af5600000gyWueCAE
Completed:  2020-02-14T19:09:34.000Z
Component errors:  0
Components checked:  2039
Components total:  2039
Tests errors:  0
Tests completed:  228
Tests total:  228
Check only: true

@clairebianchi Thank you for the update.
I'm afraid though, the issue is still there (I've checked both 7.45.1 and the latest 7.46.1 version).
In the default setting, the output in case of an error is the same as in the initial issue description (i.e. unfinished progress bar and no error messages).
When using the new SFDX_USE_PROGRESS_BAR=false env variable, I get an output like below:

Status:  SucceededPartial
jobid:  0Af5E000014zCMZSA2
Completed:  2020-02-16T23:42:20.000Z
Component errors:  31
Components checked:  9
Components total:  40
Tests errors:  0
Tests completed:  0
Tests total:  0
Check only: true

So still no messages about the actual errors in the deployment

Looks like the latest plugin update (v.48.2.0) has fixed this issue.
Release notes: https://developer.salesforce.com/media/salesforce-cli/releasenotes.html
Tested it and it looks fine - thank you.

Closing this issue then.

I am still experiencing this issue with plugin version 48.2.0 and sfdx version 7.47.0

I've tried both with and without the progress bar and with and without the --json flag

@JeffreyRuder what command did you use? I successfully got errors reported back in Jenkins with the following command with the latest version in npm

SFDX_USE_PROGRESS_BAR=false sfdx force:source:deploy

@dmgerow The command @JeffreyRuder is using looks something as follows:
sfdx force:source:deploy -p main/default/classes/(*).cls -l RunLocalTests

He tried using --loglevel fatal, --loglevel error and --json but still not getting the error shown up. CLI is updated upto 24th Feb 2020.

@alekhSharma try prefixing with SFDX_USE_PROGRESS_BAR=false to set the new env variable

SFDX_USE_PROGRESS_BAR=false sfdx force:source:deploy -p main/default/classes/(*****).cls -l RunLocalTests

@dmgerow @alekhSharma

After some more testing the issue is specific to unit test failures. If I have a different sort of error in the deployment, for example a syntax error in one of my classes, that is displayed correctly after the version upgrade.

If I say RunLocalTests, and one of my unit tests fails, the only message is "Unknown error". SFDX_USE_PROGRESS_BAR does not make a difference. I would expect some output along the lines of which test failed, but I'm not sure if that functionality was ever present.

Was this page helpful?
0 / 5 - 0 ratings