Friday, July 25, 2014

edx-platform - EDX-SGA's "NoAuthHandlerFound" error

On July 20th, MIT's Office of Digital learning has released an XBlock for a Staff Graded Assignment (SGA). When placed in a course, this XBlock allows students to upload documents which can be viewed and graded by course staff.

Git repository: https://github.com/mitodl/edx-sga

But after I enabled the XBlock successfully, I could not upload the assignment file to the sga xblock (stop at 100%):



I checked the log and found this:

File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/boto/s3/connection.py", line 174, in __init__
    validate_certs=validate_certs)
  File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/boto/connection.py", line 557, in __init__
    host, config, self.provider, self._required_auth_capability())
  File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/boto/auth.py", line 728, in get_auth_handler
    'Check your credentials' % (len(names), str(names)))
NoAuthHandlerFound: No handler was ready to authenticate. 1 handlers were checked. ['HmacAuthV1Handler'] Check your credentials
 
 
As you can see, the issue was caused by the SGA XBlock used Amazon S3 as files storage which I hadn't set up yet. So, to fix this I just need to change the storage location of the SGA XBlock (which was determined by the DEFAULT_FILE_STORAGE variable in aws.py settings) to somewhere I can manage (local):
 
 => add the following lines (indicate the MEDIA_ROOT directory, and delete DEFAULT_FILE_STORAGE var) to cms/envs/aws.py and lms/envs/aws.py after the DEFAULT_FILE_STORAGE line:
...
del DEFAULT_FILE_STORAGE
MEDIA_ROOT = "/edx/var/edxapp/uploads"

...

Then restart edxapp and workers:

# /edx/bin/supervisorctl restart edxapp:
# /edx/bin/supervisorctl restart edxapp_worker: