Ecommerce configuration


I am on a clean install from pipy with
tutor 10.0.10

Unfortunately I cannot access the ecommerce /dashboard, /courses or /admin endpoints. I created a user with admin rights as indicated in the operations section of the plugin readme (

tutor local run ecommerce ./ createsuperuser

When I try to login (both via /login and /admin in the ecommerce url) I get a “Server Error” message and the following in the logs:

ecommerce_1         | 2020-07-13 07:06:20,187 ERROR 9 [ecommerce.core.models] /openedx/ecommerce/ecommerce/core/ - Could not find lms_user_id for user 3. Called from middleware with request path: /courses/, referrer: None
ecommerce_1         | NoneType: None
ecommerce_1         | 2020-07-13 07:06:20,198 ERROR 9 [django.request] /openedx/venv/lib/python3.6/site-packages/django/utils/ - Internal Server Error: /courses/
ecommerce_1         | Traceback (most recent call last):
ecommerce_1         |   File "/openedx/venv/lib/python3.6/site-packages/django/core/handlers/", line 34, in inner
ecommerce_1         |     response = get_response(request)
ecommerce_1         |   File "/openedx/venv/lib/python3.6/site-packages/django/core/handlers/", line 106, in _get_response
ecommerce_1         |     response = middleware_method(request, callback, callback_args, callback_kwargs)
ecommerce_1         |   File "/openedx/ecommerce/ecommerce/extensions/analytics/", line 44, in process_view
ecommerce_1         |     user.add_lms_user_id('ecommerce_missing_lms_user_id_middleware', called_from)
ecommerce_1         |   File "/openedx/ecommerce/ecommerce/core/", line 608, in add_lms_user_id
ecommerce_1         |     raise MissingLmsUserIdException(error_msg)
ecommerce_1         | ecommerce.core.exceptions.MissingLmsUserIdException: Could not find lms_user_id for user 3. Called from middleware with request path: /courses/, referrer: None

I found the following “decision” in the ecommerce repository:

In the past I did manage to login by creating the user with the “createsuperuser” script, then creating the same user via the register form in the LMS and then a combination of logging in the lms and the ecommerce interfaces, however I have not been able to replicate such procedure.

I really appreciate any help you can provide.

1 Like

Currently it is possible to use the alternative solution mentioned in the link below

the allow_missing_lms_user_id waffle switch is enabled.

tutor local run ecommerce ./ waffle_switch allow_missing_lms_user_id on --create

Thank you @ibrmo . I have been manually updating the ecommerce_user table so far. I am still debugging the ecommerce plugin as I faced more problems. I will report as I find solutions.

@juansele Does that mean that the createsuperuser command indicated in the tutor-ecommerce README is now invalid? If yes, what command should we use?

@regis I do not know whether there is a valid command or not.

The “new” ecommerce added a column called lms_user_id to the table ecommerce_user and it is supposed to fill it with the information it gets from the jwt the users get when they log in (in the lms using oauth2). Maybe it is something misconfigured with the authentication?

Aditionally I think there is a missing step in the ecommerce plugin documentation in order to switch from shoppingcart to e-commerce:

Unfortunatelly I can not confirm at this point it works. I can not get to the basket page, I get an 500 server error and a Worker timeout in the logs. I have tried to debug it and read a lot of the source code with no luck. I can create a new post if you want, I want to further look into this.

1 Like