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

Slack notifications not working #1627

Closed
UNiXMIT opened this issue Nov 14, 2023 · 5 comments · Fixed by #1771 or #1788
Closed

Slack notifications not working #1627

UNiXMIT opened this issue Nov 14, 2023 · 5 comments · Fixed by #1771 or #1788
Assignees
Labels

Comments

@UNiXMIT
Copy link

UNiXMIT commented Nov 14, 2023

I've configured Slack in Semaphore:

"slack_alert": true,
"slack_url": "https://slackWebhook/abcd",

I've enabled alerts everywhere I could find a checkbox in the UI:
"Allow alerts for this project" set on the project.
"Send alerts" is set for the user.
The task does NOT have to be "Suppress success alerts" checked.

But still no notification sent when a task succeeds.

I am running version 2.9.37 in a container on Linux (Rocky 9.2).
A curl command to the same webhook from within the container is successful.

Any ideas what could be wrong or any diagnostics I can check to investigate this further?
Thanks

@Alex-Giaquinto
Copy link

Alex-Giaquinto commented Nov 15, 2023

@UNiXMIT I have had the same issue with the last two or three releases, don't think it has ever worked.

@fiftin fiftin added the bug label Nov 17, 2023
@fiftin
Copy link
Collaborator

fiftin commented Nov 17, 2023

Hi @UNiXMIT

will check soon, thank you!

@fiftin fiftin self-assigned this Nov 17, 2023
@aaronnad
Copy link

aaronnad commented Nov 26, 2023

@Alex-Giaquinto I've had slack notifications working on 2.9.4.

Can't send slack alert! Response code: 400

On 2.9.37 running on Rcky Linux VM, i am getting the above now

@John-Limb
Copy link

I've noticed in my playbooks I am now getting
Can't send slack alert! Error: Post "": unsupported protocol scheme ""

My config looks like

slack-alert true
slack-url https://hooks.slack.com/services/xxxyyy/xxxyyy/xxxyyysssyyy

@thibaultserti
Copy link
Contributor

thibaultserti commented Feb 19, 2024

For me it's working but only for Task ending in success
For failure, it seems the problem comes from the color "bad" which doesn't exist and cause a 400

Color defined here: https://github.com/ansible-semaphore/semaphore/blob/570a9d323ab02834041bddaf91fa651b5a9f1c69/services/tasks/alert.go#L205
Slack documentation: https://api.slack.com/reference/messaging/attachments#fields

The color to use is "danger"

I am testing this with Discord Slack compatibility tough

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