openedx-vlead / port-labs-to-openedx

3 stars 8 forks source link

OAuth2 authentication problem #17

Closed sivashankerN closed 8 years ago

sivashankerN commented 8 years ago

Output of tail -f /edx/var/log/lms/edx.log Jun 13 05:31:36 ip-172-31-17-98 [service_variant=insights][django.request][env:no_env] ERROR [ip-172-31-17-98 7526] [base.py:231] - Internal Server Error: /complete/edx-oidc/ Traceback (most recent call last): File "/edx/app/insights/venvs/insights/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 111, in get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/edx/app/insights/venvs/insights/local/lib/python2.7/site-packages/django/views/decorators/cache.py", line 52, in _wrapped_view_func response = view_func(request, *args, **kwargs) File "/edx/app/insights/venvs/insights/local/lib/python2.7/site-packages/django/views/decorators/csrf.py", line 57, in wrapped_view return view_func(*args, **kwargs) File "/edx/app/insights/venvs/insights/local/lib/python2.7/site-packages/social/apps/django_app/utils.py", line 51, in wrapper return func(request, backend, *args, **kwargs) File "/edx/app/insights/venvs/insights/local/lib/python2.7/site-packages/social/apps/django_app/views.py", line 28, in complete redirect_name=REDIRECT_FIELD_NAME, *args, **kwargs) File "/edx/app/insights/venvs/insights/local/lib/python2.7/site-packages/social/actions.py", line 43, in do_complete user = backend.complete(user=user, *args, **kwargs) File "/edx/app/insights/venvs/insights/local/lib/python2.7/site-packages/social/backends/base.py", line 41, in complete return self.auth_complete(*args, **kwargs) File "/edx/app/insights/venvs/insights/local/lib/python2.7/site-packages/auth_backends/backends.py", line 79, in auth_complete user = super(EdXOpenIdConnect, self).auth_complete(*args, **kwargs) File "/edx/app/insights/venvs/insights/local/lib/python2.7/site-packages/social/utils.py", line 229, in wrapper return func(*args, **kwargs) File "/edx/app/insights/venvs/insights/local/lib/python2.7/site-packages/social/backends/oauth.py", line 383, in auth_complete method=self.ACCESS_TOKEN_METHOD File "/edx/app/insights/venvs/insights/local/lib/python2.7/site-packages/social/backends/open_id.py", line 367, in request_access_token response = self.get_json(*args, **kwargs) File "/edx/app/insights/venvs/insights/local/lib/python2.7/site-packages/social/backends/base.py", line 232, in get_json return self.request(url, *args, **kwargs).json() File "/edx/app/insights/venvs/insights/local/lib/python2.7/site-packages/social/backends/base.py", line 227, in request raise AuthFailed(self, str(err)) AuthFailed: Authentication failed: HTTPSConnectionPool(host='lms.vlabs.ac.in', port=443): Max retries exceeded with url: /oauth2/access_token/ (Caused by NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f8e2f196cd0>: Failed to establish a new connection: [Errno -2] Name or service not known',))

sivashankerN commented 8 years ago

Solved the issue. Problem was both the machines LMS and Insights were not accessible from outside. That means they don't have public domain.

In our case, we missed public-dns entry. We added the entires in public-dns and problem is solved