Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when enabling the commentOnlyChangedContent option #29

Closed
frederickplante opened this issue Dec 12, 2016 · 6 comments
Closed

Error when enabling the commentOnlyChangedContent option #29

frederickplante opened this issue Dec 12, 2016 · 6 comments
Labels

Comments

@frederickplante
Copy link

frederickplante commented Dec 12, 2016

We want a comment only on the changed content of the pull request (with context lines set to 10) and we're seeing this error when running the jenkins task :

com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Unterminated array at line 1 column 5882431 path $.diffs[132].fileComments[1]
 	at com.google.gson.Gson.fromJson(Gson.java:902)
 	at com.google.gson.Gson.fromJson(Gson.java:852)
 	at com.google.gson.Gson.fromJson(Gson.java:801)
 	at com.google.gson.Gson.fromJson(Gson.java:773)
 	at se.bjurr.violations.comments.bitbucketserver.lib.client.BitbucketServerClient.pullRequestDiff(BitbucketServerClient.java:91)
 	at se.bjurr.violations.comments.bitbucketserver.lib.BitbucketServerCommentsProvider$1.get(BitbucketServerCommentsProvider.java:36)
 	at se.bjurr.violations.comments.bitbucketserver.lib.BitbucketServerCommentsProvider$1.get(BitbucketServerCommentsProvider.java:33)
 	at com.google.common.base.Suppliers$ExpiringMemoizingSupplier.get(Suppliers.java:173)
 	at se.bjurr.violations.comments.bitbucketserver.lib.BitbucketServerCommentsProvider.shouldComment(BitbucketServerCommentsProvider.java:120)
 	at se.bjurr.violations.comments.lib.CommentsCreator.filterChanged(CommentsCreator.java:114)
 	at se.bjurr.violations.comments.lib.CommentsCreator.<init>(CommentsCreator.java:41)
 	at se.bjurr.violations.comments.lib.CommentsCreator.createComments(CommentsCreator.java:25)
 	at se.bjurr.violations.comments.bitbucketserver.lib.ViolationCommentsToBitbucketServerApi.toPullRequest(ViolationCommentsToBitbucketServerApi.java:113)
 	at org.jenkinsci.plugins.jvctb.perform.JvctbPerformer.doPerform(JvctbPerformer.java:95)
 	at org.jenkinsci.plugins.jvctb.perform.JvctbPerformer$1.invoke(JvctbPerformer.java:162)
 	at org.jenkinsci.plugins.jvctb.perform.JvctbPerformer$1.invoke(JvctbPerformer.java:149)
 	at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2719)
 	at hudson.remoting.UserRequest.perform(UserRequest.java:118)
 	at hudson.remoting.UserRequest.perform(UserRequest.java:48)
 	at hudson.remoting.Request$2.run(Request.java:328)
 	at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
 	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 hudson.remoting.Engine$1$1.run(Engine.java:63)
 	at java.lang.Thread.run(Unknown Source)
 Caused by: com.google.gson.stream.MalformedJsonException: Unterminated array at line 1 column  path $.diffs[132].fileComments[1]
 	at com.google.gson.stream.JsonReader.syntaxError(JsonReader.java:1559)
 	at com.google.gson.stream.JsonReader.doPeek(JsonReader.java:476)
 	at com.google.gson.stream.JsonReader.skipValue(JsonReader.java:1224)
 	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:218)
 	at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:41)
 	at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:82)
 	at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:61)
 	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:129)
 	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:220)
 	at com.google.gson.Gson.fromJson(Gson.java:887)
 	... 25 more

We are using the latest version of the plugin (1.36) with bitbucket server 4.3

@tomasbjerre
Copy link
Contributor

I just made a release, 1.37, that adds some more information to this error message. You may try that, should be available from update center within a few hours.

Looks like you use latest version of the plugin. What version of Bitbucket Server do you use?

@frederickplante
Copy link
Author

We are using the version 4.3.0 of Bitbucket Server.

@tomasbjerre
Copy link
Contributor

Dud you get a chance to try 1.37?

@frederickplante
Copy link
Author

I did ask the IT to install it, I'll get back to you when it's done and I have the new stack trace for you (it's not happening on every PR so I need to find one that fails)

@frederickplante
Copy link
Author

All right, the new version is now on our server. I haven't seen the error since (it seems to be almost random at this point). Will notify you again it the error ever occur again. Thanks for your quick support anyway!

@frederickplante
Copy link
Author

So, I haven't seen this error since I created the issue. I think this can be closed for now. At least there is a trace for future reference if this ever happens again. Thanks for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants