{"action":"created","issue":{"url":"https://api.github.com/repos/edx/edx-ora2/issues/955","repository_url":"https://api.github.com/repos/edx/edx-ora2","labels_url":"https://api.github.com/repos/edx/edx-ora2/issues/955/labels{/name}","comments_url":"https://api.github.com/repos/edx/edx-ora2/issues/955/comments","events_url":"https://api.github.com/repos/edx/edx-ora2/issues/955/events","html_url":"https://github.com/edx/edx-ora2/pull/955","id":195907852,"number":955,"title":"Allow cancellation of buggy workflow","user":{"login":"efischer19","id":7373924,"avatar_url":"https://avatars.githubusercontent.com/u/7373924?v=3","gravatar_id":"","url":"https://api.github.com/users/efischer19","html_url":"https://github.com/efischer19","followers_url":"https://api.github.com/users/efischer19/followers","following_url":"https://api.github.com/users/efischer19/following{/other_user}","gists_url":"https://api.github.com/users/efischer19/gists{/gist_id}","starred_url":"https://api.github.com/users/efischer19/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/efischer19/subscriptions","organizations_url":"https://api.github.com/users/efischer19/orgs","repos_url":"https://api.github.com/users/efischer19/repos","events_url":"https://api.github.com/users/efischer19/events{/privacy}","received_events_url":"https://api.github.com/users/efischer19/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-12-15T20:28:13Z","updated_at":"2016-12-19T18:34:07Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/edx/edx-ora2/pulls/955","html_url":"https://github.com/edx/edx-ora2/pull/955","diff_url":"https://github.com/edx/edx-ora2/pull/955.diff","patch_url":"https://github.com/edx/edx-ora2/pull/955.patch"},"body":"From https://openedx.atlassian.net/browse/TNL-6093 and https://splunk.edx.org/en-US/app/search/search?sid=1481833446.2325572, it's possible to run into errors that prevent delete student state. Stack trace:\r\n```\r\nDec 15 18:59:22 ip-10-4-11-15 [service_variant=lms][django.request][env:prod-edge-edxapp] ERROR [ip-10-4-11-15  1730] [base.py:256] - Internal Server Error: /courses/course-v1:MITx+uINOV8x+4T2016/instructor/api/reset_student_attempts\r\nTraceback (most recent call last):\r\n  File \"/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/core/handlers/base.py\", line 132, in get_response\r\n    response = wrapped_callback(request, *callback_args, **callback_kwargs)\r\n  File \"/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/newrelic-2.74.0.54/newrelic/hooks/framework_django.py\", line 503, in wrapper\r\n    return wrapped(*args, **kwargs)\r\n  File \"/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/views/decorators/http.py\", line 45, in inner\r\n    return func(request, *args, **kwargs)\r\n  File \"/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/utils/decorators.py\", line 110, in _wrapped_view\r\n    response = view_func(request, *args, **kwargs)\r\n  File \"/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/views/decorators/cache.py\", line 43, in _cache_controlled\r\n    response = viewfunc(request, *args, **kw)\r\n  File \"/edx/app/edxapp/edx-platform/lms/djangoapps/instructor/views/api.py\", line 202, in wrapped\r\n    return func(*args, **kwargs)\r\n  File \"/edx/app/edxapp/edx-platform/lms/djangoapps/instructor/views/api.py\", line 175, in wrapped\r\n    return func(*args, **kwargs)\r\n  File \"/edx/app/edxapp/edx-platform/lms/djangoapps/instructor/views/api.py\", line 126, in wrapped\r\n    return func(request, *args, **kwargs)\r\n  File \"/edx/app/edxapp/edx-platform/lms/djangoapps/instructor/views/api.py\", line 1975, in reset_student_attempts\r\n    delete_module=delete_module\r\n  File \"/edx/app/edxapp/edx-platform/lms/djangoapps/instructor/enrollment.py\", line 254, in reset_student_attempts\r\n    requesting_user_id=requesting_user_id\r\n  File \"/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/openassessment/xblock/staff_area_mixin.py\", line 514, in clear_student_state\r\n    self._cancel_workflow(sub['uuid'], \"Student state cleared\", requesting_user_id=requesting_user_id)\r\n  File \"/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/openassessment/xblock/staff_area_mixin.py\", line 567, in _cancel_workflow\r\n    assessment_requirements=assessment_requirements\r\n  File \"/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/openassessment/workflow/api.py\", line 397, in cancel_workflow\r\n    AssessmentWorkflow.cancel_workflow(submission_uuid, comments, cancelled_by_id, assessment_requirements)\r\n  File \"/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/openassessment/workflow/models.py\", line 552, in cancel_workflow\r\n    workflow.cancel(assessment_requirements)\r\n  File \"/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/openassessment/workflow/models.py\", line 510, in cancel\r\n    score = self.get_score(assessment_requirements, step_for_name)\r\n  File \"/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/openassessment/workflow/models.py\", line 261, in get_score\r\n    score = get_score_func(self.submission_uuid, step_requirements)\r\n  File \"/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/openassessment/assessment/api/peer.py\", line 160, in get_score\r\n    if not submitter_is_finished(submission_uuid, peer_requirements):\r\n  File \"/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/openassessment/assessment/api/peer.py\", line 63, in submitter_is_finished\r\n    raise PeerAssessmentRequestError(u'Requirements dict must contain \"must_grade\" key')\r\nPeerAssessmentRequestError: Requirements dict must contain \"must_grade\" key\r\n```\r\n\r\nThese are just my first ideas of a fix that would allow the delete state to proceed."},"comment":{"url":"https://api.github.com/repos/edx/edx-ora2/issues/comments/268041335","html_url":"https://github.com/edx/edx-ora2/pull/955#issuecomment-268041335","issue_url":"https://api.github.com/repos/edx/edx-ora2/issues/955","id":268041335,"user":{"login":"staubina","id":2854941,"avatar_url":"https://avatars.githubusercontent.com/u/2854941?v=3","gravatar_id":"","url":"https://api.github.com/users/staubina","html_url":"https://github.com/staubina","followers_url":"https://api.github.com/users/staubina/followers","following_url":"https://api.github.com/users/staubina/following{/other_user}","gists_url":"https://api.github.com/users/staubina/gists{/gist_id}","starred_url":"https://api.github.com/users/staubina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/staubina/subscriptions","organizations_url":"https://api.github.com/users/staubina/orgs","repos_url":"https://api.github.com/users/staubina/repos","events_url":"https://api.github.com/users/staubina/events{/privacy}","received_events_url":"https://api.github.com/users/staubina/received_events","type":"User","site_admin":false},"created_at":"2016-12-19T18:34:07Z","updated_at":"2016-12-19T18:34:07Z","body":"@cahrens Tests are passing please review before merge."}}
{"actor":{"display_login":"staubina"}}