Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internal Server Error, HTTPSConnectionPool Error #262

Closed
adoyle-h opened this issue Feb 24, 2018 · 8 comments
Closed

Internal Server Error, HTTPSConnectionPool Error #262

adoyle-h opened this issue Feb 24, 2018 · 8 comments
Labels

Comments

@adoyle-h
Copy link

grip -b
 * Using personal access token
 * Running on http://localhost:6419/ (Press CTRL+C to quit)
 * Error: could not retrieve styles: HTTPSConnectionPool(host='github.com', port=443): Max retries exceeded with url: /joeyespo/grip (Caused by SSLError(SSLError(1, u'[SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590)'),))
[2018-02-24 10:22:23,435] ERROR in app: Exception on / [GET]
Traceback (most recent call last):
  File "/usr/local/Cellar/grip/4.4.0/libexec/vendor/lib/python2.7/site-packages/flask/app.py", line 1982, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/Cellar/grip/4.4.0/libexec/vendor/lib/python2.7/site-packages/flask/app.py", line 1614, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/Cellar/grip/4.4.0/libexec/vendor/lib/python2.7/site-packages/flask/app.py", line 1517, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/Cellar/grip/4.4.0/libexec/vendor/lib/python2.7/site-packages/flask/app.py", line 1612, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/Cellar/grip/4.4.0/libexec/vendor/lib/python2.7/site-packages/flask/app.py", line 1598, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/usr/local/Cellar/grip/4.4.0/libexec/lib/python2.7/site-packages/grip/app.py", line 174, in _render_page
    content = self.renderer.render(text, self.auth)
  File "/usr/local/Cellar/grip/4.4.0/libexec/lib/python2.7/site-packages/grip/renderers.py", line 77, in render
    r = requests.post(url, headers=headers, data=data, auth=auth)
  File "/usr/local/Cellar/grip/4.4.0/libexec/vendor/lib/python2.7/site-packages/requests/api.py", line 112, in post
    return request('post', url, data=data, json=json, **kwargs)
  File "/usr/local/Cellar/grip/4.4.0/libexec/vendor/lib/python2.7/site-packages/requests/api.py", line 58, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/local/Cellar/grip/4.4.0/libexec/vendor/lib/python2.7/site-packages/requests/sessions.py", line 508, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/Cellar/grip/4.4.0/libexec/vendor/lib/python2.7/site-packages/requests/sessions.py", line 618, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/Cellar/grip/4.4.0/libexec/vendor/lib/python2.7/site-packages/requests/adapters.py", line 506, in send
    raise SSLError(e, request=request)
SSLError: HTTPSConnectionPool(host='api.github.com', port=443): Max retries exceeded with url: /markdown/raw (Caused by SSLError(SSLError(1, u'[SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590)'),))
127.0.0.1 - - [24/Feb/2018 10:22:23] "GET / HTTP/1.1" 500 -

The message in browser,

Internal Server Error
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.

I think the connection to Github has no problem.

image

version

grip -V
Grip 4.4.0
@shirohana
Copy link

I have the same problem, seems related to https://developer.github.com/changes/2018-02-01-weak-crypto-removal-notice/

@xavierchow
Copy link

So Github just turned off the TLS1.0 and only allows TLS1.2, I fixed the issue with the openssl upgrade and python reinstallation.

brew update
brew install openssl

Then openssl version should be 1.0.x

brew update
brew install pyenv
echo 'eval "$(pyenv init -)"' >> .zshrc
source .zshrc
pyenv install 3.5.2
pyenv global 3.5.2

python --version 
python -c 'import ssl; print ssl.OPENSSL_VERSION'

After that, you can see python is using openssl 1.0.x, and if you reinstall grip everything should be good.

@peterfication
Copy link

peterfication commented Mar 2, 2018

Thanks a lot for this hint!

Important to add: This won't work with the Homebrew version because the Homebrew version uses an old Python (at least for me). So maybe, the Homebrew version needs an update?

@cunninghamzac
Copy link

I couldn't get this to work with Homebrew either. I ended up uninstalling grip in Homebrew and re-installing it with pip after I did the other steps

brew update
brew install openssl

brew update
brew install pyenv
echo 'eval "$(pyenv init -)"' >> .bash_profile
source .bash_profile
pyenv install 3.5.2
pyenv global 3.5.2

@frozenpandaman
Copy link

Thanks @cunninghamzac! Uninstalling it via Homebrew and using pip install grip worked for me, too.

@peterfication, Homebrew now uses 3.x as the default python.

@joeyespo
Copy link
Owner

Yes, this is due to GitHub shutting off weak TLS.

Thanks for chiming in, @shirohana, @xavierchow, @cunninghamzac ❤️

@joeyespo
Copy link
Owner

Actually, while I'm releasing new versions, I added an except block in v1.5.2 pointing people here if they happen to hit this error (f015871). Can anyone still experiencing this confirm it worked / add anything missing? Thanks again!

@Godron629
Copy link
Contributor

Godron629 commented Mar 21, 2018

@joeyespo I got your error, there is a spelling mistake in the error message though. I made a pull request #266

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants