• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • export-params-plugin
    • Jenkins 1.625 LTS (on mac os sierra)
      export-params-plugin 1.8
      docker jenkinsci/ssh-slave as an agent

      While it works on the master when a Job is executed on a remote Agent the "export parameters to file" build step consistently fails with the following message.

      Could not store parameters into <path>

      Further investigation uncovered following Exception as a cause

      java.io.IOException: remote file operation failed: <path> at hudson.remoting.Channel@7f287e48:SSH1: java.io.IOException: Unable to serialize hudson.FilePath$FileCallableWrapper@38a67991
      	at hudson.FilePath.act(FilePath.java:987)
      	at hudson.FilePath.act(FilePath.java:969)
      	at org.jenkinsci.plugins.exportparams.ExportParametersBuilder.perform(ExportParametersBuilder.java:134)
      	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:785)
      	at hudson.model.Build$BuildExecution.build(Build.java:205)
      	at hudson.model.Build$BuildExecution.doRun(Build.java:162)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:537)
      	at hudson.model.Run.execute(Run.java:1741)
      	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      	at hudson.model.ResourceController.execute(ResourceController.java:98)
      	at hudson.model.Executor.run(Executor.java:408)
      Caused by: java.io.IOException: Unable to serialize hudson.FilePath$FileCallableWrapper@38a67991
      	at hudson.remoting.UserRequest.serialize(UserRequest.java:168)
      	at hudson.remoting.UserRequest.<init>(UserRequest.java:62)
      	at hudson.remoting.Channel.call(Channel.java:779)
      	at hudson.FilePath.act(FilePath.java:980)
      	... 11 more
      Caused by: java.io.NotSerializableException: org.jenkinsci.plugins.exportparams.ExportParametersBuilder
      	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1184)
      	at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548)
      	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509)
      	at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432)
      	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
      	at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548)
      	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509)
      	at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432)
      	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
      	at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348)
      	at hudson.remoting.UserRequest._serialize(UserRequest.java:157)
      	at hudson.remoting.UserRequest.serialize(UserRequest.java:166)
      	... 14 more
      

          [JENKINS-38917] Version 1.8 stopped working with remote agents

          rin_ne added a comment -

          Priority Blocker is really correct? Regarding help,

          Blocks development and/or testing work, production could not run.

          I cannot reproduce your facing issue with remote slave. I have not updated this area since 1.5.

          NotSerializableException is raised if given object does not have implementation of Serializable interface. This plugin passes String object that is serialized from EnvVars to BufferedWriter. Thus this exception would be raised by String object if this is export-params plugin issue.

          I don't think this is not export-params plugin issue for now. Please provide your job configuration regarding export-params plugin if you want further investigation.

          rin_ne added a comment - Priority Blocker is really correct? Regarding help, Blocks development and/or testing work, production could not run. I cannot reproduce your facing issue with remote slave. I have not updated this area since 1.5. NotSerializableException is raised if given object does not have implementation of Serializable interface. This plugin passes String object that is serialized from EnvVars to BufferedWriter . Thus this exception would be raised by String object if this is export-params plugin issue. I don't think this is not export-params plugin issue for now. Please provide your job configuration regarding export-params plugin if you want further investigation.

          Denys Digtiar added a comment -

          I have just been able to reproduce it again with the brand new jenkins:alpine image based container and the same ssh agent container I used with the previous experiment.

          As I described it, the only workaround for the issue is to build on the master which is not feasible in the production environments, therefore Blocker priority.

          Here is a link to the change log for the last release pointing to the change that I believe is a culprit.
          https://github.com/jenkinsci/export-params-plugin/compare/export-params-1.1...export-params-1.8#diff-760dab5c086e6b7560887018ac881ac7L137
          I don't know that much about Jenkins remoting. But my guess is that FileCallable has to be Serializable. Since an anonymous inner class is used it captures its parent object which I am guessing is not serializable or has fields in its hierarchy that are not serializable.

          Denys Digtiar added a comment - I have just been able to reproduce it again with the brand new jenkins:alpine image based container and the same ssh agent container I used with the previous experiment. As I described it, the only workaround for the issue is to build on the master which is not feasible in the production environments, therefore Blocker priority. Here is a link to the change log for the last release pointing to the change that I believe is a culprit. https://github.com/jenkinsci/export-params-plugin/compare/export-params-1.1...export-params-1.8#diff-760dab5c086e6b7560887018ac881ac7L137 I don't know that much about Jenkins remoting. But my guess is that FileCallable has to be Serializable . Since an anonymous inner class is used it captures its parent object which I am guessing is not serializable or has fields in its hierarchy that are not serializable.

          rin_ne added a comment -

          Could you reproduce this with export-params pkugin 1.5 once?

          rin_ne added a comment - Could you reproduce this with export-params pkugin 1.5 once?

          Denys Digtiar added a comment - - edited

          I have not found it in archives so I built it from source. I was able to reproduce the issue.
          I can not reproduce the issue on 1.1

          Denys Digtiar added a comment - - edited I have not found it in archives so I built it from source. I was able to reproduce the issue. I can not reproduce the issue on 1.1

          Code changed in jenkins
          User: rinrinne
          Path:
          src/main/java/org/jenkinsci/plugins/exportparams/ExportParametersBuilder.java
          http://jenkins-ci.org/commit/export-params-plugin/cef03bfd0044e0f359473aef4b4ca71f1069620e
          Log:
          Add inner class to ExportParametersBuilder

          Annonymous inner class that implements FileCallable uses external
          final String. This might be an issue regarding serialization on
          remote.

          This patch adds new inner class that implements FileCallable to
          keep such string.

          Issue: JENKINS-38917

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: rinrinne Path: src/main/java/org/jenkinsci/plugins/exportparams/ExportParametersBuilder.java http://jenkins-ci.org/commit/export-params-plugin/cef03bfd0044e0f359473aef4b4ca71f1069620e Log: Add inner class to ExportParametersBuilder Annonymous inner class that implements FileCallable uses external final String. This might be an issue regarding serialization on remote. This patch adds new inner class that implements FileCallable to keep such string. Issue: JENKINS-38917

          rin_ne added a comment -

          As I described it, the only workaround for the issue is to build on the master which is not feasible in the production environments, therefore Blocker priority.

          I don't think so. Blocker priority should be used on Jenkins project if If core is affected by installed plugin with no configuration. This issue happens on the build that is started from a job which has this plugin related configurations. So this issue might be broker from the viewpoint of this plugin, but this is never blocker from the viewpoint of this issue tracker. Please confirm the meaning of priority in this issue tracker within bees.

          Unfortunately I still not reproduce this issue, but I found weakness code. So I uploaded a patch. Could you fetch the latest commit on 'JENKINS-38917' branch then build and test again?

          rin_ne added a comment - As I described it, the only workaround for the issue is to build on the master which is not feasible in the production environments, therefore Blocker priority. I don't think so. Blocker priority should be used on Jenkins project if If core is affected by installed plugin with no configuration. This issue happens on the build that is started from a job which has this plugin related configurations. So this issue might be broker from the viewpoint of this plugin, but this is never blocker from the viewpoint of this issue tracker. Please confirm the meaning of priority in this issue tracker within bees. Unfortunately I still not reproduce this issue, but I found weakness code. So I uploaded a patch. Could you fetch the latest commit on ' JENKINS-38917 ' branch then build and test again?

          Denys Digtiar added a comment -

          If the priority is from the perspective of overall Jenkins, then you are absolutely correct. I downgraded the priority. It was just my misunderstanding. Thank you for your prompt response, very much appreciated.

          I will test the fix and provide a feedback.

          Denys Digtiar added a comment - If the priority is from the perspective of overall Jenkins, then you are absolutely correct. I downgraded the priority. It was just my misunderstanding. Thank you for your prompt response, very much appreciated. I will test the fix and provide a feedback.

          Denys Digtiar added a comment -

          My test case is passing. Parameters are stored on SSH agent as well as the master. Thank you!

          Denys Digtiar added a comment - My test case is passing. Parameters are stored on SSH agent as well as the master. Thank you!

          rin_ne added a comment -

          OK, I will release new version.

          rin_ne added a comment - OK, I will release new version.

          rin_ne added a comment -

          Released 1.9.

          rin_ne added a comment - Released 1.9.

            rin_ne rin_ne
            duemir Denys Digtiar
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: