Logging call stack

82 views
Skip to first unread message

Abdallah Nassif

unread,
Oct 16, 2015, 12:13:29 PM10/16/15
to General Open edX discussion
Hello,

i recently noticed that these log lines which I first thought were errors, but I am not sure what they are or why they are being logged. For example,

###################################################

==> /edx/var/log/lms/edx.log <==
Oct 16 16:02:24 [service_variant=lms][openedx.core.djangoapps.call_stack_manager.core][env:sandbox] INFO [29043] [core.py:120] - Logging new call stack number 1 for <class 'courseware.models.StudentModuleHistory'>:
   File "/edx/app/edxapp/venvs/edxapp/bin/gunicorn", line 9, in <module>
    load_entry_point('gunicorn==0.17.4', 'console_scripts', 'gunicorn')()
  File "/edx/app/edxapp/edx-platform/lms/djangoapps/courseware/module_render.py", line 945, in handle_xblock_callback
    return _invoke_xblock_handler(request, course_id, usage_id, handler, suffix, course=course)
  File "/edx/app/edxapp/edx-platform/lms/djangoapps/courseware/module_render.py", line 1064, in _invoke_xblock_handler
    resp = instance.handle(handler, req, suffix)
  File "/edx/app/edxapp/edx-platform/common/lib/xmodule/xmodule/x_module.py", line 1274, in handle
    return super(MetricsMixin, self).handle(block, handler_name, request, suffix=suffix)
  File "/edx/app/edxapp/edx-platform/common/lib/xmodule/xmodule/x_module.py", line 835, in xmodule_handler
    response_data = self.handle_ajax(suffix, request_post)
  File "/edx/app/edxapp/edx-platform/common/lib/xmodule/xmodule/capa_module.py", line 93, in handle_ajax
    result = handlers[dispatch](data)
  File "/edx/app/edxapp/edx-platform/common/lib/xmodule/xmodule/capa_base.py", line 1100, in check_problem
    published_grade = self.publish_grade()
  File "/edx/app/edxapp/edx-platform/common/lib/xmodule/xmodule/capa_base.py", line 992, in publish_grade
    'max_value': score['total'],
  File "/edx/app/edxapp/edx-platform/lms/djangoapps/courseware/module_render.py", line 547, in publish
    handle_grade_event(block, event_type, event)
  File "/edx/app/edxapp/edx-platform/lms/djangoapps/courseware/module_render.py", line 508, in handle_grade_event
    max_grade,
  File "/edx/app/edxapp/edx-platform/lms/djangoapps/courseware/model_data.py", line 1012, in set_score
    student_module.save()
  File "/edx/app/edxapp/edx-platform/lms/djangoapps/courseware/models.py", line 189, in save_history
    history_entry.save()

#########################################################

Any idea why I keep seeing them?

Abdallah

Jesse Zoldak

unread,
Oct 16, 2015, 12:34:38 PM10/16/15
to edx-code
It looks like that change came in through this PR: https://github.com/edx/edx-platform/pull/8835

Maybe @utkjad is on the mailing list and can provide insight?
Perhaps the messages would be better logged at a different level, i.e. debug rather than info?

-- JZ

--
You received this message because you are subscribed to the Google Groups "General Open edX discussion" group.
To view this discussion on the web visit https://groups.google.com/d/msgid/edx-code/1214747e-a859-4048-a87f-529342355e46%40googlegroups.com.

Utkarsh J

unread,
Oct 16, 2015, 8:23:34 PM10/16/15
to edx-...@googlegroups.com

Hi Abdallah, and Jay,

It is basically a call log of StudentModuleHistory. 

In short, this particular call is not made via edx-user-state-client interface named XBlockUserStateClient, and its Django implementation. It is NOT an error. 

To know more about it, you can read an article HERE.

- Utk.




Ned Batchelder

unread,
Oct 17, 2015, 6:14:28 AM10/17/15
to edx-...@googlegroups.com
Utkarsh, if I understand correctly, these traces were put in place so that edX engineers could understand more about how the courseware_studentmodule table was being used.  They shouldn't be appearing on sites besides edx.org, should they?  Seems like a lot of noise for people who aren't interested in the problem you were pursuing.

--Ned.

Utkarsh J

unread,
Oct 17, 2015, 10:15:23 AM10/17/15
to edx-...@googlegroups.com

Hi Ned,

They shouldn't be appearing on sites besides edx.org, should they? 
--  I personally think they should not. Also, they should be removed after their purpose has been served. I have created a JIRA ticket for the same.(PLAT-819)

Anyways, here is a simple way to get rid of it-
1.  In file edx-platform/lms/djangoapps/courseware/models.py

a) Remove import 
from openedx.core.djangoapps.call_stack_manager import CallStackManager, CallStackMixin 

b) In StudentModule,  replace 
    objects = ChunkingCallStackManager() 
    with 
    objects = ChunkingManager()

c) Also, Remove CallStackMixin.
In short, change 
class StudentModule(CallStackMixin, models.Model): 
to 
class StudentModule(models.Model):

d) In StudentModuleHistory change
class StudentModuleHistory(CallStackMixin, models.Model): 
to 
class StudentModuleHistory(models.Model):
Also, remove 
objects = CallStackManager()



2. In file edx-platform/lms/djangoapps/courseware/model_data.py

a) Remove following import 
from openedx.core.djangoapps.call_stack_manager import donottrack

b) Remove use of @donotrack (currently at Line no 996)
@donottrack(StudentModule)

I hope that will solve the problem. 


Ned Batchelder

unread,
Oct 17, 2015, 4:11:47 PM10/17/15
to edx-...@googlegroups.com
Utkarsh, when you say, "they shouldn't be appearing on sites besides edx.org", do you mean that you wrote it in such a way that they wouldn't appear, or do you mean that in retrospect, we should have written it that way?

Thanks for these instructions to turn them off, but it's a bit much to expect other site operators to edit the code this extensively...

--Ned.

Utkarsh J

unread,
Oct 17, 2015, 6:39:01 PM10/17/15
to edx-...@googlegroups.com
On 17 October 2015 at 16:11, Ned Batchelder <n...@edx.org> wrote:
Utkarsh, when you say, "they shouldn't be appearing on sites besides edx.org", do you mean that you wrote it in such a way that they wouldn't appear, or do you mean that in retrospect, we should have written it that way?
======> We should have done it that way. At least for the scope of my work, they should not be appearing on sites besides edx.org. However, we were interested to get call logs on Production which would give us clear picture on calls that are being made outside the edx-user-state-client interface. This is important because, all calls to CSM/CSMH should, ideally, go through edx-user-state-client interface. If required, we can run it on other sites besides edx.org, to get clear picture on outside calls. But, as I said earlier, scope of my work was limited to edx.org production. 
Thanks for these instructions to turn them off, but it's a bit much to expect other site operators to edit the code this extensively...
======>  Yes. I would be happy to help clearing it up. 

Jaroslavas Karmazinas

unread,
Sep 18, 2018, 1:21:39 PM9/18/18
to General Open edX discussion

  Yes. I would be happy to help clearing it up. 
пятница, 16 октября 2015 г., 17:13:29 UTC+1 пользователь No dat написал:
Reply all
Reply to author
Forward
0 new messages