trautonen / coveralls-maven-plugin

Maven plugin for submitting Java code coverage reports to Coveralls web service.
MIT License
312 stars 123 forks source link

Build error: charset #95

Closed GerardPaligot closed 8 years ago

GerardPaligot commented 8 years ago

Hi,

I don't know why because I don't change something but since yesterday, the report upload doesn't work in my Travis builds with this error:

Failed to execute goal org.eluder.coveralls:coveralls-maven-plugin:3.2.1:report (default-cli) on project spoon-core: Build error: charset

And yesterday, I had some 500 HTTP code errors.

Any idea if the problem comes from me or you?

GerardPaligot commented 8 years ago

For information, project.build.sourceEncoding is specified.

  <properties>
    <java.src.version>1.6</java.src.version>
    <java.test.version>1.8</java.test.version>
    <runtime.log>target/velocity.log</runtime.log>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>
longtimeago commented 8 years ago

Have the same issue

[ERROR] Failed to execute goal org.eluder.coveralls:coveralls-maven-plugin:4.1.0:report (default) on project xockets-hadoop-transport: Build error: charset -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.eluder.coveralls:coveralls-maven-plugin:4.1.0:report (default) on project xockets-hadoop-transport: Build error
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:108)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:76)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:116)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:361)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: Build error
    at org.eluder.coveralls.maven.plugin.CoverallsReportMojo.execute(CoverallsReportMojo.java:251)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:133)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
    ... 19 more
Caused by: java.lang.NullPointerException: charset
    at java.io.InputStreamReader.<init>(InputStreamReader.java:115)
    at org.eluder.coveralls.maven.plugin.httpclient.CoverallsClient.parseResponse(CoverallsClient.java:101)
    at org.eluder.coveralls.maven.plugin.httpclient.CoverallsClient.submit(CoverallsClient.java:90)
    at org.eluder.coveralls.maven.plugin.CoverallsReportMojo.submitData(CoverallsReportMojo.java:380)
    at org.eluder.coveralls.maven.plugin.CoverallsReportMojo.execute(CoverallsReportMojo.java:244)
    ... 21 more

Came from this line https://github.com/trautonen/coveralls-maven-plugin/blob/master/src/main/java/org/eluder/coveralls/maven/plugin/httpclient/CoverallsClient.java#L101 probably because contentType.getCharset() returns null

So, either entity is null, or Content-Type header is not found for the response

trautonen commented 8 years ago

@longtimeago thanks for the debugging. It seems that something hairy going on with Coveralls API. There's also reports in their Github issues for similar problem (https://github.com/lemurheavy/coveralls-public/issues/723) and status page (http://status.coveralls.io/) still shows degraded mode.

I think we should wait until the service is properly running again and see if there are still issues with the Content-Type. I will also improve the error message in later versions of the plugin.

longtimeago commented 8 years ago

@trautonen thank you for the clarification. Obviously, the root cause is on server side. It would be nice to have some more meaningful exception. Also, we could add response tracing in such cases (on debug level)

longtimeago commented 8 years ago

@trautonen here is a hotfix https://github.com/trautonen/coveralls-maven-plugin/pull/96

trautonen commented 8 years ago

This issue will be fixed in 4.2.0 with a better error message. The problem is server side (Coveralls API broken) but the plugin is unable to show a good error message.

I will not backport the fix to 3.x unless someone does it. The issue is basically just about misleading error message.

javadev commented 5 years ago

I see the same error:

[ERROR] Failed to execute goal org.eluder.coveralls:coveralls-maven-plugin:3.2.1:report (default-cli) on project underscore: Processing of input or output data failed: Report submission to Coveralls API failed with HTTP status 422: Unprocessable Entity (Couldn't find a repository matching this job.) -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
The command "mvn clean install jacoco:report coveralls:report" exited with 1.