net.sf.json.JSONException: JSONArray[0] is not a JSONObject.

Jenkins JIRA | Maxfield Stewart | 1 year ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    Get the following error no matter how I configured creds (no creds with job token, username with token, or using a username/password creds file). ERROR: Build step failed with exception net.sf.json.JSONException: JSONArray[0] is not a JSONObject. at net.sf.json.JSONArray.getJSONObject(JSONArray.java:1977) at org.jenkinsci.plugins.ParameterizedRemoteTrigger.RemoteBuildConfiguration.perform(RemoteBuildConfiguration.java:563) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:782) at hudson.model.Build$BuildExecution.build(Build.java:205) at hudson.model.Build$BuildExecution.doRun(Build.java:162) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534) at hudson.model.Run.execute(Run.java:1738) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:410) Build step 'Trigger a remote parameterized job' marked build as failure It seems Jenkins no longer returning properly formed JSON when jobs are triggered. There's nothing in the jenkins.log on the machine receiving the request to trigger a build but the build does in fact get triggered and start. The issue is on the sending side. This stack trace causes the build to fail and breaks builds, otherwise it would be easy to ignore. I confirmed that I can remote trigger jobs by hand hitting the URL in the various forms but also confirmed there's no response back whatsoever other than a response "201" (created). There's no body or other payload in the response. I should note this failure started upon upgrading to 1.653 from 1.618 (it was previously working just fine on the same version of the plugin). I've confirmed this problem exists on a fresh install as well.

    Jenkins JIRA | 1 year ago | Maxfield Stewart
    net.sf.json.JSONException: JSONArray[0] is not a JSONObject.
  2. 0

    Get the following error no matter how I configured creds (no creds with job token, username with token, or using a username/password creds file). ERROR: Build step failed with exception net.sf.json.JSONException: JSONArray[0] is not a JSONObject. at net.sf.json.JSONArray.getJSONObject(JSONArray.java:1977) at org.jenkinsci.plugins.ParameterizedRemoteTrigger.RemoteBuildConfiguration.perform(RemoteBuildConfiguration.java:563) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:782) at hudson.model.Build$BuildExecution.build(Build.java:205) at hudson.model.Build$BuildExecution.doRun(Build.java:162) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534) at hudson.model.Run.execute(Run.java:1738) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:410) Build step 'Trigger a remote parameterized job' marked build as failure It seems Jenkins no longer returning properly formed JSON when jobs are triggered. There's nothing in the jenkins.log on the machine receiving the request to trigger a build but the build does in fact get triggered and start. The issue is on the sending side. This stack trace causes the build to fail and breaks builds, otherwise it would be easy to ignore. I confirmed that I can remote trigger jobs by hand hitting the URL in the various forms but also confirmed there's no response back whatsoever other than a response "201" (created). There's no body or other payload in the response. I should note this failure started upon upgrading to 1.653 from 1.618 (it was previously working just fine on the same version of the plugin). I've confirmed this problem exists on a fresh install as well.

    Jenkins JIRA | 1 year ago | Maxfield Stewart
    net.sf.json.JSONException: JSONArray[0] is not a JSONObject.
  3. 0

    Jenkins Parameterized Remote Trigger Plugin error"JSONArray[0] is not a JSONObject."

    Stack Overflow | 1 year ago | FindABug
    net.sf.json.JSONException: JSONArray[0] is not a JSONObject.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    [JIRA] [parameterized-remote-trigger-plugin] (JENKINS-33679) Jenkins 1.653 breaks Parameterized-Remote-Trigger-Plugin

    Google Groups | 1 year ago | mstewart@riotgames.com (JIRA)
    net.sf.json.JSONException: JSONArray<span class="error">[0]</span> is not a JSONObject.

  1. DoktorDoener666 2 times, last 4 months ago
1 unregistered visitors

Root Cause Analysis

  1. net.sf.json.JSONException

    JSONArray[0] is not a JSONObject.

    at net.sf.json.JSONArray.getJSONObject()
  2. json-lib
    JSONArray.getJSONObject
    1. net.sf.json.JSONArray.getJSONObject(JSONArray.java:1977)
    1 frame
  3. org.jenkinsci.plugins
    RemoteBuildConfiguration.perform
    1. org.jenkinsci.plugins.ParameterizedRemoteTrigger.RemoteBuildConfiguration.perform(RemoteBuildConfiguration.java:563)
    1 frame
  4. Hudson
    Executor.run
    1. hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
    2. hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:782)
    3. hudson.model.Build$BuildExecution.build(Build.java:205)
    4. hudson.model.Build$BuildExecution.doRun(Build.java:162)
    5. hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
    6. hudson.model.Run.execute(Run.java:1738)
    7. hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    8. hudson.model.ResourceController.execute(ResourceController.java:98)
    9. hudson.model.Executor.run(Executor.java:410)
    9 frames