3971: SSL: CERTIFICATE_VERIFY_FAILED error when adding GitHub repository

freastro

What version are you running?

2.0.19

What's the URL of the page containing the problem?

/admin/db/scmtools/repository/1/

What steps will reproduce the problem?

  1. Install ReviewBoard (64-bit) on Ubuntu 14.04.3 LTS using the Bitnami installer: https://bitnami.com/stack/reviewboard/installer#linux
  2. Open a web browser and add a new repository as follows:
  3. Set the Hosting service to "GitHub". I don't know if it matters but I also set Repository plan to "Private Organization"
  4. Fill in the other fields as required.
  5. Click Save.
  6. Notice an error message saying: Unknown error when linking the account: 'URLError' object has no attribute 'read'

What is the expected output? What do you see instead?

I expected that the repository would be added. Instead I saw an error message: Unknown error when linking the account: 'URLError' object has no attribute 'read'.

What operating system are you using? What browser?

Server is Ubuntu 14.04.3 LTS. Client is Mac OS X Yosemite running Google Chrome.

Please provide any additional information below.

I traced the error to https://github.com/reviewboard/reviewboard/blob/release-2.0.19/reviewboard/hostingsvcs/github.py#L400 and found the original error was:
<urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)>

I wasn't sure where to place the cacerts truststore for SSL to pick up, so I ended up modifying https://github.com/reviewboard/reviewboard/blob/release-2.0.19/reviewboard/hostingsvcs/service.py#L79 to:
import ssl
u = urlopen(r, context=ssl._create_unverified_context())

#1 freastro

This is related to a discussion on Google Groups: https://groups.google.com/forum/#!topic/reviewboard/a9XOrkW3RpE

chipx86
#2 chipx86

It shouldn't be necessary to install any certificates.

This is the first I've seen this, and I suspect it's an environment issue with Bitnami. You'll want to talk to their support, see if they can shed some light on this.

#3 freastro

I agree that Bitnami should already include the latest certificates in their installer.

My ticket description doesn't make it clear but there is a bug at github.py:400. It tries to call read() on a URLError which thows an AttributeException and that's the error message I received in the web UI. This error message commonly comes up when Python isn't properly configured to use a proxy server. It didn't seem like people in the forums could easily tell the difference between the two situations.

I think there could be 2 improvements:
1) Log the original error
2) Either allow the URLError to continue up the stack or display a different error message from the current one

chipx86
#4 chipx86

I agree, both those issues should definitely be addressed.

We have a group of students starting work on Review Board this week. I'll flag this as something for them to look at, aiming for 2.0.21.

  • +Release-2.0.x
    +Release-2.5.x
  • +EasyFix
#5 calvinshin
  • +calvinshin
#6 bluefoxreg

We are using bitnami's VM image 2.5.1.1 and it has the same problem when creating a github repo.

The account login gives:

Unknown error when linking the account: 'URLError' object has no attribute 'read'

Any suggested temporary workaround?

#7 bluefoxreg

By doing this modification, it seems to be allowing the github to be added without error.
Posting from rbtools also seems to be working correctly.

https://www.mail-archive.com/reviewboard@googlegroups.com/msg16905.html

brennie
#8 brennie
  • -calvinshin
david
#9 david

This is a problem with Bitnami's installer, not Review Board.

  • -New
    +ThirdParty
#10 freastro

@david, The error message generated by ReviewBoard is very misleading. I found other people who had received the same error message and the causes ranged from missing SSL certificates to incorrect proxy information. I think it would be very helpful if the original error message was surfaced instead of: 'URLError' object has no attribute 'read'.