salt: [BUG] Salt State msteams.post_card 400 Bad request
Description after execution msteams.post_card getting ERROR Failed to send message (400) using Curl post request to the same hook_url works fine
Setup send-msteams-message: msteams.post_card: - title: Patching Failed - message: “{{grains[“id”]}} Patch State Failed” - hook_url: {{ pillar[‘teams’][‘webhooks’][‘patching-channel’] }}
salt centos-test-minion pillar.item teams:webhooks:patching-channel
centos-test-minion:
----------
teams:webhooks:patching-channel:
https://XXXXXX.webhook.office.com/webhookb2/926261a9-26ac-45e6-bbc8-3b8715a30972@ff009f2c-d651-472e-b73e-e0f894c6011e/IncomingWebhook/5c13f52123ab41b8875199cd3bebd667/996cec87-5503-4ee2-a0d1-3ad25a6f5775
Please be as specific as possible and give set-up details.
- on-prem machine
- [ X] VM (Virtualbox, KVM, etc. please specify)
- VM running on a cloud service, please be explicit and add details
- container (Kubernetes, Docker, containerd, etc. please specify)
- or a combination, please be explicit
- jails if it is FreeBSD
- classic packaging
- onedir packaging
- used bootstrap to install
Steps to Reproduce the behavior salt centos-test-minion state.apply os.updates.teams-notification
centos-test-minion:
ID: send-msteams-message
Function: msteams.post_card
Result: False
Comment: Failed to send message (400): send-msteams-message
Started: 13:56:45.087942
Duration: 1932.238 ms
Changes:
curl -X POST -H 'Content-Type: application/json' -d '{"text": "Test"}' https://XXXXXX.webhook.office.com/webhookb2/926261a9-26ac-45e6-bbc8-3b8715a30972@ff009f2c-d651-472e-b73e-e0f894c6011e/IncomingWebhook/5c13f52123ab41b8875199cd3bebd667/996cec87-5503-4ee2-a0d1-3ad25a6f5
with curl WORKS
Expected behavior A clear and concise description of what you expected to happen.
Screenshots If applicable, add screenshots to help explain your problem.
Versions Report
salt --versions-report
salt --versions-report Salt Version: Salt: 3006.1Python Version: Python: 3.10.11 (main, May 5 2023, 02:31:54) [GCC 11.2.0]
Dependency Versions: cffi: 1.14.6 cherrypy: unknown dateutil: 2.8.1 docker-py: Not Installed gitdb: Not Installed gitpython: Not Installed Jinja2: 3.1.2 libgit2: Not Installed looseversion: 1.0.2 M2Crypto: Not Installed Mako: Not Installed msgpack: 1.0.2 msgpack-pure: Not Installed mysql-python: Not Installed packaging: 22.0 pycparser: 2.21 pycrypto: Not Installed pycryptodome: 3.9.8 pygit2: Not Installed python-gnupg: 0.4.8 PyYAML: 5.4.1 PyZMQ: 23.2.0 relenv: 0.12.3 smmap: Not Installed timelib: 0.2.4 Tornado: 4.5.3 ZMQ: 4.3.4
System Versions: dist: rocky 8.7 Green Obsidian locale: utf-8 machine: x86_64 release: 4.18.0-425.19.2.el8_7.x86_64 system: Linux version: Rocky Linux 8.7 Green Obsidian
PASTE HERE
Additional context Add any other context about the problem here.
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 16 (10 by maintainers)
Commits related to this issue
- fix #64973 by adding header that microsoft started enforcing. — committed to whytewolf/salt by whytewolf 10 months ago
- fix #64973 by adding header that microsoft started enforcing. — committed to saltstack/salt by whytewolf 10 months ago
@haykhovsepyan perfect, thank you. looks like i was right it is the lack of the header. Microsoft must have changed to enforcing the header when they haven’t for years.
I’ll get the header added. thank you very much. this was exactly what I needed.
That is to be expected. the issue wasn’t a change on salts side it was microsoft changed something without documenting the change. right now we are trying to figure out what changed, so that we can get a fix in.