Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-9538

hudson.model.FreeStyleBuild & GradleInstallation not serializable => Gradle build not working anymore

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Component/s: gradle-plugin
    • Labels:
      None
    • Environment:
      Jenkins ver. 1.409

      Description

      I switched build back to "Use Gradle Wrapper" in "Invoke Gradle script" configuration from a previously manually defined Gradle.
      This may be related to master/slave configuration, i.e. I think that the problem exists because the changed Gradle plugin configuration can't be synced to the slave.

      FATAL: Unable to serialize hudson.plugins.gradle.GradleInstallation$2@100e3d5
      java.io.IOException: Unable to serialize hudson.plugins.gradle.GradleInstallation$2@100e3d5
      at hudson.remoting.UserRequest.serialize(UserRequest.java:166)
      at hudson.remoting.UserRequest.<init>(UserRequest.java:62)
      at hudson.remoting.Channel.call(Channel.java:642)
      at hudson.plugins.gradle.GradleInstallation.getWrapperExecutable(GradleInstallation.java:72)
      at hudson.plugins.gradle.Gradle.perform(Gradle.java:154)
      at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
      at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:649)
      at hudson.model.Build$RunnerImpl.build(Build.java:177)
      at hudson.model.Build$RunnerImpl.doRun(Build.java:139)
      at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:423)
      at hudson.model.Run.run(Run.java:1362)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:145)
      Caused by: java.io.NotSerializableException: hudson.model.FreeStyleBuild
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1156)
      at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
      at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
      at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
      at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
      at hudson.remoting.UserRequest._serialize(UserRequest.java:155)
      at hudson.remoting.UserRequest.serialize(UserRequest.java:164)
      ... 13 more

        Activity

        Hide
        btrim btrim added a comment -

        Still a bug with Gradle Plugin 1.8 on Jenkins 1.410

        Show
        btrim btrim added a comment - Still a bug with Gradle Plugin 1.8 on Jenkins 1.410
        Hide
        huxi Joern Huxhorn added a comment -

        Given that this bug is still open in 1.423 I assume fixing it is more complex than just adding a "implements Serializable" to FreeStyleBuild, right?

        Show
        huxi Joern Huxhorn added a comment - Given that this bug is still open in 1.423 I assume fixing it is more complex than just adding a "implements Serializable" to FreeStyleBuild, right?
        Hide
        huxi Joern Huxhorn added a comment -

        sigh

        Show
        huxi Joern Huxhorn added a comment - sigh
        Hide
        scm_issue_link SCM/JIRA link daemon added a comment -

        Code changed in jenkins
        User: Gregory Boissinot
        Path:
        src/main/java/hudson/plugins/gradle/GradleInstallation.java
        http://jenkins-ci.org/commit/gradle-plugin/cdf64a127aad602b99fda0321fec61a892e156d8
        Log:
        Fix JENKINS-9538

        Compare: https://github.com/jenkinsci/gradle-plugin/compare/c76c4bc...cdf64a1

        Show
        scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Gregory Boissinot Path: src/main/java/hudson/plugins/gradle/GradleInstallation.java http://jenkins-ci.org/commit/gradle-plugin/cdf64a127aad602b99fda0321fec61a892e156d8 Log: Fix JENKINS-9538 Compare: https://github.com/jenkinsci/gradle-plugin/compare/c76c4bc...cdf64a1
        Hide
        huxi Joern Huxhorn added a comment -

        OMG, it was really fixed by simply adding "implements Serializable"!

        Thanks for fixing this!

        Show
        huxi Joern Huxhorn added a comment - OMG, it was really fixed by simply adding "implements Serializable"! Thanks for fixing this!
        Hide
        heikow Heiko Wolf added a comment -

        I got same exception:

         
        Started by user admin
        Building remotely on Slave in workspace /var/lib/jenkins/slave/workspace/project-default
        Checkout:project-default / /var/lib/jenkins/slave/workspace/project-default - hudson.remoting.Channel@776dd7:Slave
        Using strategy: Default
        Last Built Revision: Revision 409f38ff23dcf6b8ad640ea859c16be472861d95 (origin/develop)
        Fetching changes from 1 remote Git repository
        Fetching upstream changes from git@diskstation:project
        Seen branch in repository origin/HEAD
        Seen branch in repository origin/develop
        Seen branch in repository origin/master
        Commencing build of Revision 409f38ff23dcf6b8ad640ea859c16be472861d95 (origin/develop)
        Checking out Revision 409f38ff23dcf6b8ad640ea859c16be472861d95 (origin/develop)
        Deleting old artifacts from #62
        FATAL: Unable to serialize hudson.plugins.gradle.GradleInstallation$2@1a90878
        java.io.IOException: Unable to serialize hudson.plugins.gradle.GradleInstallation$2@1a90878
        	at hudson.remoting.UserRequest.serialize(UserRequest.java:166)
        	at hudson.remoting.UserRequest.<init>(UserRequest.java:62)
        	at hudson.remoting.Channel.call(Channel.java:645)
        	at hudson.plugins.gradle.GradleInstallation.getWrapperExecutable(GradleInstallation.java:73)
        	at hudson.plugins.gradle.Gradle.performTask(Gradle.java:150)
        	at hudson.plugins.gradle.Gradle.perform(Gradle.java:97)
        	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
        	at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:710)
        	at hudson.model.Build$RunnerImpl.build(Build.java:178)
        	at hudson.model.Build$RunnerImpl.doRun(Build.java:139)
        	at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:480)
        	at hudson.model.Run.run(Run.java:1434)
        	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
        	at hudson.model.ResourceController.execute(ResourceController.java:88)
        	at hudson.model.Executor.run(Executor.java:239)
        Caused by: java.io.NotSerializableException: hudson.model.FreeStyleBuild
        	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1164)
        	at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
        	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)
        	at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
        	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
        	at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330)
        	at hudson.remoting.UserRequest._serialize(UserRequest.java:155)
        	at hudson.remoting.UserRequest.serialize(UserRequest.java:164)
        	... 14 more
        

        I use:

        • Jenkins 1.463
        • Gradle Plugin 1.15

        I think the class hudson.model.FreeStyleBuild must implement Serializable

        Show
        heikow Heiko Wolf added a comment - I got same exception: Started by user admin Building remotely on Slave in workspace /var/lib/jenkins/slave/workspace/project-default Checkout:project-default / /var/lib/jenkins/slave/workspace/project-default - hudson.remoting.Channel@776dd7:Slave Using strategy: Default Last Built Revision: Revision 409f38ff23dcf6b8ad640ea859c16be472861d95 (origin/develop) Fetching changes from 1 remote Git repository Fetching upstream changes from git@diskstation:project Seen branch in repository origin/HEAD Seen branch in repository origin/develop Seen branch in repository origin/master Commencing build of Revision 409f38ff23dcf6b8ad640ea859c16be472861d95 (origin/develop) Checking out Revision 409f38ff23dcf6b8ad640ea859c16be472861d95 (origin/develop) Deleting old artifacts from #62 FATAL: Unable to serialize hudson.plugins.gradle.GradleInstallation$2@1a90878 java.io.IOException: Unable to serialize hudson.plugins.gradle.GradleInstallation$2@1a90878 at hudson.remoting.UserRequest.serialize(UserRequest.java:166) at hudson.remoting.UserRequest.<init>(UserRequest.java:62) at hudson.remoting.Channel.call(Channel.java:645) at hudson.plugins.gradle.GradleInstallation.getWrapperExecutable(GradleInstallation.java:73) at hudson.plugins.gradle.Gradle.performTask(Gradle.java:150) at hudson.plugins.gradle.Gradle.perform(Gradle.java:97) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19) at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:710) at hudson.model.Build$RunnerImpl.build(Build.java:178) at hudson.model.Build$RunnerImpl.doRun(Build.java:139) at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:480) at hudson.model.Run.run(Run.java:1434) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:239) Caused by: java.io.NotSerializableException: hudson.model.FreeStyleBuild at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1164) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330) at hudson.remoting.UserRequest._serialize(UserRequest.java:155) at hudson.remoting.UserRequest.serialize(UserRequest.java:164) ... 14 more I use: Jenkins 1.463 Gradle Plugin 1.15 I think the class hudson.model.FreeStyleBuild must implement Serializable
        Hide
        scm_issue_link SCM/JIRA link daemon added a comment -

        Code changed in jenkins
        User: Gregory Boissinot
        Path:
        src/main/java/hudson/plugins/gradle/Gradle.java
        src/main/java/hudson/plugins/gradle/GradleInstallation.java
        http://jenkins-ci.org/commit/gradle-plugin/ec9433305ba96440292aa6b9e1cc8898407cf356
        Log:
        Fix JENKINS-9538

        Show
        scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Gregory Boissinot Path: src/main/java/hudson/plugins/gradle/Gradle.java src/main/java/hudson/plugins/gradle/GradleInstallation.java http://jenkins-ci.org/commit/gradle-plugin/ec9433305ba96440292aa6b9e1cc8898407cf356 Log: Fix JENKINS-9538
        Hide
        heikow Heiko Wolf added a comment -

        It works with Jenkins 1.464 and Gradle Plugin 1.16.

        Thanks

        Show
        heikow Heiko Wolf added a comment - It works with Jenkins 1.464 and Gradle Plugin 1.16. Thanks

          People

          • Assignee:
            gbois Gregory Boissinot
            Reporter:
            huxi Joern Huxhorn
          • Votes:
            3 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: