Search code examples
javamavenpitest

PiTest failing in CI maven build with "Input byte array has wrong 4-byte ending unit" even with no source code changes


My CI build is failing during the org.pitest:mutationCoverage goal when pushing up new code. My patchset has no changes to any source code (just a new, empty commit), yet the following error is printed:

16:49:26 [ERROR] Failed to execute goal org.pitest:pitest-maven:1.4.0:mutationCoverage (default) on project common-scheduler: Execution default of goal org.pitest:pitest-maven:1.4.0:mutationCoverage failed: Input byte array has wrong 4-byte ending unit -> [Help 1]
16:49:26 org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.pitest:pitest-maven:1.4.0:mutationCoverage (default) on project common-scheduler: Execution default of goal org.pitest:pitest-maven:1.4.0:mutationCoverage failed: Input byte array has wrong 4-byte ending unit
16:49:26     at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:213)
16:49:26     at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
16:49:26     at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
16:49:26     at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
16:49:26     at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
16:49:26     at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
16:49:26     at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
16:49:26     at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
16:49:26     at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
16:49:26     at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
16:49:26     at org.apache.maven.cli.MavenCli.execute (MavenCli.java:954)
16:49:26     at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
16:49:26     at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
16:49:26     at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
16:49:26     at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
16:49:26     at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
16:49:26     at java.lang.reflect.Method.invoke (Method.java:497)
16:49:26     at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
16:49:26     at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
16:49:26     at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
16:49:26     at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
16:49:26 Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default of goal org.pitest:pitest-maven:1.4.0:mutationCoverage failed: Input byte array has wrong 4-byte ending unit
16:49:26     at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:148)
16:49:26     at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
16:49:26     at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
16:49:26     at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
16:49:26     at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
16:49:26     at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
16:49:26     at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
16:49:26     at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
16:49:26     at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
16:49:26     at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
16:49:26     at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
16:49:26     at org.apache.maven.cli.MavenCli.execute (MavenCli.java:954)
16:49:26     at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
16:49:26     at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
16:49:26     at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
16:49:26     at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
16:49:26     at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
16:49:26     at java.lang.reflect.Method.invoke (Method.java:497)
16:49:26     at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
16:49:26     at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
16:49:26     at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
16:49:26     at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
16:49:26 Caused by: java.lang.IllegalArgumentException: Input byte array has wrong 4-byte ending unit
16:49:26     at java.util.Base64$Decoder.decode0 (Base64.java:704)
16:49:26     at java.util.Base64$Decoder.decode (Base64.java:526)
16:49:26     at java.util.Base64$Decoder.decode (Base64.java:549)
16:49:26     at org.pitest.mutationtest.incremental.ObjectOutputStreamHistoryStore.deserialize (ObjectOutputStreamHistoryStore.java:126)
16:49:26     at org.pitest.mutationtest.incremental.ObjectOutputStreamHistoryStore.restoreResults (ObjectOutputStreamHistoryStore.java:101)
16:49:26     at org.pitest.mutationtest.incremental.ObjectOutputStreamHistoryStore.initialize (ObjectOutputStreamHistoryStore.java:87)
16:49:26     at org.pitest.mutationtest.tooling.MutationCoverage.runReport (MutationCoverage.java:132)
16:49:26     at org.pitest.mutationtest.tooling.EntryPoint.execute (EntryPoint.java:116)
16:49:26     at org.pitest.mutationtest.tooling.EntryPoint.execute (EntryPoint.java:49)
16:49:26     at org.pitest.maven.RunPitStrategy.execute (RunPitStrategy.java:35)
16:49:26     at org.pitest.maven.AbstractPitMojo.analyse (AbstractPitMojo.java:436)
16:49:26     at org.pitest.maven.AbstractPitMojo.execute (AbstractPitMojo.java:377)
16:49:26     at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
16:49:26     at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
16:49:26     at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
16:49:26     at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
16:49:26     at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
16:49:26     at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
16:49:26     at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
16:49:26     at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
16:49:26     at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
16:49:26     at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
16:49:26     at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
16:49:26     at org.apache.maven.cli.MavenCli.execute (MavenCli.java:954)
16:49:26     at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
16:49:26     at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
16:49:26     at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
16:49:26     at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
16:49:26     at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
16:49:26     at java.lang.reflect.Method.invoke (Method.java:497)
16:49:26     at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
16:49:26     at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
16:49:26     at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
16:49:26     at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
16:49:26 [ERROR] 
16:49:26 [ERROR] 
16:49:26 [ERROR] For more information about the errors and possible solutions, please read the following articles:
16:49:26 [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
16:49:26 [ERROR] 
16:49:26 [ERROR] After correcting the problems, you can resume the build with the command
16:49:26 [ERROR]   mvn <goals> -rf :common-scheduler
16:49:26 Build step 'Invoke top-level Maven targets' marked build as failure
16:49:26 Archiving artifacts

I've enabled verbose logging for PiTest, and debug logging for maven, not seeing anything in the logs. Can't see anything similar with this error online either.

Plugin configuration is:

<plugin>
  <groupId>org.pitest</groupId>
  <artifactId>pitest-maven</artifactId>
  <version>1.4.0</version>
  <configuration>
    <analyseLastCommit>true</analyseLastCommit>
    <avoidCallsTo>
      <avoidCallsTo>org.slf4j</avoidCallsTo>
    </avoidCallsTo>
    <excludedClasses>
      <param>*Exception</param>
    </excludedClasses>
    <excludedMethods>
      <param>toString</param>
      <param>hashCode</param>
      <param>equals</param>
      <param>getInstance</param>
    </excludedMethods>
    <failWhenNoMutations>false</failWhenNoMutations>
    <outputFormats>xml,html</outputFormats>
    <skip>${skip-pitest}</skip>
    <withHistory>true</withHistory>
  </configuration>
</plugin>

I'm struggling to understand where the error is coming from, as it doesn't seem linked to any code changes at all, yet is happening on every new patchset.


Solution

  • Raised the question on the github for PiTest: https://github.com/hcoles/pitest/issues/629

    Issue was a corrupted history file. Cleaning out the environment and running again sorted things out.