Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-34535

net.sf.json.JSONException: JSONObject["result"] is not a Boolean

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: saltstack-plugin
    • Labels:
      None
    • Environment:
      jenkins 1.635
      java 1.7.0_79
      saltstack-plugin 1.7.0
      saltmaster 2015.8.8.2

    • Similar Issues:

      Description

      When we use the saltstack-plugin to run "state.highstate" with "test=true" as the only KWArgument if there are any changes that would've been run we get the following output:

      [EnvInject] - Loading node environment variables.
      Building remotely on <host> in workspace <workspace>
      Running jid: 20160502104957249184
      Waiting for 4 minions
      0 minions are done
      Will check status every 10 seconds...
      ERROR: Build step failed with exception
      net.sf.json.JSONException: JSONObject["result"] is not a Boolean.
      	at net.sf.json.JSONObject.getBoolean(JSONObject.java:1929)
      	at com.waytta.Utils.validateInnerJsonObject(Utils.java:208)
      	at com.waytta.Utils.validateInnerJsonObject(Utils.java:215)
      	at com.waytta.Utils.validateFunctionCall(Utils.java:178)
      	at com.waytta.SaltAPIBuilder.perform(SaltAPIBuilder.java:377)
      	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:785)
      	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:537)
      	at hudson.model.Run.execute(Run.java:1741)
      	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 'Send a message to Salt API' marked build as failure
      Notifying upstream projects of job completion
      Finished: FAILURE
      

      If there is an error with any state on any minion then this will return correctly. If there are no changes on any state on any minion it will also return correctly. It's only if there are changes that would be applied that we see this information.

        Attachments

          Activity

          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Christian McHugh
          Path:
          src/main/java/com/waytta/Utils.java
          src/test/java/com/waytta/UtilsTest.java
          http://jenkins-ci.org/commit/saltstack-plugin/9d93e17995a4a86fec1cfee70b2f117dc9c49c13
          Log:
          Properly detect scenario where highstate would create changes and test=True. This causes the minion result key = "null" instead of a boolean. Closes JENKINS-34535

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Christian McHugh Path: src/main/java/com/waytta/Utils.java src/test/java/com/waytta/UtilsTest.java http://jenkins-ci.org/commit/saltstack-plugin/9d93e17995a4a86fec1cfee70b2f117dc9c49c13 Log: Properly detect scenario where highstate would create changes and test=True. This causes the minion result key = "null" instead of a boolean. Closes JENKINS-34535
          Hide
          mchugh19 Christian McHugh added a comment -

          As mentioned, performing a state.highstate test=True causes the results key to equal "null".

          This situation is now tested for and handled as of 9d93e179

          Show
          mchugh19 Christian McHugh added a comment - As mentioned, performing a state.highstate test=True causes the results key to equal "null". This situation is now tested for and handled as of 9d93e179
          Hide
          mchugh19 Christian McHugh added a comment -

          Handed in 9d93e179

          Show
          mchugh19 Christian McHugh added a comment - Handed in 9d93e179

            People

            Assignee:
            mchugh19 Christian McHugh
            Reporter:
            zmcneilly Zach McNeilly
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: