Version Check in 2.0

Hi,

my testing version of 2.0 is behind a proxy.
When I go to the admin site I get an error from the version-check that the Network is unreachable.
I set my proxy settings as environment variables as:
http_proxy=xxx:3128
https_proxy=xxx:3128
ftp_proxy=xxx:3128
proxy=xxx:3128
Where do I have to set them so this error doesn’t appear anymore?

Best Regards,
Alex

requests.get('https://pypi.python.org/pypi/indico/json') is the code we are using for the version check.

Setting HTTP_PROXY and HTTPS_PROXY should do the job: http://docs.python-requests.org/en/master/user/advanced/#proxies

Hello sorry for my late reply I was on vacation.

so I logged in as the indico user and manually opened a python shell and tested the code and it worked.

>>> import requests
>>> requests.get('https://pypi.python.org/pypi/indico/json')
<Response [200]>

It’s just that every time i go to the admin page I get an error in the mail like this:

2018-01-04 11:28:24,321  4324a07257f8456a  indico.flask - ERROR errors.py:107 -- HTTPSConnectionPool(host='pypi.python.org', port=443): Max retries exceeded with url: /pypi/indico/json (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0xa566650>: Failed to establish a new connection: [Errno 101] Network is unreachable',))

Traceback (most recent call last):
  File "/opt/indico/.venv/lib/python2.7/site-packages/flask/app.py", line 1612, in full_dispatch_request
    rv = self.dispatch_request()
  File "/opt/indico/.venv/lib/python2.7/site-packages/flask/app.py", line 1598, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/web/flask/util.py", line 114, in wrapper
    return obj().process()
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/web/rh.py", line 270, in process
    res = self._do_process()
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/web/rh.py", line 249, in _do_process
    return self._process()
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/modules/core/controllers.py", line 205, in _process
    return jsonify(indico=self._check_version('indico', indico.__version__),
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/modules/core/controllers.py", line 182, in _check_version
    response = requests.get('https://pypi.python.org/pypi/{}/json'.format(distribution))
  File "/opt/indico/.venv/lib/python2.7/site-packages/requests/api.py", line 72, in get
    return request('get', url, params=params, **kwargs)
  File "/opt/indico/.venv/lib/python2.7/site-packages/requests/api.py", line 58, in request
    return session.request(method=method, url=url, **kwargs)
  File "/opt/indico/.venv/lib/python2.7/site-packages/requests/sessions.py", line 508, in request
    resp = self.send(prep, **send_kwargs)
  File "/opt/indico/.venv/lib/python2.7/site-packages/requests/sessions.py", line 618, in send
    r = adapter.send(request, **kwargs)
  File "/opt/indico/.venv/lib/python2.7/site-packages/requests/adapters.py", line 508, in send
    raise ConnectionError(e, request=request)
ConnectionError: HTTPSConnectionPool(host='pypi.python.org', port=443): Max retries exceeded with url: /pypi/indico/json (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0xa566650>: Failed to establish a new connection: [Errno 101] Network is unreachable',))

do you have any idea what I could do?

Try setting the proxy env vars in your uwsgi config as well, as described here: https://coderwall.com/p/93jakg/multiple-env-vars-with-uwsgi

It worked!
Thank you very much