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

can not send email from wmagent docker container #12159

Open
mapellidario opened this issue Oct 28, 2024 · 2 comments · May be fixed by dmwm/CMSKubernetes#1566
Open

can not send email from wmagent docker container #12159

mapellidario opened this issue Oct 28, 2024 · 2 comments · May be fixed by dmwm/CMSKubernetes#1566
Assignees
Labels
BUG containerization deployment Issue related to deployment of the services

Comments

@mapellidario
Copy link
Member

Impact of the bug

All of WMAgents

Describe the bug

The script https://github.com/dmwm/WMCore/blob/master/deploy/restartComponent.sh run from a cronjob inside the wmagent docker container fails to send emails.

How to reproduce it

log into a wmagent, change to cmst1 user, then you can use the command mail to send an email with s-nail

cmst1@vocms0262:~ $ # from the host, send an email with "s-nail"
cmst1@vocms0262:~ $ mail -V
s-nail v14.9.22, 2021-02-24 (built for Linux)
cmst1@vocms0262:~ $ echo -e "test email N" | mail -s "${HOSTNAME} : test email N" [email protected]

then start a shell inside a wmagent docker container: the comman mail points to mailutils, but there is not

(WMAgent-2.3.5) [cmst1@vocms0262:current]$ mail -V
mail (GNU Mailutils) 3.10
Copyright (C) 2007-2019 Free Software Foundation, inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
(WMAgent-2.3.5) [cmst1@vocms0262:current]$ echo -e "test email N" | mail -s "${HOSTNAME} : test email N" [email protected]
mail: cannot send message: Process exited with a non-zero status
(WMAgent-2.3.5) [cmst1@vocms0262:current]$ echo -e "test email N" | mail --debug-level=mailer.trace9 [email protected]
mail: sendmail binary: /usr/sbin/sendmail
mail: mu_mailer_send_message(): using From: cmst1
mail: exec /usr/sbin/sendmail argv: /usr/sbin/sendmail -oi -f [email protected] -t
mail: Sending headers...
mail: Sending body...
mail: /usr/sbin/sendmail exited with: 1
mail: progmailer error: Process exited with a non-zero status
mail: cannot send message: Process exited with a non-zero status
(WMAgent-2.3.5) [cmst1@vocms0262:current]$ sendmail
exim: failed to find uid for user name "Debian-exim"
(WMAgent-2.3.5) [cmst1@vocms0262:current]$

Expected behavior

we should be able to send emails from inside the wmagent docker container

Additional context and error message

Possible solutions

We can properly install a mail client inside the wmagent docker container.

Alternatively, we can get rid of these emails and send the event to AMQ/opensearch and display them in a table in grafana. I would prefer this second option.

@mapellidario mapellidario added BUG deployment Issue related to deployment of the services containerization labels Oct 28, 2024
@khurtado khurtado self-assigned this Nov 4, 2024
@khurtado khurtado moved this from ToDo to In Progress in WMCore quarterly developments Nov 4, 2024
@amaltaro
Copy link
Contributor

@khurtado I am afraid I might have missed a possible solution for this. Can you please confirm if this is still being worked on? If it's resolved, then I would suggest to provide the PR in here and close it. Thanks

@khurtado
Copy link
Contributor

khurtado commented Nov 21, 2024

@amaltaro I have a working solution that fixes exim4. The solution in short:

  • Adds a couple users/groups needed by exim4-daemon-light
  • Configures exim4 to work externally (internet mode)
  • Starts exim4 service

I will make a PR soon.

EDIT: @amaltaro This works for me:
dmwm/CMSKubernetes#1566

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BUG containerization deployment Issue related to deployment of the services
Projects
Status: In Progress
Development

Successfully merging a pull request may close this issue.

3 participants