jenkinsci / hipchat-plugin

HipChat notification plugin for Jenkins
https://plugins.jenkins.io/hipchat/
54 stars 85 forks source link

Message 401 from pipeline #91

Closed andrew-boutin closed 7 years ago

andrew-boutin commented 7 years ago

I have a Jenkins server (version 2.19.4) and HipChat Cloud setup. I'm using Jenkins pipeline for job configuration. My HipChat admin generated a token for me. I have installed the HipChat plugin (version 2.0.0) for Jenkins and configured it. I can click Test Configuration and I successfully get a message in my designated HipChat room. The problem is when I try to send a HipChat message from my pipeline Jenkinsfile. I get a 401 error in the Jenkins build console log.

Here is the 401 error:

[Pipeline] hipchatSend
[ERROR] HipChat notification failed with error message: Unexpected response code from HipChat: 401
ERROR: [ERROR] HipChat notification failed with error message: Unexpected response code from HipChat: 401

Here is the config in the Jenkinsfile:

// Send a message to HipChat
hipchatSend (
    message: "${jobHeadline}"
)

Is there a specific reason that the test configuration would work, but it wouldn't work from my pipeline? Thank you.

andrew-boutin commented 7 years ago

I believe this isn't an issue with your plugin, but rather an issue with Jenkins pipeline not using Jenkins system configuration values for plugins.

aldaris commented 7 years ago

Config related issues would be most likely due to plugin bugs/problems, however I was unable to reproduce this issue locally. In my setup I have a Credential selected in the System configuration section, and because of that the hipchatSend step uses that exact credential when sending messages. I believe this should work since version 2.0.0 just fine.