semaphore
semaphore copied to clipboard
Email alerts not working
Hi, I have some troubles to get the email alerts working.
Semaphore v2.8.53
config.json:
"email_sender": "xxx@xxx", "email_host": "email-smtp.eu-west-1.amazonaws.com", "email_port": "587", "email_username": "XXX", "email_password": "XXX", "email_alert": true, "email_secure": true,
Enabled "Allow Alerts for this project" Enabled "Send Alerts" for the specific user
Created an ansible script to raise an error:
4:34:41 PM PLAY [Playing with Ansible and Git] ******************************************** 4:34:41 PM TASK [Gathering Facts] ********************************************************* 4:34:41 PM 4:34:41 PM 4:34:48 PM ok: [localhost] 4:34:48 PM 4:34:48 PM TASK [Generate an error] ******************************************************* 4:34:51 PM fatal: [localhost]: FAILED! => {"changed": true, "cmd": "exit 1", "delta": "0:00:00.017528", "end": "2022-08-17 16:34:50.762393", "msg": "non-zero return code", "rc": 1, "start": "2022-08-17 16:34:50.744865", "stderr": "", "stderr_lines": [], "stdout": "", "stdout_lines": []} 4:34:51 PM 4:34:51 PM PLAY RECAP ********************************************************************* 4:34:51 PM localhost : ok=1 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0 4:34:51 PM 4:34:51 PM
Running playbook failed: exit status 2
Started semaphore from CLI to get output:
./semaphore server --config config.json
Getting back only INFO logs, no error, no warnings:
INFO[0573] Set resource locker with TaskRunner 58 INFO[0573] Task 58 removed from queue INFO[0590] Stopped running TaskRunner 58 INFO[0590] Release resource locker with TaskRunner 58
Tested different SMTP ports, added wrong credentials, changed email-host to force an error... nothing happens. Seems like Semaphore does not even try to send an email.
Any idea what is missing?
@Hi-Res-Cam Did you solved the problem?? I have same issue
no, the problem still persists
@fiftin I use semaphore from 'master' branch. and I have same issue. Can you check this issue??
Fixed in v2.8.67: https://github.com/ansible-semaphore/semaphore/releases/tag/v2.8.67
Just got this working (was a bit of a run-around when using docker, which I will try to submit a discussion or bug or PR about, TBD).
However, I'm only getting failed alerts, not success alerts. Got a failed email from the bottom job but nothing from the top one run right after it.
Suppress success alerts is not currently checked for this job
config.json
{
"mysql": {
"host": "mysql-semaphore:3306",
"user": "semaphore_user",
"pass": "******",
"name": "semaphore_db",
"options": null
},
"bolt": {
"host": "",
"user": "",
"pass": "",
"name": "",
"options": null
},
"postgres": {
"host": "",
"user": "",
"pass": "",
"name": "",
"options": null
},
"dialect": "mysql",
"port": "",
"interface": "",
"tmp_path": "/tmp/semaphore",
"cookie_hash": "******",
"cookie_encryption": "******",
"access_key_encryption": "*******",
"email_sender": "********",
"email_host": "smtp.gmail.com",
"email_port": "587",
"email_username": "***********",
"email_password": "*******",
"web_host": "",
"ldap_binddn": "",
"ldap_bindpassword": "",
"ldap_server": "",
"ldap_searchdn": "",
"ldap_searchfilter": "",
"ldap_mappings": {
"dn": "",
"mail": "",
"uid": "",
"cn": ""
},
"telegram_chat": "",
"telegram_token": "",
"slack_url": "",
"max_parallel_tasks": 0,
"email_alert": true,
"email_secure": true,
"telegram_alert": false,
"slack_alert": false,
"ldap_enable": false,
"ldap_needtls": false,
"ssh_config_path": "",
"demo_mode": false
}
@bverkron Semaphore only send Email when task failed. It's working correctly.
telegram, slack alert only support success alerting.
@bverkron Semaphore only send Email when task failed. It's working correctly.
telegram, slack alert only support success alerting.
Any specific reason for that? Seems inconsistent and not sure I understand why email doesn't follow the same pattern as telegram and slack.
Also, is this documented anywhere? I don't see anything about that difference in the doc or the interface.
Hi @bverkron ,
- It can seems inconsistent, but Semaphore works so initially. Email used for critical alerts.
- Telegram and Slack used for all alerts, but you can disable success alerts for templates.
Hi all, I'm using Version v2.8.74 and have exact the same issue.
On Playbook fails, no mails will be send. No erros or something else, no info, that an email will be send.
We are using an smtp relay host, without authentication. Our Config looks like this.
"email_sender": "ansible@********.dom",
"email_host": "mail.********.dom",
"email_port": "25",
"email_username": "",
"email_password": "",
"email_alert": true,
"email_secure": false,
project alert and user alert is enabled.
I have this same issue running Semaphore in Docker containers. I set the config.json value email_alert to true and also turned it on at the project and user levels, but I still do not get email alerts on failure. Oddly enough, when I created a new project, I can get the emails to send, but only the failures.
@feedjosiah same things for me. Finally I found the problem. If you add team members to your project and they don't have permission to send alerts. Even if you have the right to do so, You loose this option.
Unless you give this right to team members. There you can send alerts again.
Hopes it'll help someone
@moshgit Thanks, I've added alerts to everyone in the team and it is currently working. 👍 I rebuilt the whole project though, so it's hard to say if that was the solution.
Hi all, I'm using Version v2.8.74 and have exact the same issue.
On Playbook fails, no mails will be send. No erros or something else, no info, that an email will be send.
We are using an smtp relay host, without authentication. Our Config looks like this.
"email_sender": "ansible@********.dom", "email_host": "mail.********.dom", "email_port": "25", "email_username": "", "email_password": "", "email_alert": true, "email_secure": false,
project alert and user alert is enabled.
A similar situation. v2.8.81 Mail logs are empty
@all the best way to find error is to look for logs, run semaphore from a command like this /usr/bin/semaphore server --config /etc/semaphore/config.json
Go to semaphore, Then try to run a fail test task, You will be able to see error in the logs