Hi,
I’m trying to run refresh_course_metadata command using the frontend via call_command in that I’m getting error but when running the same command using the terminal it runs without any error.
The error is like something below:
Aug 9 07:03:50 ip-172-31-45-95 [service_variant=discovery][course_discovery.apps.course_metadata.management.commands.refresh_course_metadata] INFO [ip-172-31-45-95 2981] [/edx/app/discovery/discovery/course_discovery/apps/course_metadata/management/commands/refresh_course_metadata.py:123] - Command is using threads to write data.
Aug 9 07:03:50 ip-172-31-45-95 [service_variant=discovery][course_discovery.apps.course_metadata.management.commands.refresh_course_metadata] INFO [ip-172-31-45-95 2981] [/edx/app/discovery/discovery/course_discovery/apps/course_metadata/management/commands/refresh_course_metadata.py:145] - Executing Loader [https://staging-lms.visionempowertrust.org/api/courses/v1/]
Aug 9 07:03:50 ip-172-31-45-95 [service_variant=discovery][course_discovery.apps.course_metadata.data_loaders.api] INFO [ip-172-31-45-95 4476] [/edx/app/discovery/discovery/course_discovery/apps/course_metadata/data_loaders/api.py:34] - Refreshing Courses and CourseRuns from https://staging-lms.visionempowertrust.org/api/courses/v1/…
Aug 9 07:03:50 ip-172-31-45-95 [service_variant=discovery][course_discovery.apps.course_metadata.data_loaders.api] INFO [ip-172-31-45-95 4476] [/edx/app/discovery/discovery/course_discovery/apps/course_metadata/data_loaders/api.py:84] - Requesting course run page 1…
Aug 9 07:03:50 ip-172-31-45-95 [service_variant=discovery][django.request] ERROR [ip-172-31-45-95 2981] [/edx/app/discovery/venvs/discovery/lib/python3.5/site-packages/django/utils/log.py:228] - Internal Server Error: /course_update_scripts/course-sync
Traceback (most recent call last):
File “/edx/app/discovery/venvs/discovery/lib/python3.5/site-packages/django/core/handlers/exception.py”, line 34, in inner
response = get_response(request)
File “/edx/app/discovery/venvs/discovery/lib/python3.5/site-packages/django/core/handlers/base.py”, line 115, in _get_response
response = self.process_exception_by_middleware(e, request)
File “/edx/app/discovery/venvs/discovery/lib/python3.5/site-packages/django/core/handlers/base.py”, line 113, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File “/usr/lib/python3.5/contextlib.py”, line 30, in inner
return func(*args, **kwds)
File “/usr/lib/python3.5/contextlib.py”, line 30, in inner
return func(*args, **kwds)
File “/edx/app/discovery/discovery/course_discovery/apps/course_update_scripts/views.py”, line 42, in discovery_views
call_command(‘refresh_course_metadata’, verbosity=0)
File “/edx/app/discovery/venvs/discovery/lib/python3.5/site-packages/django/core/management/init.py”, line 148, in call_command
return command.execute(*args, **defaults)
File “/edx/app/discovery/venvs/discovery/lib/python3.5/site-packages/django/core/management/base.py”, line 364, in execute
output = self.handle(*args, **options)
File “/edx/app/discovery/discovery/course_discovery/apps/course_metadata/management/commands/refresh_course_metadata.py”, line 155, in handle
success = success and all(f.result() for f in futures)
File “/edx/app/discovery/discovery/course_discovery/apps/course_metadata/management/commands/refresh_course_metadata.py”, line 155, in
success = success and all(f.result() for f in futures)
File “/usr/lib/python3.5/concurrent/futures/_base.py”, line 398, in result
return self.__get_result()
File “/usr/lib/python3.5/concurrent/futures/_base.py”, line 357, in __get_result
raise self._exception
concurrent.futures.process.BrokenProcessPool: A process in the process pool was terminated abruptly while the future was running or pending.
Aug 9 07:03:50 ip-172-31-45-95 [service_variant=discovery][django.request] ERROR [ip-172-31-45-95 2981] [/edx/app/discovery/venvs/discovery/lib/python3.5/site-packages/django/utils/log.py:228] - Internal Server Error: /course_update_scripts/course-sync
Traceback (most recent call last):
File “/edx/app/discovery/venvs/discovery/lib/python3.5/site-packages/django/core/handlers/exception.py”, line 34, in inner
response = get_response(request)
File “/edx/app/discovery/venvs/discovery/lib/python3.5/site-packages/django/core/handlers/base.py”, line 115, in _get_response
response = self.process_exception_by_middleware(e, request)
File “/edx/app/discovery/venvs/discovery/lib/python3.5/site-packages/django/core/handlers/base.py”, line 113, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File “/usr/lib/python3.5/contextlib.py”, line 30, in inner
return func(*args, **kwds)
File “/usr/lib/python3.5/contextlib.py”, line 30, in inner
return func(*args, **kwds)
File “/edx/app/discovery/discovery/course_discovery/apps/course_update_scripts/views.py”, line 42, in discovery_views
call_command(‘refresh_course_metadata’, verbosity=0)
File “/edx/app/discovery/venvs/discovery/lib/python3.5/site-packages/django/core/management/init.py”, line 148, in call_command
return command.execute(*args, **defaults)
File “/edx/app/discovery/venvs/discovery/lib/python3.5/site-packages/django/core/management/base.py”, line 364, in execute
output = self.handle(*args, **options)
File “/edx/app/discovery/discovery/course_discovery/apps/course_metadata/management/commands/refresh_course_metadata.py”, line 155, in handle
success = success and all(f.result() for f in futures)
File “/edx/app/discovery/discovery/course_discovery/apps/course_metadata/management/commands/refresh_course_metadata.py”, line 155, in
success = success and all(f.result() for f in futures)
File “/usr/lib/python3.5/concurrent/futures/_base.py”, line 398, in result
return self.__get_result()
File “/usr/lib/python3.5/concurrent/futures/_base.py”, line 357, in __get_result
raise self._exception
concurrent.futures.process.BrokenProcessPool: A process in the process pool was terminated abruptly while the future was running or pending.
Aug 9 07:03:50 ip-172-31-45-95 [service_variant=discovery][django.request] ERROR [ip-172-31-45-95 2981] [/edx/app/discovery/venvs/discovery/lib/python3.5/site-packages/django/utils/log.py:228] - Internal Server Error: /course_update_scripts/course-sync
Traceback (most recent call last):
File “/edx/app/discovery/venvs/discovery/lib/python3.5/site-packages/django/core/handlers/exception.py”, line 34, in inner
response = get_response(request)
File “/edx/app/discovery/venvs/discovery/lib/python3.5/site-packages/django/core/handlers/base.py”, line 115, in _get_response
response = self.process_exception_by_middleware(e, request)
File “/edx/app/discovery/venvs/discovery/lib/python3.5/site-packages/django/core/handlers/base.py”, line 113, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File “/usr/lib/python3.5/contextlib.py”, line 30, in inner
return func(*args, **kwds)
File “/usr/lib/python3.5/contextlib.py”, line 30, in inner
return func(*args, **kwds)
File “/edx/app/discovery/discovery/course_discovery/apps/course_update_scripts/views.py”, line 42, in discovery_views
call_command(‘refresh_course_metadata’, verbosity=0)
File “/edx/app/discovery/venvs/discovery/lib/python3.5/site-packages/django/core/management/init.py”, line 148, in call_command
return command.execute(*args, **defaults)
File “/edx/app/discovery/venvs/discovery/lib/python3.5/site-packages/django/core/management/base.py”, line 364, in execute
output = self.handle(*args, **options)
File “/edx/app/discovery/discovery/course_discovery/apps/course_metadata/management/commands/refresh_course_metadata.py”, line 155, in handle
success = success and all(f.result() for f in futures)
File “/edx/app/discovery/discovery/course_discovery/apps/course_metadata/management/commands/refresh_course_metadata.py”, line 155, in
success = success and all(f.result() for f in futures)
File “/usr/lib/python3.5/concurrent/futures/_base.py”, line 398, in result
return self.__get_result()
File “/usr/lib/python3.5/concurrent/futures/_base.py”, line 357, in __get_result
raise self._exception
concurrent.futures.process.BrokenProcessPool: A process in the process pool was terminated abruptly while the future was running or pending.