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

Channel name must be room's "name", "fname" does not work

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • RocketChat Notifier plugin version: 1.4.9
      Rocket.Chat Server version: 3.7.1
      Jenkins server version: 2.263

      Not sure if this is a RC server or Jenkins plugin issue, but I have noticed that if you have a channel "Test-channel" (as channel full name) in Rocket.chat server and you define rocketSend in pipeline:

                              rocketSend (
                                  channel: "Test-channel",
                                  message: "Build failed. Build-URL: ${env.BUILD_URL}",
                                  rawMessage: true
                              )
      

      the notification send fails.
      Job console log error:

      ERROR: RocketChat notification failed. See Jenkins logs for details.
      

      jenkins.log error:

      2020-11-27 12:03:06.582+0000 [id=8301961]       SEVERE  j.p.r.r.RocketChatClientImpl#sendSingleMessage: Could not send message: Response{success=false, messages=null, message=null, users=null, user=null, channels=null, channel=null, version=null, error=[invalid-channel]}
      2020-11-27 12:03:06.582+0000 [id=8301961]       SEVERE  j.p.r.RocketClientImpl#publish: I/O error error during publishing message
      jenkins.plugins.rocketchatnotifier.rocket.errorhandling.RocketClientException: The send of the message was unsuccessful. Response{success=false, messages=null, message=null, users=null, user=null, channels=null, channel=null, version=null, error=[invalid-channel]}
              at jenkins.plugins.rocketchatnotifier.rocket.RocketChatClientImpl.sendSingleMessage(RocketChatClientImpl.java:183)
              at jenkins.plugins.rocketchatnotifier.rocket.RocketChatClientImpl.send(RocketChatClientImpl.java:148)
              at jenkins.plugins.rocketchatnotifier.RocketClientImpl.publish(RocketClientImpl.java:52)
              at jenkins.plugins.rocketchatnotifier.workflow.RocketSendStep$RocketSendStepExecution.run(RocketSendStep.java:264)
              at jenkins.plugins.rocketchatnotifier.workflow.RocketSendStep$RocketSendStepExecution.run(RocketSendStep.java:211)
              at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47)
              at hudson.security.ACL.impersonate(ACL.java:367)
              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)
      

      If you use only lowercase (i.e. "name") in your channel name in rocketSend, i.e.:

                              rocketSend (
                                  channel: "test-channel",
                                  message: "Build failed. Build-URL: ${env.BUILD_URL}",
                                  rawMessage: true
                              )
      

      the notification is sent to "Test-channel" room.
      Requesting support for "fname" of channels and/or update the documentation to highlight this requirement.

            mreinhardt Martin Reinhardt
            ipi_kiiskinen Ipi Kiiskinen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: