Help - Fresh Gerrit Install - Can't register email addresses

4,332 views
Skip to first unread message

David Hileman

unread,
May 23, 2014, 10:21:45 AM5/23/14
to repo-d...@googlegroups.com
Hello,

I am trying to get a Gerrit server set up on my LAN (no internet).

I did a basic install of gerrit 2.8.5, using default settings (h2 database, jetty), with the exception of authentication.  I am using HTTP authentication along with Apache HTTP Server instead of OpenID since there is no internet access on my local network.

Everything works smoothly enough except for registering email addresses.  Users are able to login and update there name, and SSH keys, but when registering an email address, an error page is displayed >

"Code Review - Error , 500 Internal server error"

Any ideas what might cause this or how to fix it? Is there another way I can possibly register an email? I don't think users can properly authenticate and do pushes to Gerrit without an email address that matches their git config email.  BTW, I don't have an email server.  Surely that isn't required if you don't care about getting email notifications.

Thanks,
Dave

Matthias Sohn

unread,
May 23, 2014, 10:27:15 AM5/23/14
to David Hileman, Repo and Gerrit Discussion
did you check the error_log of the server for error messages ?

--
Matthias 

David Hileman

unread,
May 23, 2014, 10:33:52 AM5/23/14
to repo-d...@googlegroups.com, David Hileman
Yes, sorry I forgot to post that.  Might be useful:

ERROR com.google.gerrit.httpd.restapi.RestApiServlet : Error in PUT /accounts/self/emails/dhileman%40mail.com
com.google.gerrit.common.errors.EmailException: Mail Error: Connection refused: connect
ERROR com.google.gerrit.server.account.CreateEmail : Cannot send email verification message to dhil...@mail.com
com.google.gerrit.common.errors.EmailException: Mail Error: Connection refused: connect

Looks like it wants to send an email, but is failing.  I am assuming this is because I don't have a mail server configured.  Is there no way to register an email without having a mail server?

Edwin Kempin

unread,
May 23, 2014, 10:39:37 AM5/23/14
to David Hileman, Repo and Gerrit Discussion
2014-05-23 16:33 GMT+02:00 David Hileman <dhile...@gmail.com>:
Yes, sorry I forgot to post that.  Might be useful:

ERROR com.google.gerrit.httpd.restapi.RestApiServlet : Error in PUT /accounts/self/emails/dhileman%40mail.com
com.google.gerrit.common.errors.EmailException: Mail Error: Connection refused: connect
ERROR com.google.gerrit.server.account.CreateEmail : Cannot send email verification message to dhil...@mail.com
com.google.gerrit.common.errors.EmailException: Mail Error: Connection refused: connect

Looks like it wants to send an email, but is failing.  I am assuming this is because I don't have a mail server configured.  Is there no way to register an email without having a mail server?

On Friday, May 23, 2014 10:27:15 AM UTC-4, Matthias Sohn wrote:
On Fri, May 23, 2014 at 4:21 PM, David Hileman <dhile...@gmail.com> wrote:
Hello,

I am trying to get a Gerrit server set up on my LAN (no internet).

I did a basic install of gerrit 2.8.5, using default settings (h2 database, jetty), with the exception of authentication.  I am using HTTP authentication along with Apache HTTP Server instead of OpenID since there is no internet access on my local network.

Everything works smoothly enough except for registering email addresses.  Users are able to login and update there name, and SSH keys, but when registering an email address, an error page is displayed >

"Code Review - Error , 500 Internal server error"

Any ideas what might cause this or how to fix it? Is there another way I can possibly register an email? I don't think users can properly authenticate and do pushes to Gerrit without an email address that matches their git config email.  BTW, I don't have an email server.  Surely that isn't required if you don't care about getting email notifications.

did you check the error_log of the server for error messages ?

--
Matthias 

--
--
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.

David Hileman

unread,
May 23, 2014, 11:19:57 AM5/23/14
to repo-d...@googlegroups.com, David Hileman
Thank you.  However, it looks like with that approach, an admin will have to register the email addresses for every user.  I was hoping for a way to allow each user to register their own email address.

I found this in the documentation you provided "Only Gerrit administrators are allowed to add email addresses without confirmation."

That is very unfortunate.  I guess it is impossible to allow users to register their own email address when running Gerrit on a closed network, with no email capability :-(

Edwin Kempin

unread,
May 26, 2014, 5:11:03 AM5/26/14
to David Hileman, Repo and Gerrit Discussion
2014-05-23 17:19 GMT+02:00 David Hileman <dhile...@gmail.com>:
Thank you.  However, it looks like with that approach, an admin will have to register the email addresses for every user.  I was hoping for a way to allow each user to register their own email address.

I found this in the documentation you provided "Only Gerrit administrators are allowed to add email addresses without confirmation."

That is very unfortunate.  I guess it is impossible to allow users to register their own email address when running Gerrit on a closed network, with no email capability :-(
I'm really not sure if it is a good idea to allow users to register arbitrary e-mail addresses without confirmation.
The e-mail address is used as identity of the user and without confirmation one can register e-mail addresses of other persons
for the own account and then this identity cannot be trusted anymore.
If you really want to do this, this is not impossible. You may simply write a Gerrit plugin that allows users to register
any e-mail address without confirmation. This could be done by adding a new REST endpoint in the plugin that is a wrapper
for Gerrit's create email REST endpoint, but which doesn't do the persmission check. Something similar was already done in
the serviceuser plugin [1] and you could just have a look at the code there.

[1] https://gerrit-review.googlesource.com/#/admin/projects/plugins/serviceuser

Thomas Swindells (tswindel)

unread,
May 26, 2014, 3:09:03 PM5/26/14
to Edwin Kempin, David Hileman, Repo and Gerrit Discussion

Whilst not essential having email notifications coming out of Gerrit letting people know when they have reviews pending etc is very useful, so if you can I’d suggest seeing if you can provide it.

Either way you have various options (as I see it):

1.       Use an existing (if any) email server if you’ve got some other email service already running within the closed network

2.       Poke a (one way) hole if possible out of your closed network to allow emails to be sent out

3.       Run a proper email server and give users account on it to notify them when they have reviews pending etc

4.       Have a dummy email server which detects registrations emails and that either invokes the confirmation step directly on the users behalf, or provides

5.       Have a script that runs regularly polling the DB, if it detects any accounts pending email authorization it updates the db to mark them as activated.

6.       Write a plugin to make it no longer needed.

 

Hope one of those suggestions helps,

 

thoms

Reply all
Reply to author
Forward
0 new messages