Juniper.master - ecommerce.core.exceptions.MissingLmsUserIdException: Could not find lms_user_id

Hello,

i’m here about an error occured when i login to my Ecommerce Django Admin.
ecommerce2020-08-30 00_20_33-https___ecommerce.eduworld-cm.com_admin_ - Opera

Aug 29 16:30:42 lms [service_variant=ecommerce][django.request] ERROR [lms  26537] [/edx/app/ecommerce/venvs/ecommerce/lib/python3.5/site-packages/django/utils/log.py:228] - Internal Server Error: /jsi18n/
Traceback (most recent call last):
File "/edx/app/ecommerce/venvs/ecommerce/lib/python3.5/site-packages/django/core/handlers/exception.py", line 34, in inner
response = get_response(request)
File "/edx/app/ecommerce/venvs/ecommerce/lib/python3.5/site-packages/django/core/handlers/base.py", line 106, in _get_response
response = middleware_method(request, callback, callback_args, callback_kwargs)
File "/edx/app/ecommerce/ecommerce/ecommerce/extensions/analytics/middleware.py", line 44, in process_view
user.add_lms_user_id('ecommerce_missing_lms_user_id_middleware', called_from)
File "/edx/app/ecommerce/ecommerce/ecommerce/core/models.py", line 608, in add_lms_user_id
raise MissingLmsUserIdException(error_msg)
ecommerce.core.exceptions.MissingLmsUserIdException: Could not find lms_user_id for user 2. Called from middleware with request path: /jsi18n/, referrer: https://ecommerce.eduworld-cm.com/admin/

After a couple of search, i found that with juniper we have to generate lms_user_id or allow this option to be ignored, according to this: https://openedx.atlassian.net/wiki/spaces/COMM/pages/940048716/Juniper

I dont exactly know how to do it:

1- Enabling the allow_missing_lms_user_id waffle switch : don’t clearly know how to do it :sweat:

2- The LMS user id can be back-filled for existing users by running the ecommerce/core/management/commands/import_user_ids.py management command : even running this command, how do i do it?

And, what is the good option, 1- enabling the waffle switch or 2- back-filled for existing users ?

Regards,

I think you have only one option now to run the management command which back fills LMS user ids for existing users like this

sudo su ecommerce -s /bin/bash
cd ~/ecommerce
source ../ecommerce_env
python manage.py import_user_ids --settings=ecommerce.settings.production
1 Like