nemccarthy / stash-pullrequest-builder-plugin

A Jenkins plugin for Building Stash Pull Requests
https://wiki.jenkins-ci.org/display/JENKINS/Stash+pullrequest+builder+plugin
Other
64 stars 130 forks source link

JsonParseException #88

Closed johan-bjareholt closed 8 years ago

johan-bjareholt commented 8 years ago

I configured up a jenkins job to poll pullrequest on a internal bitbucket server every 3rd minute. I have not done much more than that, i am logging in with a plaintext password.

Jenkins version: 1.653 Plugin version: 1.6.0

I don't know what more to say, the setup is pretty simple so I'm pretty clueless why it doesn't work.

Jun 29, 2016 4:10:00 PM INFO stashpullrequestbuilder.stashpullrequestbuilder.StashRepository getTargetPullRequests

Fetch PullRequests (xxxxxxxxx).

Jun 29, 2016 4:10:00 PM WARNING stashpullrequestbuilder.stashpullrequestbuilder.stash.StashApiClient getPullRequests

invalid pull request response.
org.codehaus.jackson.JsonParseException: Unexpected character ('<' (code 60)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')
 at [Source: java.io.StringReader@1122de1f; line: 1, column: 2]
    at org.codehaus.jackson.JsonParser._constructError(JsonParser.java:1433)
    at org.codehaus.jackson.impl.JsonParserMinimalBase._reportError(JsonParserMinimalBase.java:521)
    at org.codehaus.jackson.impl.JsonParserMinimalBase._reportUnexpectedChar(JsonParserMinimalBase.java:442)
    at org.codehaus.jackson.impl.ReaderBasedParser._handleUnexpectedValue(ReaderBasedParser.java:1198)
    at org.codehaus.jackson.impl.ReaderBasedParser.nextToken(ReaderBasedParser.java:485)
    at org.codehaus.jackson.map.ObjectMapper._initForReading(ObjectMapper.java:2770)
    at org.codehaus.jackson.map.ObjectMapper._readMapAndClose(ObjectMapper.java:2718)
    at org.codehaus.jackson.map.ObjectMapper.readValue(ObjectMapper.java:1863)
    at stashpullrequestbuilder.stashpullrequestbuilder.stash.StashApiClient.parsePullRequestJson(StashApiClient.java:403)
    at stashpullrequestbuilder.stashpullrequestbuilder.stash.StashApiClient.getPullRequests(StashApiClient.java:80)
    at stashpullrequestbuilder.stashpullrequestbuilder.StashRepository.getTargetPullRequests(StashRepository.java:71)
    at stashpullrequestbuilder.stashpullrequestbuilder.StashPullRequestsBuilder.run(StashPullRequestsBuilder.java:32)
    at stashpullrequestbuilder.stashpullrequestbuilder.StashBuildTrigger.run(StashBuildTrigger.java:223)
    at hudson.triggers.Trigger.checkTriggers(Trigger.java:272)
    at hudson.triggers.Trigger$Cron.doRun(Trigger.java:221)
    at hudson.triggers.SafeTimerTask.run(SafeTimerTask.java:50)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:522)
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:319)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:191)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1153)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.lang.Thread.run(Thread.java:785)
johan-bjareholt commented 8 years ago

I realized that i had a old credentials version (1.18, 1.22 is the requirements) and upgraded to 2.04 and restarted jenkins but that didn't solve it.

johan-bjareholt commented 8 years ago

Apparently changing from http:// to https:// fixed it, but i have no idea why

johan-bjareholt commented 8 years ago

After some further investigating i realized that if you try to use the JSON api with normal http on our server you are redirected to the index.html page with https.

Pretty wierd behaviour.

mikelupo commented 8 years ago

Apache front end doing redirecting?

Sent from my iPhone

On Jun 30, 2016, at 6:06 AM, Johan Bjäreholt notifications@github.com wrote:

After some further investigating i realized that if you try to use the JSON api with normal http on our server you are redirected to the index.html page with https.

Pretty wierd behaviour.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

johan-bjareholt commented 8 years ago

I actually havet no idea, I'm not the one in charge of the bitbucket server.

jdelnano commented 5 years ago

After some further investigating i realized that if you try to use the JSON api with normal http on our server you are redirected to the index.html page with https.

Pretty wierd behaviour.

Want to give you a quick shout out because I was having issues setting this up, and this helped me fix my mistake: Thanks!