Git/Gerrit Email Notification - Not working suddenly

2,008 views
Skip to first unread message

Mohan .S

unread,
Feb 16, 2017, 6:29:45 AM2/16/17
to Repo and Gerrit Discussion

Dear Team,


In our Git/Gerrit Server, We configured the following SMTP configuration.

 

[sendemail]

     smtpServer = smtp.server.com

     smtpServerPort = 25

     smtpUser = mohan.s

     smtpPass = mypassword

 

Environment Details:

 

OS: Ubuntu 12.04.5 LTS (64-Bit)

Git Version: 1.7.9.5

Gerrit Version: 2.10.2

 

With the above configuration it was working fine earlier, Suddenly email notification when we submit a review request through gerrit it stopped working. Therefore could you please help me to get emails from our Git/Gerrit application server.

 

From this logs, I do not find any errors.

 

·        /var/log/mail.log

·        /var/log/gerrit_error.log

 

Local firewall disabled & firewall enabled for SMTP Server and Port.

 

I have mail utility from this location /usr/bin/mail and I am above receive email with this command ( df –kh | mail –s “Test Mail” moh...@domain.com )

 

 

Thanks,

Mohan

Mohan .S

unread,
Feb 19, 2017, 11:23:25 PM2/19/17
to Repo and Gerrit Discussion

Dear Team,

 

I have updated my gerrit.config file with the following,

 

[sendemail] enable = true

smtpServer = smtp.server.com

smtpServerPort = 25

smtpEncryption = ssl

smtpUser = mohan.s

smtpPass = mypassword

sslVerify = false

 

After gerrit service restart, I have tried to add send my files for review, when I add the reviewer in web portal, the following error I can in

 

/home/mohan.s08/gerrit/logs/error_log

 

[2017-02-20 09:14:52,801] ERROR com.google.gerrit.server.git.ReceiveCommits : Cannot send email for new change 324

com.google.gerrit.common.errors.EmailException: Mail Error: Connection reset

               at com.google.gerrit.server.mail.SmtpEmailSender.open(SmtpEmailSender.java:285)

               at com.google.gerrit.server.mail.SmtpEmailSender.send(SmtpEmailSender.java:173)

               at com.google.gerrit.server.mail.OutgoingEmail.send(OutgoingEmail.java:124)

               at com.google.gerrit.server.git.ReceiveCommits$CreateRequest$2.run(ReceiveCommits.java:1666)

               at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)

               at com.google.gerrit.server.util.RequestScopePropagator$5.call(RequestScopePropagator.java:222)

               at com.google.gerrit.server.util.RequestScopePropagator$4.call(RequestScopePropagator.java:201)

               at com.google.gerrit.server.util.ThreadLocalRequestScopePropagator$1.call(ThreadLocalRequestScopePropagator.java:55)

               at com.google.gerrit.server.util.RequestScopePropagator$1.call(RequestScopePropagator.java:98)

               at com.google.gerrit.server.util.RequestScopePropagator$3.run(RequestScopePropagator.java:163)

               at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)

               at java.util.concurrent.FutureTask.run(FutureTask.java:262)

               at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)

               at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)

               at com.google.gerrit.server.git.WorkQueue$Task.run(WorkQueue.java:368)

               at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)

               at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)

               at java.lang.Thread.run(Thread.java:745)

Caused by: java.net.SocketException: Connection reset

               at java.net.SocketInputStream.read(SocketInputStream.java:196)

               at java.net.SocketInputStream.read(SocketInputStream.java:122)

               at sun.security.ssl.InputRecord.readFully(InputRecord.java:442)

               at sun.security.ssl.InputRecord.read(InputRecord.java:480)

               at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:934)

               at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1332)

               at sun.security.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:889)

               at sun.security.ssl.AppInputStream.read(AppInputStream.java:102)

               at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:283)

               at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:325)

               at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:177)

               at java.io.InputStreamReader.read(InputStreamReader.java:184)

               at java.io.BufferedReader.fill(BufferedReader.java:154)

               at java.io.BufferedReader.readLine(BufferedReader.java:317)

               at java.io.BufferedReader.readLine(BufferedReader.java:382)

               at org.apache.commons.net.smtp.SMTP.__getReply(SMTP.java:179)

               at org.apache.commons.net.smtp.SMTP._connectAction_(SMTP.java:248)

               at org.apache.commons.net.SocketClient.connect(SocketClient.java:164)

               at org.apache.commons.net.SocketClient.connect(SocketClient.java:184)

               at com.google.gerrit.server.mail.SmtpEmailSender.open(SmtpEmailSender.java:254)

               ... 17 more

 

Tried the following,

·        Firewall admin confirmed that firewall has been open between our git/gerrit server to smtp server.

·        Able to do telnet

 

But unable to receive any through gerrit, so kindly help me on this.

 

Thanks,

Mohan

Luca Milanesio

unread,
Feb 20, 2017, 2:41:34 AM2/20/17
to Mohan .S, Repo and Gerrit Discussion
Hi Mohan,
you should check on your mail server log on why it has reset the connection.

P.S. As best practice, you would delegate the mail transport to a local postfix / sendmail rather than giving the burden to Gerrit to manage the communication with your SMTP server.

HTH

Luca.

--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Magnus Bäck

unread,
Feb 20, 2017, 2:49:50 AM2/20/17
to Mohan .S, Repo and Gerrit Discussion
On Monday, February 20, 2017 at 05:23 CET,
"Mohan .S" <moha...@gmail.com> wrote:

> I have updated my gerrit.config file with the following,
>
> [sendemail] enable = true
> smtpServer = smtp.server.com
> smtpServerPort = 25
> smtpEncryption = ssl
> smtpUser = mohan.s
> smtpPass = mypassword
> sslVerify = false

You've configured Gerrit to use SMTPS, i.e. SSL-wrapped SMTP.
Such traffic typically uses port 465. You probably meant to
use TLS, which starts in plain text on port 25 or 587 and
upgrades to TLS during the SMTP handshake.

Note that Gerrit defaults to port 465 if you set smtpEncryption
to "ssl".

[...]

--
Magnus Bäck | Software Engineer, Firmware Platform Tools
magnu...@axis.com | Axis Communications

Mohan .S

unread,
Feb 20, 2017, 4:19:34 AM2/20/17
to Repo and Gerrit Discussion, moha...@gmail.com

Dear Luca.

 

Ok thanks for the response, I have requested admin team to check the log in SMTP Server.

 

Dear Magnus,

 

Thank you for your support.

 

Now I have tried with below SMTP settings in my gerrit.config file.

 

Method:1

 

 enable = true

 smtpServer = smtp.server.com

 smtpServerPort = 25

 smtpUser = mohan.s

 smtpPass = mypassword

 smtpEncryption = TLS

 sslVerify = false

 

Error Msg from à /home/mohan.s08/gerrit/logs/error_log file.

 

[2017-02-20 14:22:24,081] ERROR com.google.gerrit.server.change.PostReviewers : Cannot send email to new reviewers of change 326 com.google.gerrit.common.errors.EmailException: Mail Error: SMTP server does not support TLS

 

Method:2

 

enable = true

 smtpServer = smtp.server.com

 smtpServerPort = 25

 smtpUser = mohan.s

 smtpPass = mypassword

 smtpEncryption = ssl

 sslVerify = false

 

Error Msg from à /home/mohan.s08/gerrit/logs/error_log file.

 

[2017-02-20 14:33:44,351] ERROR com.google.gerrit.server.change.EmailReviewComments : Cannot email comments for 326,1 com.google.gerrit.common.errors.EmailException: Mail Error: Connection reset

 

Method:3

 

enable = true

smtpServer = smtp.server.com

smtpServerPort = 25

smtpEncryption = ssl

smtpUser = mohan.s

smtpPass = mypassword

smtpEncryption = NONE

sslVerify = false

 

Error Msg from à /home/mohan.s08/gerrit/logs/error_log file.

 

[2017-02-20 14:39:18,421] ERROR com.google.gerrit.server.change.PostReviewers : Cannot send email to new reviewers of change 325 com.google.gerrit.common.errors.EmailException: Mail Error: Connection reset

 

With the below settings it was working fine earlier. Suddenly stopped working.

 

smtpServer = smtp.server.com

smtpServerPort = 25

smtpUser = mohan.s

smtpPass = mypassword

 

Note: For each change in gerrit.config file, I have restarted my gerrit service.

 

Thanks,

Mohan

Mohan .S

unread,
Feb 20, 2017, 10:53:14 PM2/20/17
to Repo and Gerrit Discussion

Dear Team,


I am using SSMTP, with this I am able to get mails.

 

My ssmtp.config file configuration as follows.

 

root=moh...@domain.com

mailhub=smtp.server.com:25

rewriteDomain=domain.com

hostname=git-gerrit

AuthUser=mohan.s

AuthPass=mypassword

FromLineOverride=YES

 

I have mail utility from this location /usr/bin/mail and I am above receive email with this command ( df –kh | mail –s “Test Mail” moh...@domain.com )


Problem only with my gerrit email notification, So kindly help me to resolve the same.


Thanks in advance.

 

Rgds,

Mohan



On Thursday, February 16, 2017 at 4:59:45 PM UTC+5:30, Mohan .S wrote:

Mohan .S

unread,
Feb 21, 2017, 5:43:49 AM2/21/17
to Repo and Gerrit Discussion

Team,

 

Thanks for the support.

 

Finally I have resolved the issue, added below line in gerrit.config file. Now email notification working perfectly.

[sendemail]

from = USER

 

Rgds,

Mohan


On Thursday, February 16, 2017 at 4:59:45 PM UTC+5:30, Mohan .S wrote:

Reply all
Reply to author
Forward
0 new messages