ctron / package-drone-jenkins

A Package Drone Plugin for Jenkins
3 stars 4 forks source link

Unable to serialize when DroneRecorder is used on a slave #11

Closed chrismathis closed 7 years ago

chrismathis commented 7 years ago

The following pipeline snippet fails when executed on a jenkins slave:

step([$class: 'DroneRecorder', artifacts: '/repositories/*/target/repository/*/.jar' , excludes: '/repositories/.sources./target/repository/*/.jar', channel: "${channelName}", deployKey: "${env.drone_deploy_key}", excludes: '/artifacts.jar,/content.jar', serverUrl: 'http://atfkdrone01:8080', stripPath: true, uploadV3: true])

The same works fine on the master Jenkins. Package Drone Deployer: 0.3.4 Jenkins: 2.46.1 Latest Versions of Pipeline plugins Slave and Server: Windows

This bug for Doxygen looks similar: https://issues.jenkins-ci.org/browse/JENKINS-29938

The Exception is: java.io.IOException: remote file operation failed: D:/ws/workspace/core.controller+core.controller at hudson.remoting.Channel@9d3841:JNLP4-connect connection from /10.10.250.78:50605: java.io.IOException: Unable to serialize hudson.FilePath$FileCallableWrapper@70c2869 at hudson.FilePath.act(FilePath.java:992) at hudson.FilePath.act(FilePath.java:974) at de.dentrassi.pm.jenkins.DroneRecorder.perform(DroneRecorder.java:225) at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:78) at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:65) at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1$1.call(SynchronousNonBlockingStepExecution.java:49) at hudson.security.ACL.impersonate(ACL.java:260) at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1.run(SynchronousNonBlockingStepExecution.java:46) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: java.io.IOException: Unable to serialize hudson.FilePath$FileCallableWrapper@70c2869 at hudson.remoting.UserRequest.serialize(UserRequest.java:201) at hudson.remoting.UserRequest.(UserRequest.java:64) at hudson.remoting.Channel.call(Channel.java:828) at hudson.FilePath.act(FilePath.java:985) ... 12 more Caused by: java.io.NotSerializableException: org.apache.http.impl.client.DefaultHttpClient at java.io.ObjectOutputStream.writeObject0(Unknown Source) at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source) at java.io.ObjectOutputStream.writeSerialData(Unknown Source) at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source) at java.io.ObjectOutputStream.writeObject0(Unknown Source) at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source) at java.io.ObjectOutputStream.writeSerialData(Unknown Source) at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source) at java.io.ObjectOutputStream.writeObject0(Unknown Source) at java.io.ObjectOutputStream.writeObject(Unknown Source) at hudson.remoting.UserRequest._serialize(UserRequest.java:190) at hudson.remoting.UserRequest.serialize(UserRequest.java:199) ... 15 more

ctron commented 7 years ago

Could you provide a fix for this?

chrismathis commented 7 years ago

Not sure, will have a closer look at it. After going through the other issues here https://github.com/ctron/package-drone-jenkins/issues/7 seems related or even the same. Are the changes from @t794104 already in master?

ctron commented 7 years ago

Unfortunately not ... I really have little time for this. So let's try this somehow...

chrismathis commented 7 years ago

His pull request does not seem to contain a fix for this problem. I'm working on a it.

(The problem seems to be that DefaultHttpClient and WorkflowRun are not serializeable)

t794104 commented 7 years ago

My pull request only makes Packagedrone a true pipeline plugin. The master / slave problem isn't as easy to fix in the 0.3 line of the plugin.

I have a fork of this project with a 0.2 branch that fixes the master slave problem see https://github.com/t794104/package-drone-jenkins/tree/0.2.x-pipeline

ctron commented 7 years ago

But this will make it a Jenkins 2+ plugin, right?

chrismathis commented 7 years ago

Version 0.3.5 containing the fix is available on the Jenkins Updatesite.

ctron commented 7 years ago

Many thanks for this fix!