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

GET /job/:job-name/:run-id/wfapi/describe,somtimes return 500 error

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Fixed
    • None
    • Jenkins Version: 2.302
      pipeline-stage-view-plugin Version: 2.19

    Description

      attachment image is exception stack.

      When the FlowExecution 'isComplete' return true,get the 'Result' from WorkflowRun's function 'getResult',but maybe this moment result is null

      original code is :

      private void initStatus(WorkflowRun run) {
          FlowExecution execution = run.getExecution();
      
          if (execution == null) {
              setStatus(StatusExt.NOT_EXECUTED);
          } else if (execution.getCauseOfFailure() != null) {
              setStatus(StatusExt.valueOf(execution.getCauseOfFailure()));
          } else if (execution.isComplete()) {
              Result r = run.getResult();
              setStatus(StatusExt.valueOf(r));
          } else if (isPendingInput(run)) {
              setStatus(StatusExt.PAUSED_PENDING_INPUT);
          } else {
              setStatus(StatusExt.IN_PROGRESS);
          }
      }

      Maybe the correct code to get 'Result' is :

      private void initStatus(WorkflowRun run) {
          FlowExecution execution = run.getExecution();
      
          if (execution == null) {
              setStatus(StatusExt.NOT_EXECUTED);
          } else if (execution.getCauseOfFailure() != null) {
              setStatus(StatusExt.valueOf(execution.getCauseOfFailure()));
          } else if (execution.isComplete()) {
              Result r = run.getResult();
             // ensure Result is not null
             if(null == r) {
               r =((FlowEndNode)execution.getCurrentHeads().get(0)).getResult();
             }
             setStatus(StatusExt.valueOf(r));
          } else if (isPendingInput(run)) {
              setStatus(StatusExt.PAUSED_PENDING_INPUT);
          } else {
              setStatus(StatusExt.IN_PROGRESS);
          }
      }
      

      Attachments

        Activity

          mierihazai kun created issue -
          mierihazai kun made changes -
          Field Original Value New Value
          Description attachment image is exception stack.

          When the FlowExecution 'isComplete' return true,get the 'Result' from WorkflowRun's function 'getResult',but maybe this moment result is null

          I think the correct code to get 'Result' is :
          {code:java}
          // ensure Result is not null
          Result r =((FlowEndNode)execution.getCurrentHeads().get(0)).getResult()
          {code}
          attachment image is exception stack.

          When the FlowExecution 'isComplete' return true,get the 'Result' from WorkflowRun's function 'getResult',but maybe this moment result is null

          original code is :
          {code:java}
          private void initStatus(WorkflowRun run) {
              FlowExecution execution = run.getExecution();

              if (execution == null) {
                  setStatus(StatusExt.NOT_EXECUTED);
              } else if (execution.getCauseOfFailure() != null) {
                  setStatus(StatusExt.valueOf(execution.getCauseOfFailure()));
              } else if (execution.isComplete()) {
                  Result r = run.getResult();
                  setStatus(StatusExt.valueOf(r));
              } else if (isPendingInput(run)) {
                  setStatus(StatusExt.PAUSED_PENDING_INPUT);
              } else {
                  setStatus(StatusExt.IN_PROGRESS);
              }
          }{code}
          I think the correct code to get 'Result' is :
          {code:java}

          private void initStatus(WorkflowRun run) {
              FlowExecution execution = run.getExecution();

              if (execution == null) {
                  setStatus(StatusExt.NOT_EXECUTED);
              } else if (execution.getCauseOfFailure() != null) {
                  setStatus(StatusExt.valueOf(execution.getCauseOfFailure()));
              } else if (execution.isComplete()) {
                  //Result r = run.getResult();
                 // ensure Result is not null
                 Result r =((FlowEndNode)execution.getCurrentHeads().get(0)).getResult()
                  setStatus(StatusExt.valueOf(r));
              } else if (isPendingInput(run)) {
                  setStatus(StatusExt.PAUSED_PENDING_INPUT);
              } else {
                  setStatus(StatusExt.IN_PROGRESS);
              }
          }
          {code}
          mierihazai kun made changes -
          Description attachment image is exception stack.

          When the FlowExecution 'isComplete' return true,get the 'Result' from WorkflowRun's function 'getResult',but maybe this moment result is null

          original code is :
          {code:java}
          private void initStatus(WorkflowRun run) {
              FlowExecution execution = run.getExecution();

              if (execution == null) {
                  setStatus(StatusExt.NOT_EXECUTED);
              } else if (execution.getCauseOfFailure() != null) {
                  setStatus(StatusExt.valueOf(execution.getCauseOfFailure()));
              } else if (execution.isComplete()) {
                  Result r = run.getResult();
                  setStatus(StatusExt.valueOf(r));
              } else if (isPendingInput(run)) {
                  setStatus(StatusExt.PAUSED_PENDING_INPUT);
              } else {
                  setStatus(StatusExt.IN_PROGRESS);
              }
          }{code}
          I think the correct code to get 'Result' is :
          {code:java}

          private void initStatus(WorkflowRun run) {
              FlowExecution execution = run.getExecution();

              if (execution == null) {
                  setStatus(StatusExt.NOT_EXECUTED);
              } else if (execution.getCauseOfFailure() != null) {
                  setStatus(StatusExt.valueOf(execution.getCauseOfFailure()));
              } else if (execution.isComplete()) {
                  //Result r = run.getResult();
                 // ensure Result is not null
                 Result r =((FlowEndNode)execution.getCurrentHeads().get(0)).getResult()
                  setStatus(StatusExt.valueOf(r));
              } else if (isPendingInput(run)) {
                  setStatus(StatusExt.PAUSED_PENDING_INPUT);
              } else {
                  setStatus(StatusExt.IN_PROGRESS);
              }
          }
          {code}
          attachment image is exception stack.

          When the FlowExecution 'isComplete' return true,get the 'Result' from WorkflowRun's function 'getResult',but maybe this moment result is null

          original code is :
          {code:java}
          private void initStatus(WorkflowRun run) {
              FlowExecution execution = run.getExecution();

              if (execution == null) {
                  setStatus(StatusExt.NOT_EXECUTED);
              } else if (execution.getCauseOfFailure() != null) {
                  setStatus(StatusExt.valueOf(execution.getCauseOfFailure()));
              } else if (execution.isComplete()) {
                  Result r = run.getResult();
                  setStatus(StatusExt.valueOf(r));
              } else if (isPendingInput(run)) {
                  setStatus(StatusExt.PAUSED_PENDING_INPUT);
              } else {
                  setStatus(StatusExt.IN_PROGRESS);
              }
          }{code}
          I think the correct code to get 'Result' is :
          {code:java}
          private void initStatus(WorkflowRun run) {
              FlowExecution execution = run.getExecution();

              if (execution == null) {
                  setStatus(StatusExt.NOT_EXECUTED);
              } else if (execution.getCauseOfFailure() != null) {
                  setStatus(StatusExt.valueOf(execution.getCauseOfFailure()));
              } else if (execution.isComplete()) {
                  //Result r = run.getResult();
                 // ensure Result is not null
                 Result r =((FlowEndNode)execution.getCurrentHeads().get(0)).getResult();
                  setStatus(StatusExt.valueOf(r));
              } else if (isPendingInput(run)) {
                  setStatus(StatusExt.PAUSED_PENDING_INPUT);
              } else {
                  setStatus(StatusExt.IN_PROGRESS);
              }
          }
          {code}
          mierihazai kun made changes -
          Description attachment image is exception stack.

          When the FlowExecution 'isComplete' return true,get the 'Result' from WorkflowRun's function 'getResult',but maybe this moment result is null

          original code is :
          {code:java}
          private void initStatus(WorkflowRun run) {
              FlowExecution execution = run.getExecution();

              if (execution == null) {
                  setStatus(StatusExt.NOT_EXECUTED);
              } else if (execution.getCauseOfFailure() != null) {
                  setStatus(StatusExt.valueOf(execution.getCauseOfFailure()));
              } else if (execution.isComplete()) {
                  Result r = run.getResult();
                  setStatus(StatusExt.valueOf(r));
              } else if (isPendingInput(run)) {
                  setStatus(StatusExt.PAUSED_PENDING_INPUT);
              } else {
                  setStatus(StatusExt.IN_PROGRESS);
              }
          }{code}
          I think the correct code to get 'Result' is :
          {code:java}
          private void initStatus(WorkflowRun run) {
              FlowExecution execution = run.getExecution();

              if (execution == null) {
                  setStatus(StatusExt.NOT_EXECUTED);
              } else if (execution.getCauseOfFailure() != null) {
                  setStatus(StatusExt.valueOf(execution.getCauseOfFailure()));
              } else if (execution.isComplete()) {
                  //Result r = run.getResult();
                 // ensure Result is not null
                 Result r =((FlowEndNode)execution.getCurrentHeads().get(0)).getResult();
                  setStatus(StatusExt.valueOf(r));
              } else if (isPendingInput(run)) {
                  setStatus(StatusExt.PAUSED_PENDING_INPUT);
              } else {
                  setStatus(StatusExt.IN_PROGRESS);
              }
          }
          {code}
          attachment image is exception stack.

          When the FlowExecution 'isComplete' return true,get the 'Result' from WorkflowRun's function 'getResult',but maybe this moment result is null

          original code is :
          {code:java}
          private void initStatus(WorkflowRun run) {
              FlowExecution execution = run.getExecution();

              if (execution == null) {
                  setStatus(StatusExt.NOT_EXECUTED);
              } else if (execution.getCauseOfFailure() != null) {
                  setStatus(StatusExt.valueOf(execution.getCauseOfFailure()));
              } else if (execution.isComplete()) {
                  Result r = run.getResult();
                  setStatus(StatusExt.valueOf(r));
              } else if (isPendingInput(run)) {
                  setStatus(StatusExt.PAUSED_PENDING_INPUT);
              } else {
                  setStatus(StatusExt.IN_PROGRESS);
              }
          }{code}
          Maybe the correct code to get 'Result' is :
          {code:java}
          private void initStatus(WorkflowRun run) {
              FlowExecution execution = run.getExecution();

              if (execution == null) {
                  setStatus(StatusExt.NOT_EXECUTED);
              } else if (execution.getCauseOfFailure() != null) {
                  setStatus(StatusExt.valueOf(execution.getCauseOfFailure()));
              } else if (execution.isComplete()) {
                  //Result r = run.getResult();
                 // ensure Result is not null
                 Result r =((FlowEndNode)execution.getCurrentHeads().get(0)).getResult();
                  setStatus(StatusExt.valueOf(r));
              } else if (isPendingInput(run)) {
                  setStatus(StatusExt.PAUSED_PENDING_INPUT);
              } else {
                  setStatus(StatusExt.IN_PROGRESS);
              }
          }
          {code}
          mierihazai kun made changes -
          Description attachment image is exception stack.

          When the FlowExecution 'isComplete' return true,get the 'Result' from WorkflowRun's function 'getResult',but maybe this moment result is null

          original code is :
          {code:java}
          private void initStatus(WorkflowRun run) {
              FlowExecution execution = run.getExecution();

              if (execution == null) {
                  setStatus(StatusExt.NOT_EXECUTED);
              } else if (execution.getCauseOfFailure() != null) {
                  setStatus(StatusExt.valueOf(execution.getCauseOfFailure()));
              } else if (execution.isComplete()) {
                  Result r = run.getResult();
                  setStatus(StatusExt.valueOf(r));
              } else if (isPendingInput(run)) {
                  setStatus(StatusExt.PAUSED_PENDING_INPUT);
              } else {
                  setStatus(StatusExt.IN_PROGRESS);
              }
          }{code}
          Maybe the correct code to get 'Result' is :
          {code:java}
          private void initStatus(WorkflowRun run) {
              FlowExecution execution = run.getExecution();

              if (execution == null) {
                  setStatus(StatusExt.NOT_EXECUTED);
              } else if (execution.getCauseOfFailure() != null) {
                  setStatus(StatusExt.valueOf(execution.getCauseOfFailure()));
              } else if (execution.isComplete()) {
                  //Result r = run.getResult();
                 // ensure Result is not null
                 Result r =((FlowEndNode)execution.getCurrentHeads().get(0)).getResult();
                  setStatus(StatusExt.valueOf(r));
              } else if (isPendingInput(run)) {
                  setStatus(StatusExt.PAUSED_PENDING_INPUT);
              } else {
                  setStatus(StatusExt.IN_PROGRESS);
              }
          }
          {code}
          attachment image is exception stack.

          When the FlowExecution 'isComplete' return true,get the 'Result' from WorkflowRun's function 'getResult',but maybe this moment result is null

          original code is :
          {code:java}
          private void initStatus(WorkflowRun run) {
              FlowExecution execution = run.getExecution();

              if (execution == null) {
                  setStatus(StatusExt.NOT_EXECUTED);
              } else if (execution.getCauseOfFailure() != null) {
                  setStatus(StatusExt.valueOf(execution.getCauseOfFailure()));
              } else if (execution.isComplete()) {
                  Result r = run.getResult();
                  setStatus(StatusExt.valueOf(r));
              } else if (isPendingInput(run)) {
                  setStatus(StatusExt.PAUSED_PENDING_INPUT);
              } else {
                  setStatus(StatusExt.IN_PROGRESS);
              }
          }{code}
          Maybe the correct code to get 'Result' is :
          {code:java}
          private void initStatus(WorkflowRun run) {
              FlowExecution execution = run.getExecution();

              if (execution == null) {
                  setStatus(StatusExt.NOT_EXECUTED);
              } else if (execution.getCauseOfFailure() != null) {
                  setStatus(StatusExt.valueOf(execution.getCauseOfFailure()));
              } else if (execution.isComplete()) {
                  Result r = run.getResult();
                 // ensure Result is not null
                 if(null == r){
                   r =((FlowEndNode)execution.getCurrentHeads().get(0)).getResult();
                 }
                 setStatus(StatusExt.valueOf(r));
              } else if (isPendingInput(run)) {
                  setStatus(StatusExt.PAUSED_PENDING_INPUT);
              } else {
                  setStatus(StatusExt.IN_PROGRESS);
              }
          }
          {code}
          mierihazai kun made changes -
          Description attachment image is exception stack.

          When the FlowExecution 'isComplete' return true,get the 'Result' from WorkflowRun's function 'getResult',but maybe this moment result is null

          original code is :
          {code:java}
          private void initStatus(WorkflowRun run) {
              FlowExecution execution = run.getExecution();

              if (execution == null) {
                  setStatus(StatusExt.NOT_EXECUTED);
              } else if (execution.getCauseOfFailure() != null) {
                  setStatus(StatusExt.valueOf(execution.getCauseOfFailure()));
              } else if (execution.isComplete()) {
                  Result r = run.getResult();
                  setStatus(StatusExt.valueOf(r));
              } else if (isPendingInput(run)) {
                  setStatus(StatusExt.PAUSED_PENDING_INPUT);
              } else {
                  setStatus(StatusExt.IN_PROGRESS);
              }
          }{code}
          Maybe the correct code to get 'Result' is :
          {code:java}
          private void initStatus(WorkflowRun run) {
              FlowExecution execution = run.getExecution();

              if (execution == null) {
                  setStatus(StatusExt.NOT_EXECUTED);
              } else if (execution.getCauseOfFailure() != null) {
                  setStatus(StatusExt.valueOf(execution.getCauseOfFailure()));
              } else if (execution.isComplete()) {
                  Result r = run.getResult();
                 // ensure Result is not null
                 if(null == r){
                   r =((FlowEndNode)execution.getCurrentHeads().get(0)).getResult();
                 }
                 setStatus(StatusExt.valueOf(r));
              } else if (isPendingInput(run)) {
                  setStatus(StatusExt.PAUSED_PENDING_INPUT);
              } else {
                  setStatus(StatusExt.IN_PROGRESS);
              }
          }
          {code}
          attachment image is exception stack.

          When the FlowExecution 'isComplete' return true,get the 'Result' from WorkflowRun's function 'getResult',but maybe this moment result is null

          original code is :
          {code:java}
          private void initStatus(WorkflowRun run) {
              FlowExecution execution = run.getExecution();

              if (execution == null) {
                  setStatus(StatusExt.NOT_EXECUTED);
              } else if (execution.getCauseOfFailure() != null) {
                  setStatus(StatusExt.valueOf(execution.getCauseOfFailure()));
              } else if (execution.isComplete()) {
                  Result r = run.getResult();
                  setStatus(StatusExt.valueOf(r));
              } else if (isPendingInput(run)) {
                  setStatus(StatusExt.PAUSED_PENDING_INPUT);
              } else {
                  setStatus(StatusExt.IN_PROGRESS);
              }
          }{code}
          Maybe the correct code to get 'Result' is :
          {code:java}
          private void initStatus(WorkflowRun run) {
              FlowExecution execution = run.getExecution();

              if (execution == null) {
                  setStatus(StatusExt.NOT_EXECUTED);
              } else if (execution.getCauseOfFailure() != null) {
                  setStatus(StatusExt.valueOf(execution.getCauseOfFailure()));
              } else if (execution.isComplete()) {
                  Result r = run.getResult();
                 // ensure Result is not null
                 if(null == r) {
                   r =((FlowEndNode)execution.getCurrentHeads().get(0)).getResult();
                 }
                 setStatus(StatusExt.valueOf(r));
              } else if (isPendingInput(run)) {
                  setStatus(StatusExt.PAUSED_PENDING_INPUT);
              } else {
                  setStatus(StatusExt.IN_PROGRESS);
              }
          }
          {code}
          mierihazai kun made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          mierihazai kun made changes -
          Assignee Sam Van Oort [ svanoort ] kun [ JIRAUSER133764 ]
          Resolution Fixed [ 1 ]
          Status In Progress [ 3 ] Resolved [ 5 ]
          mierihazai kun made changes -
          Status Resolved [ 5 ] Closed [ 6 ]

          People

            mierihazai kun
            mierihazai kun
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: