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

MailNotifier fails with SMTP error if useTLS=False but buildbot[tls] has been installed. #5609

Closed
mrstanwell opened this issue Nov 2, 2020 · 0 comments · Fixed by #7087
Closed
Labels

Comments

@mrstanwell
Copy link

If I install buildbot and then install the buildbot[tls] bundle, it pulls in dependencies pyasn1 pyasn1-modules pyopenssl service-identity. However, after that, MailNotifier runs start failing due to failure to connect to SMTP server, even though useTLS is not set.

Using:

  • Ubuntu LInux 18.04.5
  • Python 3.6.9
  • buildbot 2.8.4

Steps to reproduce:

  1. Create a new virtual environment and activate it.
  2. pip install --upgrade pip wheel setuptools
  3. pip install buildbot[bundle]
  4. pip install buildbot[tls]
  5. pip install requests (I need this because I'm using Google Auth)
  6. Start buildbot with a master.cfg that has a MailNotifier configured, and do something that triggers the MailNotifier.

Expected behavior:

  • Email notification is sent

Actual behavior:

2020-11-02 14:45:46-0600 [-] Starting factory <twisted.mail.smtp.ESMTPSenderFactory object at 0x7f2dd58e5048>
2020-11-02 14:45:46-0600 [ESMTPSender,client] SMTP Client retrying server. Retry: 5
2020-11-02 14:45:46-0600 [ESMTPSender,client] SMTP Client retrying server. Retry: 4
2020-11-02 14:45:46-0600 [ESMTPSender,client] SMTP Client retrying server. Retry: 3
2020-11-02 14:45:46-0600 [ESMTPSender,client] SMTP Client retrying server. Retry: 2
2020-11-02 14:45:46-0600 [ESMTPSender,client] SMTP Client retrying server. Retry: 1
2020-11-02 14:45:46-0600 [-] Stopping factory <twisted.mail.smtp.ESMTPSenderFactory object at 0x7f2dd58e5048>
...
2020-11-02 14:46:25-0600 [-] Unhandled error in Deferred:
2020-11-02 14:46:25-0600 [-] Unhandled Error
    Traceback (most recent call last):
    --- <exception caught here> ---
      File "REDACTED/lib/python3.6/site-packages/buildbot/reporters/notifier.py", line 279, in buildMessage
        list(users), patches, logs)
      File "REDACTED/lib/python3.6/site-packages/buildbot/reporters/mail.py", line 280, in sendMessage
        yield self.sendMail(m, all_recipients)
    twisted.mail._except.SMTPConnectError: Unable to connect to server.

If I uninstall the above listed dependencies installed by buildbot[tls], MailNotifier resumes normal operation.

Am I doing something wrong? I encountered this issue when trying to get the buildbot-gitea plugin to work, since it requires either treq or txrequests, and installing treq pulls in the same package dependencies that buildbot[tls] does. Fortunately, installing txrequests does not pull those packages in, so if I use txrequests instead I can get buildbot-gitea to work. However, it seems odd that MailNotifier should break in this way just because those additional packages have been installed.

Thanks in advance for any suggestions...

@p12tic p12tic added the bug label Dec 8, 2020
vibbo added a commit to vibbo/buildbot that referenced this issue Sep 4, 2023
``MailNotifier`` didn't work when it was configured to use plan TCP but SSL packages were installed (to support workers over TLS).
This was due to creating client context for ``ESMTPSender`` when None was expected.

Fixes buildbot#5609
p12tic pushed a commit to vibbo/buildbot that referenced this issue Sep 5, 2023
``MailNotifier`` didn't work when it was configured to use plan TCP but SSL packages were installed (to support workers over TLS).
This was due to creating client context for ``ESMTPSender`` when None was expected.

Fixes buildbot#5609
pmisik pushed a commit to pmisik/buildbot that referenced this issue Sep 6, 2023
``MailNotifier`` didn't work when it was configured to use plan TCP but SSL packages were installed (to support workers over TLS).
This was due to creating client context for ``ESMTPSender`` when None was expected.

Fixes buildbot#5609
slydiman pushed a commit to gkistanova/buildbot that referenced this issue Sep 30, 2023
``MailNotifier`` didn't work when it was configured to use plan TCP but SSL packages were installed (to support workers over TLS).
This was due to creating client context for ``ESMTPSender`` when None was expected.

Fixes buildbot#5609
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants