-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
[BUG] Salt State msteams.post_card 400 Bad request #64973
Comments
Can you add debug logs from the minion when running this state? |
Below Minion DEBUG logs:
Thanks. |
so, in this case to since the state uses salt.utils.http.query we would need trace not debug. that would give us what is actually sent. |
Thanks @whytewolf , below are trace logs.
|
{"text": "centos-test-minion Patch State Failed", "title": "Patching Failed", "themeColor": null} Does that fail when you send it with Aside: it would be very useful if the body of the error response were logged. |
yes I can confirm that with curl it works:
|
No, with the same body as Salt is sending. |
|
I am also seeing this in v3005.2 classic, since 3005.1 at least. I have a daily job that would post to teams, last successful post was 7/4/23. |
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. |
looking at the code i have an idea of what it might be. @haykhovsepyan can you try one more curl test. without the json header? the code doesn't have the header. |
Hi @whytewolf , without json header I got the same error with curl.
|
@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. |
hi @whytewolf , I appreciate your attention to this matter. Could you please clarify on which version expected this fix (as I got on 3006.4) , and if possible, I would like to receive an approximation of the release date for this fixed version. Thanks. |
@haykhovsepyan this was changed to 3006.4 milestone when the pr was put in because there was a freeze in place for 3006.3 and it didn't look like it would make it into that version. however the freeze was bumped a little bit which allowed me to get this into the 3006.3 version. I can't give the exact eta on its release but 3006.3 is right around the corner. like within a week or two. |
3006.3 was released and #65007 was included, closing bug report |
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
Please be as specific as possible and give set-up details.
Steps to Reproduce the behavior
salt centos-test-minion state.apply os.updates.teams-notification
centos-test-minion:
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.
The text was updated successfully, but these errors were encountered: