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

failOnError does not work if authentication with server fails

    XMLWordPrintable

Details

    • Plugin Update

    Description

      failOnError parameter does not work as expected when the plugin execution fails at the authentication part. This happens if the whole RocketChat server is unreachable.

      Stacktrace:

      jenkins.plugins.rocketchatnotifier.rocket.errorhandling.RocketClientException: Please check if the server API https://xxx.com/api/v1/login is correct: (Login-Error 1)
      at jenkins.plugins.rocketchatnotifier.rocket.RocketChatBasicCallAuthentication.doAuthentication(RocketChatBasicCallAuthentication.java:51)
      at jenkins.plugins.rocketchatnotifier.rocket.RocketChatClientCallBuilder.buildCall(RocketChatClientCallBuilder.java:90)
      at jenkins.plugins.rocketchatnotifier.rocket.RocketChatClientCallBuilder.buildCall(RocketChatClientCallBuilder.java:80)
      at jenkins.plugins.rocketchatnotifier.rocket.RocketChatClientImpl.getChannels(RocketChatClientImpl.java:90)
      at jenkins.plugins.rocketchatnotifier.RocketClientImpl.<init>(RocketClientImpl.java:30)
      at jenkins.plugins.rocketchatnotifier.workflow.RocketSendStep$RocketSendStepExecution.getRocketClient(RocketSendStep.java:249)
      at jenkins.plugins.rocketchatnotifier.workflow.RocketSendStep$RocketSendStepExecution.run(RocketSendStep.java:225)
      at jenkins.plugins.rocketchatnotifier.workflow.RocketSendStep$RocketSendStepExecution.run(RocketSendStep.java:181)
      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)
      Caused by: com.mashape.unirest.http.exceptions.UnirestException: java.lang.RuntimeException: java.lang.RuntimeException: org.json.JSONException: A JSONArray text must start with '[' at 1 [character 2 line 1]
      at com.mashape.unirest.http.HttpClientHelper.request(HttpClientHelper.java:143)
      at com.mashape.unirest.request.BaseRequest.asJson(BaseRequest.java:68)
      at jenkins.plugins.rocketchatnotifier.rocket.RocketChatBasicCallAuthentication.doAuthentication(RocketChatBasicCallAuthentication.java:49)
      ... 15 more

      Attachments

        Activity

          lasselindqvist Lasse Lindqvist added a comment - A possible fix is available here: https://github.com/lasselindqvist/rocketchatnotifier-plugin/blob/638e0f8040bbc869203cab8d213d3fe1c70862bb/src/main/java/jenkins/plugins/rocketchatnotifier/workflow/RocketSendStep.java I will try find time to test the solution and make it mergeable.

          I tried to try this out, but
          RocketSendStep imports class jenkins.plugins.rocketchatnotifier.Messages which is nowhere to be found causing a build error in IntelliJ IDEA.

          A fully untested and uncompiled fix is available here (https://github.com/jenkinsci/rocketchatnotifier-plugin/compare/develop...lasselindqvist:JENKINS-57106?expand=1) anyway.

          lasselindqvist Lasse Lindqvist added a comment - I tried to try this out, but RocketSendStep imports class jenkins.plugins.rocketchatnotifier.Messages which is nowhere to be found causing a build error in IntelliJ IDEA. A fully untested and uncompiled fix is available here ( https://github.com/jenkinsci/rocketchatnotifier-plugin/compare/develop...lasselindqvist:JENKINS-57106?expand=1 ) anyway.

          Fixed in 1.4.3

          mreinhardt Martin Reinhardt added a comment - Fixed in 1.4.3

          People

            mreinhardt Martin Reinhardt
            lasselindqvist Lasse Lindqvist
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: