[ZBX-22160] notifications to MS Teams duplicated and action failed Created: 2023 Jan 04  Updated: 2024 Sep 18  Resolved: 2024 Sep 18

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Server (S)
Affects Version/s: 6.0.12, 6.2.6, 6.4.0beta5
Fix Version/s: None

Type: Problem report Priority: Major
Reporter: Alessandro Lombardi Assignee: Aleksandr Iantsen
Resolution: Workaround proposed Votes: 3
Labels: Microsoft, Teams, Webhook, media, notifications
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File 0001-fix-response-handling.patch    
Team: Team INT

 Description   

Steps to reproduce:

  1. Post message to MS teams webhook

Result:

Action fail with error:

Sending failed: {"version":"1.1","content":{"headers":[

{"key":"Content-Type","value":["text/plain; charset=utf-8"]}

]},"statusCode":200,"reasonPhrase":"OK","headers":[],"trailingHeaders":[],"requestMessage":null,"isSuccessStatusCode":true}

 

Messages on MS Teams are posted but duplicated or triplicated.

Issue started yesterday 3 January 2023, probably due to a change on MS Teams side

 

Expected:
Messages posted only 1 time and action that is not failing



 Comments   
Comment by Stefan Hölzle [ 2023 Jan 05 ]

I uploaded a patch with a working solution: 0001-fix-response-handling.patch
The patch is based on this version: https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/media/msteams/media_msteams.yaml?at=release%2F6.0

Comment by Alessandro Lombardi [ 2023 Jan 05 ]

I have tried the patch but is failing too

the error now is:

Sending failed: TypeError: undefined not callable (property 'getStatus' of [object Object])

Comment by Stefan Hölzle [ 2023 Jan 05 ]

Alessandro,
Could you post your full script?
And on which version (commit) of the media_msteams.yaml did you apply my patch?
Which Zabbix version did you use for testing?

Comment by Alessandro Lombardi [ 2023 Jan 05 ]

Ah no sorry you were correct, my media template was not updated with the one you posted.

Now it works

Thanks!

 

Comment by Stefan Hölzle [ 2023 Jan 05 ]

Comment by Marcel [ 2023 Jan 10 ]

Can I safely use this if I have same issue on Zabbix server 5.4.12?

Comment by Stefan Hölzle [ 2023 Jan 10 ]

Well, maybe. As I said, the patch is based on the latest commit of the release/6.0 branch.
You use Zabbix Server 5.4.12, but that doesn't mean the version of your ms-teams template is the one from Zabbix 5.4.12. The ms-teams template is an option manual import and it doesn't update automatically, so maybe you have an older or even a new version.

I guess the easiest way to find out if my solution is working for you, would be to clone the "MS Teams" media type in your Zabbix installation. Then configure it send to another webhook and apply my patch. In order to test the new media type, you could set up an action that only sends events of some test trigger you can toggle.

Comment by Christian Francis [ 2023 Jan 12 ]

Could you tell me how I should use the patch?

 

Regards.

 

Comment by Marcel [ 2023 Jan 13 ]

I exported my media type (5.4) as yaml, compare it with one used by Stefan (6.0) and there were only differences in "version name" so it was safe to change those few lines and it worked like a charm

Comment by Christian Francis [ 2023 Jan 13 ]

I now understand what the patching refers to, thank you.

Regards.

Comment by Aleksandr Iantsen [ 2024 Sep 18 ]

lombardi.aless, thank you very much for this report and thanks everyone for your contribution. We appreciate your attention to the issue.

Since Microsoft has announced retirement of Office 365 connectors within Microsoft Teams the current mediatype based on, we have developed MS Teams mediatype based on MS Teams Workflow and recommend to migrate to it. 

Generated at Mon May 05 08:16:08 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.