i’m here about an error occured when i login to my Ecommerce Django Admin.
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/
Create a file, and put this content inside ( for example: nano /tmp/import_user_ids.sql )
SELECT username, id as user_id FROM edxapp.auth_user INTO OUTFILE ‘/tmp/test_users2.csv’ FIELDS TERMINATED BY ‘,’ OPTIONALLY ENCLOSED BY ‘"’ LINES TERMINATED BY ‘\r\n’;
LOAD DATA LOCAL INFILE ‘/tmp/test_users2.csv’ INTO TABLE ecommerce.temp_username_userid FIELDS TERMINATED BY ‘,’ OPTIONALLY ENCLOSED BY ‘"’ LINES TERMINATED BY ‘\r\n’ (username, lms_user_id);
CREATE INDEX username_index ON ecommerce.temp_username_userid (username);
Run those commands in the shell:
mysql -u root -p --enable-local-infile
mysql > source /tmp/import_user_ids.sql
mysql > exit
sudo su ecommerce -s /bin/bash
cd ~/ecommerce
source …/ecommerce_env
python manage.py import_user_ids --settings=ecommerce.settings.production
(if the one above failed, then try this one below)
python manage.py import_user_ids
exit
Check the result:
mysql -u root -p
mysql> select id,username,lms_user_id from ecommerce.ecommerce_user;
±—±-----------------±------------+
| id | username | lms_user_id |
±—±-----------------±------------+
| 1 | ecommerce_worker | 1 |
| 2 | ecommerce_user_1 | null|
±—±-----------------±------------+
2 rows in set (0.00 sec)
You should see somthing like this…
if “ecommerce_user_1” (this is the user i created in my case, so it can be different for you) has no “null” value, then:
mysql> update ecommerce.ecommerce_user set lms_user_id=1 where id=2;
mysql> select id,username,lms_user_id from ecommerce.ecommerce_user;
±—±-----------------±------------+
| id | username | lms_user_id |
±—±-----------------±------------+
| 1 | ecommerce_worker | 1 |
| 2 | ecommerce_user_1 | 1 |
±—±-----------------±------------+
2 rows in set (0.00 sec)
mysql> exit
And may be, if it was an issue for you too…
In the oscar dashboard when I click on the Account button as you can see on the image, It gives me Server Error Page.
Hey @Herve_siyou,
I confirm that we see the Server Error Page you mentioned above in our juniper and our former ironwood installation. however, I ignore it, since a couple of years ago. because there were no side effects for us. ( we accepted it to stay in place )
if you found a fixture, please let us know. and if it’s suffering you or your customers, don’t hesitate and follow it up with a new thread.
thank you