Please Help! OpenEdx Ecommerce AuthStateMissing Problem

441 views
Skip to first unread message

JP Mateo

unread,
Jun 21, 2018, 12:38:34 AM6/21/18
to General Open edX discussion


Hi Guys,

I followed this guides in configuring E-commerce Site


 but after the configuration, I'm having this problem.



This is what my ecommerce logs is printing:

Jun 21 04:32:10 hcx-open-edx-native [service_variant=ecommerce][django.request] ERROR [hcx-open-edx-native 20784] [/edx/app/ecommerce/venvs/ecommerce/local/lib/python2.7/site-packages/django/core/handlers/exception.py:135] - Internal Server Error: /complete/edx-oidc/Traceback (most recent call last):File "/edx/app/ecommerce/venvs/ecommerce/local/lib/python2.7/site-packages/django/core/handlers/exception.py", line 41, in innerresponse = get_response(request)File "/edx/app/ecommerce/venvs/ecommerce/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 249, in _legacy_get_responseresponse = self._get_response(request)File "/edx/app/ecommerce/venvs/ecommerce/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 187, in _get_responseresponse = self.process_exception_by_middleware(e, request)File "/edx/app/ecommerce/venvs/ecommerce/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 185, in _get_responseresponse = wrapped_callback(request, *callback_args, **callback_kwargs)File "/edx/app/ecommerce/venvs/ecommerce/local/lib/python2.7/site-packages/django/utils/decorators.py", line 185, in innerreturn func(*args, **kwargs)File "/edx/app/ecommerce/venvs/ecommerce/local/lib/python2.7/site-packages/django/views/decorators/cache.py", line 57, in _wrapped_view_funcresponse = view_func(request, *args, **kwargs)File "/edx/app/ecommerce/venvs/ecommerce/local/lib/python2.7/site-packages/django/views/decorators/csrf.py", line 58, in wrapped_viewreturn view_func(*args, **kwargs)File "/edx/app/ecommerce/venvs/ecommerce/local/lib/python2.7/site-packages/social_django/utils.py", line 50, in wrapperreturn func(request, backend, *args, **kwargs)File "/edx/app/ecommerce/venvs/ecommerce/local/lib/python2.7/site-packages/social_django/views.py", line 32, in completeredirect_name=REDIRECT_FIELD_NAME, *args, **kwargs)File "/edx/app/ecommerce/venvs/ecommerce/local/lib/python2.7/site-packages/social_core/actions.py", line 41, in do_completeuser = backend.complete(user=user, *args, **kwargs)File "/edx/app/ecommerce/venvs/ecommerce/local/lib/python2.7/site-packages/social_core/backends/base.py", line 40, in completereturn self.auth_complete(*args, **kwargs)File "/edx/app/ecommerce/venvs/ecommerce/local/lib/python2.7/site-packages/auth_backends/backends.py", line 164, in auth_completeuser = super(EdXOpenIdConnect, self).auth_complete(*args, **kwargs)File "/edx/app/ecommerce/venvs/ecommerce/local/lib/python2.7/site-packages/social_core/utils.py", line 252, in wrapperreturn func(*args, **kwargs)File "/edx/app/ecommerce/venvs/ecommerce/local/lib/python2.7/site-packages/social_core/backends/oauth.py", line 388, in auth_completestate = self.validate_state()File "/edx/app/ecommerce/venvs/ecommerce/local/lib/python2.7/site-packages/social_core/backends/oauth.py", line 90, in validate_stateraise AuthStateMissing(self, 'state')AuthStateMissing: Session value state missing.

Hope you can help me.

Thanks!!!
JP

JP Mateo

unread,
Jun 21, 2018, 8:32:05 AM6/21/18
to General Open edX discussion
Help Please

Clinton Blackburn

unread,
Jun 21, 2018, 7:01:02 PM6/21/18
to General Open edX discussion
It's been a while since I've seen that error. I vaguely remember session issues arising due to cookie domains.

Make sure you are using different domains for LMS and E-Commerce. For example, use localhost for LMS and 127.0.0.1 for E-Commerce. The port number is not used when determining the cookie domain.

Clinton

Pierre Mailhot

unread,
Jun 26, 2018, 1:10:18 PM6/26/18
to General Open edX discussion
It happened recently to me under Chrome on an ecommerce system that has been working for months.
I changed browser and used Firefox. No problem.

So I guess I agree with Clinton's assessment that it could be cookies or cache related.

Wind Lee

unread,
Nov 29, 2018, 10:59:20 AM11/29/18
to General Open edX discussion
I am getting the same exception of "server error", actually if you add "DEBUG=True" in the code "/edx/app/ecommerce/ecommerce/ecommerce/settings/production.py", you will see the substituting web page as follows:

AuthStateMissing at /complete/edx-oidc/
Session value state missing.
Request Method: GET
Django Version: 1.11.15
Exception Type: AuthStateMissing
Exception Value:
Session value state missing.
Exception Location: /edx/app/ecommerce/venvs/ecommerce/local/lib/python2.7/site-packages/social_core/backends/oauth.py in validate_state, line 90
Python Executable: /edx/app/ecommerce/venvs/ecommerce/bin/python2.7
Python Version: 2.7.12

According to Pierre's suggestion, I install firefox browser, but the same exception occur, I hope some one to give more suggestion to solve this problem.
Here is anther forum to discuss the same problem, I don't know if it is helpful for us. I setup ecommerce on hawthorn version.
error.PNG

More

unread,
Mar 11, 2019, 10:42:11 AM3/11/19
to General Open edX discussion
Hi all,

I've also got the same error, do you have any suggestion to fix this issue?

Thank you

Mahyar Damavand

unread,
May 14, 2019, 7:36:52 AM5/14/19
to General Open edX discussion
Hi,
I have exactly this issue and I'm working with an open-release/hawthorn.master instance.
I changed my browser but the problem persists. and as Clinton advised I use different urls to access to ecommerce/lms systems.
Any solution do you found to manage this?

--
You received this message because you are subscribed to the Google Groups "General Open edX discussion" group.
To view this discussion on the web visit https://groups.google.com/d/msgid/edx-code/80380349-5a9f-4303-8098-5d4cc76085bc%40googlegroups.com.


--
"""""""""""""""""""""""
مهیار دماوند
Mahyar Damavand

"""""""""""""""""""""""

Mahyar Damavand

unread,
May 19, 2019, 3:51:53 AM5/19/19
to General Open edX discussion
Finally I solved the problem by adding this line:
SESSION_COOKIE_SECURE: false
to ecommerce.yml.
This is a security configuration. According to the django docs:
If this is set to True, the cookie will be marked as “secure”, which means browsers may ensure that the cookie is only sent under an HTTPS connection
and as my instance is not work under HTTPS I faced this problem.
Hope this helps.
 

Clinton Blackburn

unread,
May 19, 2019, 4:38:43 AM5/19/19
to edx-...@googlegroups.com
Please ensure your site is using SSL/TLS in production, and SESSION_COOKIE_SECURE is set to True. Decreasing security for development is fine, but using OAuth 2.0 without SSL/TLS in production is a potential security vulnerability.

Clinton


You received this message because you are subscribed to a topic in the Google Groups "General Open edX discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/edx-code/fTg-r7rNBrY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to edx-code+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/edx-code/CABCzmJ%2Bm3JYxf2O%2BRftPX8F3rLHYkrAGNiHkB%2BhVszHWb5%2BspQ%40mail.gmail.com.

Mahyar Damavand

unread,
May 19, 2019, 5:04:45 AM5/19/19
to General Open edX discussion
Of course I will re-enable this important feature before final launch.
Thanks Clinton

To unsubscribe from this group and stop receiving emails from it, send an email to edx-code+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/edx-code/CAB%3DVk83ieACtFVZyd2dgGVcmZX_YKHnbXASmfYzEws4G%2Bi%3D%3D_g%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages