ClientError: Resource "course_summaries/" returned status code 500

940 views
Skip to first unread message

Jheng

unread,
Mar 12, 2017, 6:50:39 AM3/12/17
to Open edX operations
Hi , I have two servers.

server A: open edx platform (ficus.master) on ubuntu 16.04  ( following this doc: https://openedx.atlassian.net/wiki/display/OpenOPS/Native+Open+edX+Ubuntu+16.04+64+bit+Installation )

server B: insights on ubuntu 12.04 ( following this doc : https://openedx.atlassian.net/wiki/display/OpenOPS/edX+Analytics+Installation )



but Igot error when I visit the http://domain.com/courses/   page :

Here is the /edx/var/log/insights/edx.log:


and /edx/var/log/analytics-api/edx.log:

Mar 12 01:40:12 ubuntu [service_variant=analytics-api][django.request][env:no_env] ERROR [ubuntu  6179] [exception.py:124] - Internal Server Error: /api/v0/course_summaries/
Traceback (most recent call last):
  File "/edx/app/analytics_api/venvs/analytics_api/local/lib/python2.7/site-packages/django/core/handlers/exception.py", line 39, in inner
    response = get_response(request)
  File "/edx/app/analytics_api/venvs/analytics_api/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 249, in _legacy_get_response
    response = self._get_response(request)
  File "/edx/app/analytics_api/venvs/analytics_api/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 187, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/edx/app/analytics_api/venvs/analytics_api/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 185, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/edx/app/analytics_api/venvs/analytics_api/local/lib/python2.7/site-packages/django/views/decorators/csrf.py", line 58, in wrapped_view
    return view_func(*args, **kwargs)
  File "/edx/app/analytics_api/venvs/analytics_api/local/lib/python2.7/site-packages/django/views/generic/base.py", line 68, in view
    return self.dispatch(request, *args, **kwargs)
  File "/edx/app/analytics_api/venvs/analytics_api/local/lib/python2.7/site-packages/rest_framework/views.py", line 477, in dispatch
    response = self.handle_exception(exc)
  File "/edx/app/analytics_api/venvs/analytics_api/local/lib/python2.7/site-packages/rest_framework/views.py", line 437, in handle_exception
    self.raise_uncaught_exception(exc)
  File "/edx/app/analytics_api/venvs/analytics_api/local/lib/python2.7/site-packages/rest_framework/views.py", line 474, in dispatch
    response = handler(request, *args, **kwargs)
  File "/edx/app/analytics_api/analytics_api/analytics_data_api/v0/views/course_summaries.py", line 74, in get
    return super(CourseSummariesView, self).get(request, *args, **kwargs)
  File "/edx/app/analytics_api/venvs/analytics_api/local/lib/python2.7/site-packages/rest_framework/generics.py", line 200, in get
    return self.list(request, *args, **kwargs)
  File "/edx/app/analytics_api/venvs/analytics_api/local/lib/python2.7/site-packages/rest_framework/mixins.py", line 40, in list
    queryset = self.filter_queryset(self.get_queryset())
  File "/edx/app/analytics_api/analytics_api/analytics_data_api/v0/views/utils.py", line 26, in func_wrapper
    queryset = func(self)
  File "/edx/app/analytics_api/analytics_api/analytics_data_api/v0/views/course_summaries.py", line 137, in get_queryset
    return self.group_by_mode(queryset)
  File "/edx/app/analytics_api/analytics_api/analytics_data_api/v0/views/course_summaries.py", line 94, in group_by_mode
    for course_id, summaries in groupby(queryset, lambda x: (x.course_id)):
  File "/edx/app/analytics_api/venvs/analytics_api/local/lib/python2.7/site-packages/django/db/models/query.py", line 256, in __iter__
    self._fetch_all()
  File "/edx/app/analytics_api/venvs/analytics_api/local/lib/python2.7/site-packages/django/db/models/query.py", line 1087, in _fetch_all
    self._result_cache = list(self.iterator())
  File "/edx/app/analytics_api/venvs/analytics_api/local/lib/python2.7/site-packages/django/db/models/query.py", line 54, in __iter__
    results = compiler.execute_sql()
  File "/edx/app/analytics_api/venvs/analytics_api/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 835, in execute_sql
    cursor.execute(sql, params)
  File "/edx/app/analytics_api/venvs/analytics_api/local/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
  File "/edx/app/analytics_api/venvs/analytics_api/local/lib/python2.7/site-packages/django/db/utils.py", line 94, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/edx/app/analytics_api/venvs/analytics_api/local/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
  File "/edx/app/analytics_api/venvs/analytics_api/local/lib/python2.7/site-packages/django/db/backends/mysql/base.py", line 110, in execute
    return self.cursor.execute(query, args)
  File "/edx/app/analytics_api/venvs/analytics_api/local/lib/python2.7/site-packages/MySQLdb/cursors.py", line 205, in execute
    self.errorhandler(self, exc, value)
  File "/edx/app/analytics_api/venvs/analytics_api/local/lib/python2.7/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
    raise errorclass, errorvalue
ProgrammingError: (1146, "Table 'reports.course_meta_summary_enrollment' doesn't exist")


Thanks for any information.
Jheng

Jheng

unread,
Mar 17, 2017, 4:09:28 AM3/17/17
to Open edX operations
HI,everyone 

I got the similar issue after I commanded in analytics_api virtualenv./manage.py migrate --noinput --run-syncdb --database=default; ./manage.py migrate --noinput --run-syncdb --database=analytics; 

When I visited  http://domain.com/courses/   page :


and the /edx/var/log/insights/edx.log:

Thanks for any information.
Jheng

Jheng於 2017年3月12日星期日 UTC+8下午6時50分39秒寫道:

Dennis Jen

unread,
Mar 20, 2017, 3:36:05 PM3/20/17
to Open edX operations
Hi Jheng,

Sorry to hear of the troubles!  Do you see the course_meta_summary_enrollment table in the analytics database?  Also, something else to check is that endpoint is there (e.g. go to [hostname]/docs/#!/api) and see if the GET /api/v0/course_summaries/ is listed.

- Dennis

ji...@opencraft.com

unread,
Mar 20, 2017, 10:50:26 PM3/20/17
to Open edX operations
Hello,

We got this error too, until running the updated ImportEnrollmentsIntoMysql task, which creates and populates the reports.course_meta_summary_enrollment table.

It looks like the Analytics API is returning a 404 for the empty table, which should be more gracefully handled by the Dashboard.

Is this something you guys would be able to fix, or should we try to get a pull request together?

Cheers,
--

Jheng

unread,
Mar 21, 2017, 11:25:58 AM3/21/17
to Open edX operations
Hi Dennis and Jill,

thanks for your reply.

The issue is solved after running the ImportEnrollmentsIntoMysql task successfully.

Thanks for your help.
Jheng.

ji...@opencraft.com於 2017年3月21日星期二 UTC+8上午10時50分26秒寫道:
Reply all
Reply to author
Forward
0 new messages