Gmail "SMTP server rejected auth: 220 smtp.gmail.com ESMTP k77sm27266486pfj.65 - gsmtp"

12,117 views
Skip to first unread message

DavidL

unread,
Sep 26, 2016, 2:39:03 AM9/26/16
to Repo and Gerrit Discussion
when I register email address in the settings page, it always show 500 internal error, anyone could help me? it's urgent.

Here is my gerrit.conf

[gerrit]

        basePath = git

        serverId = e44c241b-5ed9-4c19-8e07-bf6792aa3639

        canonicalWebUrl = [gerrit.*]

[database]

        type = h2

        database = /home/ubuntu/Gerrit/gerrit_example/db/ReviewDB

[auth]

        type = HTTP

[receive]

        enableSignedPush = false

[sendemail]

        smtpServer = smtp.gmail.com

        smtpServerPort = 465

        smtpEncryption = SSL

        smtpUser = [username **]@gmail.com

[container]

        user = ubuntu

        javaHome = /usr/lib/jvm/java-8-openjdk-amd64/jre

[sshd]

        listenAddress = *:29418

[httpd]

        listenUrl = proxy-http://*:8080/

[cache]

        directory = cache


when I register email address in the settings page, it shows 500 internal error. I check the logs,


[2016-09-26 05:45:13,759] [HTTP-75] ERROR com.google.gerrit.httpd.restapi.RestApiServlet : Error in PUT /accounts/self/emails/a...@g.com

com.google.gerrit.common.errors.EmailException: Mail Error: SMTP server rejected auth: 220 smtp.gmail.com ESMTP k77sm27266486pfj.65 - gsmtp

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

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

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

at com.google.gerrit.server.account.CreateEmail.apply(CreateEmail.java:136)

at com.google.gerrit.server.account.CreateEmail.apply(CreateEmail.java:103)

at com.google.gerrit.server.account.CreateEmail.apply(CreateEmail.java:44)

at com.google.gerrit.httpd.restapi.RestApiServlet.service(RestApiServlet.java:341)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)

at com.google.inject.servlet.ServletDefinition.doServiceImpl(ServletDefinition.java:286)

at com.google.inject.servlet.ServletDefinition.doService(ServletDefinition.java:276)

at com.google.inject.servlet.ServletDefinition.service(ServletDefinition.java:181)

at com.google.inject.servlet.ManagedServletPipeline.service(ManagedServletPipeline.java:91)

at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:85)

at com.google.gerrit.httpd.GetUserFilter.doFilter(GetUserFilter.java:82)

at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)

at com.google.gwtexpui.server.CacheControlFilter.doFilter(CacheControlFilter.java:73)

at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)

at com.google.gerrit.httpd.RunAsFilter.doFilter(RunAsFilter.java:122)

at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)

at com.google.gerrit.httpd.RequestMetricsFilter.doFilter(RequestMetricsFilter.java:60)

at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)

at com.google.gerrit.httpd.AllRequestFilter$FilterProxy$1.doFilter(AllRequestFilter.java:136)

at com.google.gerrit.httpd.AllRequestFilter$FilterProxy.doFilter(AllRequestFilter.java:105)

at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)

at com.google.gerrit.httpd.RequestContextFilter.doFilter(RequestContextFilter.java:75)

at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)

at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:120)

at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:135)

at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)

at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)

at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:221)

at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)

at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)

at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)

at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)

at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)

at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)

at org.eclipse.jetty.server.Server.handle(Server.java:499)

at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)

at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)

at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544)

at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)

at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)

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

Luca Milanesio

unread,
Sep 26, 2016, 2:49:58 AM9/26/16
to DavidL, Repo and Gerrit Discussion
Doesn't seem to be a Gerrit error but rather GMail SMTP refusing your credentials.
"Mail Error: SMTP server rejected auth: 220 smtp.gmail.com ESMTP k77sm27266486pfj.65 - gsmtp"

Can you try with another SMTP?

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,
Sep 26, 2016, 3:38:24 AM9/26/16
to Luca Milanesio, DavidL, Repo and Gerrit Discussion
On Monday, September 26, 2016 at 08:49 CEST,
Luca Milanesio <luca.mi...@gmail.com> wrote:

> Doesn't seem to be a Gerrit error but rather GMail SMTP refusing your
> credentials.
>
> "Mail Error: SMTP server rejected auth: 220 smtp.gmail.com ESMTP k77sm27266486pfj.65 - gsmtp"

This is weird since a 2xx response indicates success and 220
in particular is the greeting given by the server when a client
connects, not when authentication credentials (correct or otherwise)
are given. I'd look into if there's an intermediate firewall that's
interfering with the SMTP session. At least in the past Cisco PIX
boxes have been known to do this.

> Can you try with another SMTP?

I'd suggest the OP to not use Gerrit to send to Gmail but to
use a local relay that in turn may use Gmail.

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

Luca Milanesio

unread,
Sep 26, 2016, 3:42:06 AM9/26/16
to Magnus Bäck, DavidL, Repo and Gerrit Discussion
Oh yes, Magnus is right :-) I have been tricked by the "SMTP server rejected auth" which isn't coming from GMail SMTP but rather from Gerrit.

There is then definitely a bug in Gerrit (or the SMTP client stack) because 220 is definitely a warm welcome:

"220 - <Server Name> service is running (also called SMTP Error 2.2.0)
SMTP Status 220 : This is normally the first message you
will get back from the server. It means the mail service is
running (ie. your mail server is running). It will normally
contain a welcome message and/or the title of the SMTP
software and, sometimes, the version number of the mail
server software. SMTP Reply 220 is effectively a "Hi
There, I have just this second finished starting up - I
am ready to go and at your command" informational
message."

Luca.

Zoltan Kuscsik

unread,
Mar 9, 2017, 4:38:36 AM3/9/17
to Repo and Gerrit Discussion, magnu...@axis.com, llty.tru...@gmail.com
The following fix worked for me:

Login on your PC under your gerrit mail account and open:

https://www.google.com/settings/security/lesssecureapps

Set "Access for less secure apps" to On.
Reply all
Reply to author
Forward
0 new messages