Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin ignores 500 - Internal server error #280

Open
stmlange opened this issue Aug 12, 2022 · 5 comments
Open

Plugin ignores 500 - Internal server error #280

stmlange opened this issue Aug 12, 2022 · 5 comments
Labels

Comments

@stmlange
Copy link

Jenkins and plugins versions report

Environment
Jenkins: 2.303.2
OS: Linux - 5.4.0-91-generic
---
Office-365-Connector:4.15.2

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

N/A

Reproduction steps

  1. Use an invalid webhook that results in a Internal Server on MS Teams side:
curl.exe -H "Content-Type:application/json" -d "{'text':'Hello World'}" https://outlook.office.com/webhook/deadbeef
  1. Run the plugin with
office365ConnectorSend(
        webhookUrl: 'https://outlook.office.com/webhook/deadbeef',
        color: 'red',
        message: "Build failed: ${JOB_NAME} - ${BUILD_DISPLAY_NAME}")

Expected Results

Error message in the logs

Actual Results

Nothing. No messages. Hard to troubleshoot what's going in within the plugin.

Anything else?

No response

@stmlange stmlange added the bug label Aug 12, 2022
@al32-rs
Copy link

al32-rs commented Feb 8, 2024

I've just fallen into this.
I was attempting to detect failures in sending messages through the office365ConnectorSend step, and I couldn't find a reliable way. There's no return code from the step, nor any exception is raised. It just fails silently (v4.20.2).

@damianszczepanik
Copy link
Member

Looks like gap in implementation - what would you expect to have when connection returns 5xx http code?

@stmlange
Copy link
Author

me personally:

Expected Results
Error message in the logs

@al32-rs
Copy link

al32-rs commented Feb 15, 2024

I'd like any mechanism to detect if a failure happened, in order to rely on some other fallback mechanism (e.g. email).
Could be achieved by throwning an exception (that's a quite common pattern for Jenkins pipeline steps), or either a return code (some people find it more convenient). I don't rreally have any preference, as long as there's a way to detect the message wasn't sent from the pipeline script.

@damianszczepanik
Copy link
Member

Logging seems to be work fine as for above url I got

[Office365connector] Failed to post data to webhook - https://outlook.office.com/webhook/deadbeef
java.net.UnknownHostException

for some other:

[Office365connector] Failed to post data to webhook - https://nonexist.webhook.office.com/webhookb2/4228c035-258e-45fd-a4b1-07810985fae9@0ae51e19-07c8-4e4b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants