jenkinsci / violation-comments-to-stash-plugin

Comments Bitbucket Server (or Stash) pull requests with static code analyzer findings.
https://plugins.jenkins.io/violation-comments-to-stash
MIT License
43 stars 16 forks source link

[Help] java.io.IOException: Unable to serialize #6

Closed schmitch closed 8 years ago

schmitch commented 8 years ago

Hello I get a exception when using your plugin with scalastyle (checkstyle):

java.io.IOException: remote file operation failed: /home/jenkins/workspace/envisia-erp-pr-builder at hudson.remoting.Channel@43d2f281:ci01.envisia.de: java.io.IOException: Unable to serialize

Which should actually not happen. Any ideas?

tomasbjerre commented 8 years ago

Is that all you find in the log?

schmitch commented 8 years ago

Actually this is my output in the Build:

---
--- Jenkins Violation Comments to Bitbucket Server ---
---
bitbucketServerUser: envisiagmbh
bitbucketServerBaseUrl: https://stash.envisia.de
bitbucketServerProject: EES
bitbucketServerPullRequestId: 61
commitHash: 
bitbucketServerRepo: loki
checkstyle: **/target/scalastyle-result.xml
codenarc: 
cpd: 
cpplint: 
csslint: 
findbugs: 
fxcop: 
gendarme: 
jcreport: 
jslint: 
pep8: 
perlcritic: 
pmd: 
pylint: 
simian: 
stylecop: 
Running Jenkins Violation Comments To Bitbucket Server
Will comment 61
Notified Stash for commit with id 021c05b92c20dacb6f6ea7a0ccfb793d672a4cb6

The log is actually pretty big. Here is a bigger snippet:

java.io.IOException: remote file operation failed: /home/jenkins/workspace/envisia-erp-pr-builder at hudson.remoting.Channel@43d2f281:ci01.envisia.de: java.io.IOException: Unable to serialize {/home/jenkins/workspace/envisia-erp-pr-builder/loki/app/envisia/article/services/ArticleValidatorImpl.scala=[hudson.plugins.violations.model.Violation@708348c1, hudson.plugins.violations.model.Violation@1a64a764, hudson.plugins.violations.model.Violation@71039c85, hudson.plugins.violations.model.Violation@27fd0dac], 

actually i have over 300 violations so the (looksl like json) which will contain all my classes with an array like posted above with different ids.

After that there is are log lines like that:

/home/jenkins/workspace/envisia-erp-pr-builder/loki/app/envisia/calculation/helper/cn/ChinaToolingCalculator.scala=[hudson.plugins.violations.model.Violation@55a5a644]}
    at hudson.remoting.UserRequest.serialize(UserRequest.java:200)
    at hudson.remoting.UserRequest.perform(UserRequest.java:160)
    at hudson.remoting.UserRequest.perform(UserRequest.java:50)
    at hudson.remoting.Request$2.run(Request.java:332)
    at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
    at ......remote call to ci01.envisia.de(Native Method)
    at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1416)
    at hudson.remoting.UserResponse.retrieve(UserRequest.java:252)
    at hudson.remoting.Channel.call(Channel.java:781)
    at hudson.FilePath.act(FilePath.java:1007)
    ... 13 more
Caused by: java.io.NotSerializableException: hudson.plugins.violations.model.Violation
    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1184)
    at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348)
    at java.util.ArrayList.writeObject(ArrayList.java:762)
    at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:1028)
    at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1496)
    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 java.util.HashMap.internalWriteEntries(HashMap.java:1777)
    at java.util.HashMap.writeObject(HashMap.java:1354)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:1028)
    at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1496)
    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:189)
    at hudson.remoting.UserRequest.serialize(UserRequest.java:198)
    at hudson.remoting.UserRequest.perform(UserRequest.java:160)
    at hudson.remoting.UserRequest.perform(UserRequest.java:50)
    at hudson.remoting.Request$2.run(Request.java:332)
    at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

It won't actually sent anything to Stash/Bitbucket. I Actually have the Jenkins Violations enabled which will post the Violations directly to json, but I would prefer this plugin to work ;)

The logs on my slave node are actually just Determing the path of the source file...

tomasbjerre commented 8 years ago

This can be solved by implementing https://github.com/jenkinsci/violation-comments-to-stash-plugin/issues/5 I'll try to find some time for that soon.

tomasbjerre commented 8 years ago

This may be fixed now in 1.16. But I have done very little testing =) Closing issue, open it again if its not working!