edx-platform icon indicating copy to clipboard operation
edx-platform copied to clipboard

Error while deleting course from sysadmin panel

Open micklebt opened this issue 12 years ago • 5 comments

Hi Team,

Getting below error while deleting a course from sysadmin, i have provided course id also but it shows strange error message Must pass in a course_id when calling get_items() with MixedModuleStore.

Jan 15 14:43:36 li654-38 [service_variant=lms][django.request][env:sandbox] ERROR [li654-38 6351] [base.py:215] - Internal Server Error: /sysadmin/courses Traceback (most recent call last): File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 111, in get_response response = callback(request, callback_args, *callback_kwargs) File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/views/generic/base.py", line 48, in view return self.dispatch(request, args, *kwargs) File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/utils/decorators.py", line 25, in wrapper return boundfunc(args, *kwargs) File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/utils/decorators.py", line 91, in wrappedview response = view_func(request, args, *kwargs) File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/utils/decorators.py", line 21, in bound_func return func(self, args2, *kwargs2) File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/utils/decorators.py", line 25, in wrapper return boundfunc(args, *kwargs) File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/contrib/auth/decorators.py", line 20, in wrappedview return view_func(request, args, *kwargs) File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/utils/decorators.py", line 21, in bound_func return func(self, args2, *kwargs2) File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/utils/decorators.py", line 25, in wrapper return boundfunc(args, *kwargs) File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/views/decorators/cache.py", line 75, in cachecontrolled response = viewfunc(request, args, *kw) File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/utils/decorators.py", line 21, in bound_func return func(self, args2, *kwargs2) File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/utils/decorators.py", line 25, in wrapper return boundfunc(args, *kwargs) File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/views/decorators/http.py", line 147, in inner response = func(request, args, *kwargs) File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/utils/decorators.py", line 21, in bound_func return func(self, args2, *kwargs2) File "/edx/app/edxapp/edx-platform/lms/djangoapps/dashboard/sysadmin.py", line 76, in dispatch return super(SysadminDashboardView, self).dispatch(args, *kwargs) File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/views/generic/base.py", line 69, in dispatch return handler(request, args, *kwargs) File "/edx/app/edxapp/edx-platform/lms/djangoapps/dashboard/sysadmin.py", line 555, in post delete_course(self.def_ms, content_store, loc, commit) File "/edx/app/edxapp/edx-platform/common/lib/xmodule/xmodule/modulestore/store_utilities.py", line 267, in delete_course modules = modulestore.get_items([source_location.tag, source_location.org , source_location.course, None, None, None]) File "/edx/app/edxapp/edx-platform/common/lib/xmodule/xmodule/modulestore/mixed.py", line 75, in get_items raise Exception("Must pass in a course_id when calling get_items() with MixedModuleStore") Exception: Must pass in a course_id when calling get_items() with MixedModuleStore

micklebt avatar Jan 16 '14 14:01 micklebt

I haven't had a change to look very closely at this, but at first blush I'm guessing it is as a result of using MixedModuleStore. MixedModuleStore is a mostly read only version of the studio mongo store. If you change your configuration in LMS to use the MongoModuleStore instead, this should work. I'll at least want to look into providing a better error message in the future though, so thank you for reporting the issue.

carsongee avatar Jan 16 '14 14:01 carsongee

Thank you for the quick response much appreciate it. Could you please tell me the exact location of the file to change from MixedModuleStore to MongoModuleStore

sushanthpy avatar Jan 16 '14 15:01 sushanthpy

If you are using the ansible plays in edx/configuration it is in /edx/app/edxapp/lms.auth.json under the MODULESTORE section. This will get overwritten if you rerun the plays and don't override that variable in the configuration repo/command line.

carsongee avatar Jan 16 '14 15:01 carsongee

@carsongee I used "ENGINE": "xmodule.modulestore.mixed.MixedModuleStore", and I restarted the app and got 500 error

ahmadio avatar Jan 22 '14 23:01 ahmadio

Should be: 'ENGINE': 'xmodule.modulestore.mongo.MongoModuleStore' so that it is a read/write store in LMS.

carsongee avatar Jan 22 '14 23:01 carsongee