jenkinsci / office-365-connector-plugin

Office 365 Connector plugin sends jobs status notifications to Microsoft Teams or Outlook
https://plugins.jenkins.io/Office-365-Connector/
Apache License 2.0
89 stars 86 forks source link

office365ConnectorSend stopped working with Jenkins 2.387.1 #306

Closed d066471 closed 1 year ago

d066471 commented 1 year ago

Jenkins and plugins versions report

Environment ``` Jenkins: 2.387.1 OS: Linux - 5.10.162+ Java: 11.0.18 - Eclipse Adoptium (OpenJDK 64-Bit Server VM) --- Office-365-Connector:4.14.0 ```

What Operating System are you using (both controller, and any agents involved in the problem)?

Linux Ubuntu

Reproduction steps

  1. Create a webhook URL for a teams channel.
  2. Provide this URL as a property to office365ConnectorSend
  3. Run the pipeline and it fails with following error:

07:24:20 Masking supported pattern matches of $WEBHOOK_URL 07:24:20 [Pipeline] { 07:24:20 [Pipeline] office365ConnectorSend 07:24:20 [Pipeline] } 07:24:20 [Pipeline] // withCredentials 07:24:20 [Pipeline] } 07:24:20 [Pipeline] // stage 07:24:20 [Pipeline] } 07:24:20 [Pipeline] // node 07:24:20 [Pipeline] End of Pipeline 07:24:20 java.lang.ClassNotFoundException: org.apache.commons.httpclient.Credentials 07:24:20 at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:476) 07:24:20 at jenkins.util.URLClassLoader2.findClass(URLClassLoader2.java:35) 07:24:20 at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:589) 07:24:20 at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522) 07:24:20 Caused: java.lang.NoClassDefFoundError: org/apache/commons/httpclient/Credentials 07:24:20 at jenkins.plugins.office365connector.Office365ConnectorWebhookNotifier.executeWorker(Office365ConnectorWebhookNotifier.java:115) 07:24:20 at jenkins.plugins.office365connector.Office365ConnectorWebhookNotifier.sendBuildStepNotification(Office365ConnectorWebhookNotifier.java:108) 07:24:20 at jenkins.plugins.office365connector.workflow.Execution.run(Execution.java:33) 07:24:20 at jenkins.plugins.office365connector.workflow.Execution.run(Execution.java:15) 07:24:20 at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47) 07:24:20 at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) 07:24:20 at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) 07:24:20 at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) 07:24:20 at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) 07:24:20 at java.base/java.lang.Thread.run(Thread.java:829) 07:24:20
07:24:20 GitHub has been notified of this commit’s build result

Expected Results

Pipeline should run green.

Actual Results

Pipeline failed while communicating with office365ConnectorSend API

Anything else?

New webhook URL was created but it still does not work.

AxxlFoley commented 1 year ago

Just commenting here to state, that I have the same issue in our pipelines after JAAS upgrade.

AxxlFoley commented 1 year ago

@d066471 Upgrade to the latest version of the plugin (v 4.18.0) fixed our issue.

d066471 commented 1 year ago

Updating to Office 365 Connector v4.18.0 should resolve the issue.