Search code examples
ruby-on-railsrubygitlab

How can I debug e-mail sending on Gitlab?


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?


Solution

  • First, I will tell what was my problem: The sidekiq is responsible for handling sending e-mails. For some reason my sidekiq was stuck, restarting it solved the problem.

    Where I found information about problems I found on Gitlab:

    1. The logs dir. It has a few informations.
    2. On admin page, the section "Background jobs" gives information about the sidekiq.
    3. The javascript console (if your browser supports it) also has useful information. Only if your problem is related to javascript.
    4. And if you reach this point, you may modify Gitlab's code so you can "trace it" writing to a file:

      File.open('/tmp/logfile','a') { |file| file.write("Hello World!\n") }