Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I debug e-mail sending on Gitlab?

Tags:

My Gitlab (version 5) is not sending any e-mails and I am lost trying to figure out what is happening. The logs give no useful information. I configured it to used sendmail.

I wrote a small script that sends e-mail through ActionMailer (I guess it is what gitlab uses to send e-mail, right?). And it sends the e-mail correctly.

But, on my Gitlab, I can guarantee that sendmail is not even being called.

Do I need to enable something to get e-mail notifications? How can I debug my issue?

Update

The problem is that I can not find any information anywhere. The thing just fails silently. Where can I find some kind of log? The logs in the log dir provide no useful information.

My question is, how can I make Gitlab be more verbose? How can I make it tell me what is going on?

Update 2

I just found a lot of mails scheduled on the Background jobs section. A lot of unprocessed Sidekiq::Extensions::DelayedMailer. What does it mean? Why were these jobs not processed?

like image 773
André Puel Avatar asked Apr 20 '13 21:04

André Puel


People also ask

How do I find my GitLab email?

Instruct the user to sign in and trigger a new confirmation email through their profile by visiting https://gitlab.com/-/profile/emails.

How do I send an email notification from GitLab?

Under user settings of GitLab, the group email needs to be added. Once the mail is added and verified, the notification channel can be set up under Notifications. Once this is done, all notifications for that group (or project) will go to the group mail, and everyone in the team will get them.


1 Answers

Stumbled upon this issue today, here's my research:

Debugging SMTP connections in the GitLab GUI is not supported yet. However there is a pending feature request and a command line solution.

Set the desired SMTP settings /etc/gitlab/gitlab.rb and run gitlab-ctl reconfigure (see https://docs.gitlab.com/omnibus/settings/smtp.html).

Start the console running gitlab-rails console -e production.

Show the configured delivery method (should be :smtp) running the command ActionMailer::Base.delivery_method. Show all configured SMTP settings running ActionMailer::Base.smtp_settings.

To send a test mail run

Notify.test_email('[email protected]', 'Hello World', 'This is a test message').deliver_now

On the admin page in GitLab, the section »Background jobs« shows information about all jobs. Failing SMTP connections are listed there as well.

Please note, you may need to restart the GitLab instance in order to use the newly configured SMTP settings (on my instance the console was able to send mails, the GUI required a restart). Run gitlab-ctl restart to restart your instance.

like image 159
pixelbrackets Avatar answered Sep 19 '22 13:09

pixelbrackets