[GRADLE-3527] Daemon builds successfully but command line reports a failed build Created: 17/Aug/16  Updated: 19/Dec/16  Resolved: 19/Dec/16

Status: Resolved
Project: Gradle
Affects Version/s: 2.13
Fix Version/s: None

Type: Bug
Reporter: Paul Merlin Assignee: Jendrik Johannes (Inactive)
Resolution: Duplicate Votes: 4


 Description   

Sporadically, the daemon builds successfully but command line reports a failed build.

This has been reported by several users on the forum.

The daemon log shows a BUILD SUCCESSFUL but the command line outputs:

FAILURE: Build failed with an exception.

* What went wrong:
Unable to process incoming event 'ProgressComplete ' (ProgressCompleteEvent)

Other events fail, e.g. from the same build:

FAILURE: Build failed with an exception.

* What went wrong:
Unable to process incoming event '[QUIET] [system.out] <Normal>Deserialize activated</Normal>' (StyledTextOutputEvent)

No user managed to produce a stacktrace as the issue does not surface when `-s` is in use. The exception is thrown by ConsoleBackedProgressRenderer in the renderNow(long now) method.

Here is a build scan that advertise a build success but had failed on the command line: https://scans.gradle.com/s/brpospf6hd6yu



 Comments   
Comment by Gordon Wallace [ 17/Aug/16 ]

Some of my team was using git 1.9.4 and the associated git-bash console. This error occurred in their build

I use git 2.6.2 and its associated git-bash console. This error does not occur in my build.

Some team members use the DOS command line. The error occurs in their build.

I use a DOS command line, but I always configure it for a 1024/1024 buffer size. The error does not occur for me there.

(I am the author of a fresh new build at my company and apparently my computer was magically set up to work... Not the best when the team goes to adopt the new process and I have no idea what's happening to them

There's some curious interaction between Gradle and the output stream to the console...

The Workaround:

use the --console plain gradle command line switch

The Fix:

If you use git + git-bash, upgrade to git 2.x.x (2.9.3 is current and works for me)

If you use DOS, try increasing your screen buffer size.

Comment by Vivek Thakur [ 03/Sep/16 ]

Changing the behavior of logs in any way other than the default one leads to a successful build. I have been able to replicate this for all clean builds on my project. Using either of the below configs for the test task, to opt out of certain logging events lets me change the default logging behavior.
A. testLogging

{ events "passed", "failed", "skipped" }

B. testLogging

{ showExceptions = false }

As far as option B in concerned, I am not sure whether it will suppress exception thrown by the test case or the gradle daemon itself (throws at ConsoleBackedProgressRenderer.java:117)

Regards,
Vivek Thakur

Comment by Jendrik Johannes (Inactive) [ 19/Sep/16 ]

Could not be reproduced anymore with 3.1 RC1:
https://discuss.gradle.org/t/build-fails-with-unable-to-process-incoming-event-progresscomplete-progresscompleteevent/18434/27

Comment by Vivek Thakur [ 22/Sep/16 ]

Unable to process incoming event '[ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] <Failure>FAILURE: </Failure><Failure>Build failed with an exception.</Failure><Normal>
</Normal>' (StyledTextOutputEvent)

This is what I get for the RC downloaded from https://services.gradle.org/distributions/gradle-3.1-bin.zip

gradle -v gives the following
------------------------------------------------------------
Gradle 3.1
------------------------------------------------------------

Build time: 2016-09-19 10:53:53 UTC
Revision: 13f38ba699afd86d7cdc4ed8fd7dd3960c0b1f97

Groovy: 2.4.7
Ant: Apache Ant(TM) version 1.9.6 compiled on June 29 2015
JVM: 1.8.0_102 (Oracle Corporation 25.102-b14)
OS: Windows 8.1 6.3 amd64

Comment by Jendrik Johannes (Inactive) [ 22/Sep/16 ]

@vivekthakur could you share more details about your build or even a complete minimal example to reproduce the issue.

So far I had no success reproducing it, which makes it hard to identify. Thanks!

Comment by Vivek Thakur [ 22/Sep/16 ]

This error occurs while running a test case, my project has around 7k unit tests. I tried to log the failing test case name but It'll effectively change the logs on console which makes the error go away. Debugging gradle while running the build does give me the access to failing test case, finding the test case name was something I couldn't find anywhere. It'll take some time for me to point which test case will give a minimal example if I were to do it manually.

Comment by Benjamin Muschko [ 15/Nov/16 ]

As announced on the Gradle blog we are planning to completely migrate issues from JIRA to GitHub.

We intend to prioritize issues that are actionable and impactful while working more closely with the community. Many of our JIRA issues are inactionable or irrelevant. We would like to request your help to ensure we can appropriately prioritize JIRA issues you’ve contributed to.

Please confirm that you still advocate for your JIRA issue before December 10th, 2016 by:

  • Checking that your issues contain requisite context, impact, behaviors, and examples as described in our published guidelines.
  • Leave a comment on the JIRA issue or open a new GitHub issue confirming that the above is complete.

We look forward to collaborating with you more closely on GitHub. Thank you for your contribution to Gradle!

Comment by Aleksandr Kuznetcov [ 15/Dec/16 ]

I've started getting this switching from gradle 2.6 to gradle 3.2

Comment by Bruce Eckel [ 17/Dec/16 ]

I'm running Gradle 3.2.1 and Windows 10, and just started getting this message with a relatively new example.

It does seem to work OK with the --console plain gradle command line switch, and I would like to know how to set that through the gradle.properties file. (I have tried org.gradle.console=plain and systemProp.console=plain but it doesn't seem to do anything).

To reproduce, clone:
https://github.com/BruceEckel/OnJava8-Examples

Then run:
gradlew concurrent:run

When it breaks (it usually does) it happens on QuittingTasks, with the output:

FAILURE: Build failed with an exception.

  • What went wrong:
    Unable to process incoming event 'ProgressComplete ' (ProgressCompleteEvent)

But if you run QuittingTasks by itself with
gradlew QuittingTasks
it works.

If you run with
gradlew --console plain concurrent:run
it seems to always work, which is why I would like to know how to set console to plain inside the gradle.properties file as a stopgap.

Although parallel is turned on by default, this doesn't seem to make a difference one way or another. Neither does turning off the daemon. I have the Windows console buffer set to the largest size. The CI builds on both Appveyor and Travis-CI seem to work fine.

Comment by Benjamin Muschko [ 19/Dec/16 ]

I am closing this issue as duplicate. We'll continue to work on the issue on GitHub: https://github.com/gradle/gradle/issues/882

Generated at Wed Jun 30 12:51:07 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.