3971: SSL: CERTIFICATE_VERIFY_FAILED error when adding GitHub repository
- ThirdParty
- Review Board
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?
- Install ReviewBoard (64-bit) on Ubuntu 14.04.3 LTS using the Bitnami installer: https://bitnami.com/stack/reviewboard/installer#linux
- Open a web browser and add a new repository as follows:
- Set the Hosting service to "GitHub". I don't know if it matters but I also set Repository plan to "Private Organization"
- Fill in the other fields as required.
- Click Save.
- 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())
This is related to a discussion on Google Groups: https://groups.google.com/forum/#!topic/reviewboard/a9XOrkW3RpE
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.
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
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
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?
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
@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'.