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

org.json.JSONException: A JSONObject text must begin with '{' at 1 [character 2 line 1] #438

Closed
gudlyf opened this issue Dec 14, 2018 · 6 comments · Fixed by #439
Closed

Comments

@gudlyf
Copy link

gudlyf commented Dec 14, 2018

Jenkins: 2.155
Slack Plugin: 2.7

Code in Jenkinsfile:

pipeline { agent { any } stages { stage('slack test') { steps { slackSend (message: "test") } } } }

More of the error:

org.json.JSONException: A JSONObject text must begin with '{' at 1 [character 2 line 1] at org.json.JSONTokener.syntaxError(JSONTokener.java:433) at org.json.JSONObject.<init>(JSONObject.java:194) at org.json.JSONObject.<init>(JSONObject.java:321) at jenkins.plugins.slack.workflow.SlackResponse.<init>(SlackResponse.java:15) at jenkins.plugins.slack.workflow.SlackSendStep$SlackSendStepExecution.run(SlackSendStep.java:272) at jenkins.plugins.slack.workflow.SlackSendStep$SlackSendStepExecution.run(SlackSendStep.java:198) at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47) at hudson.security.ACL.impersonate(ACL.java:290) at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Finished: FAILURE

The message does appear in Slack, but the build sees the resulting error from the plugin as a failure. Plugin works fine in Freestyle project.

@gudlyf
Copy link
Author

gudlyf commented Dec 14, 2018

FYI, I downgraded to 2.6 and this works fine.

@timja
Copy link
Member

timja commented Dec 14, 2018

what's setup in your global configuration?
@steven-foster fyi

@timja
Copy link
Member

timja commented Dec 14, 2018

It's this change:
#429

If its a bot user it expects a response, if its not a bot user it should just return null and not even try parse it

@gudlyf
Copy link
Author

gudlyf commented Dec 14, 2018

configure_system__jenkins_

@steven-foster
Copy link
Contributor

I was able to reproduce by using the regular Slack Jenkins App token along with a Base URL and Bot User.
Apparently base URL + bot user do not work together.

To avoid this for now either, un-check Is Bot User or remove the base URL and switch to a Bot User integration token

@timja
Copy link
Member

timja commented Dec 15, 2018

@steven-foster @gudlyf could you have a look at #439 please?

It appears that your config is invalid, but it would be easier for the plugin to handle it I think...

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

Successfully merging a pull request may close this issue.

3 participants