xqueue icon indicating copy to clipboard operation
xqueue copied to clipboard

Using the XQueue interface

Open shubhdev opened this issue 10 years ago • 10 comments

While it is clear to me how Xqueue works, I still do not understand how to use this Stanford example which was listed in the documentation. I have created a "code response problem". Then i added my queue name with its url to the "XQUEUES" key in /edx/app/xqueue/xqueue.env.json. Using this i was able to run a simple passive grader.(note this is different from the above mention stanford example). Now i wanted to know how to use the above example, which i think is an active grader.I have again added the url to /edx/app/xqueue/xqueue.env.json. now what is the login function in xqueue_util.py. Is the url same as the queue url? Please point me to a working example, or documentation.

shubhdev avatar Jun 03 '15 12:06 shubhdev

Please see:

https://github.com/edx/xqueue-watcher and specifically the client code for a worked example, https://github.com/edx/xqueue-watcher/blob/master/xqueue_watcher/client.py

e0d avatar Jun 03 '15 12:06 e0d

Thanks for your reply, i will look at this code. Can you please verify if this step of mine : "Then i added my queue name with its url to the "XQUEUES" key in /edx/app/xqueue/xqueue.env.json." is correct. And do i need to do the same for active grader

shubhdev avatar Jun 03 '15 12:06 shubhdev

Also make sure you have done what is described in section 6.10.6 of this document: http://doroob-course-staff-documentation.readthedocs.org/en/latest/exercises_tools/external_graders.html

On Wed, Jun 3, 2015 at 8:19 AM, Shubham Rawat [email protected] wrote:

Thanks for your reply, i will look at this code. Can you please verify if this step of mine : "Then i added my queue name with its url to the "XQUEUES" key in /edx/app/xqueue/xqueue.env.json." is correct. And do i need to do the same for active grader

— Reply to this email directly or view it on GitHub https://github.com/edx/xqueue/issues/96#issuecomment-108355940.

e0d avatar Jun 03 '15 12:06 e0d

I am trying to run a cpp grader using polling.The grader successfully logs in to the xqueue using the API, but on submitting the code on lms i get this error : Unable to deliver your submission to grader (Reason: unexpected HTTP status code [500]). Please try again later As a result the Xqueue remains empty, and the grader never receives the submission. What might be causing this?Also i need some confirmation on where to add a new xqueue. I add it to /edx/app/xqueue/xqueue.env.json

shubhdev avatar Jun 03 '15 14:06 shubhdev

I checked the logs for xqueue,

Jun  7 14:34:10 precise64 [service_variant=xqueue][django.request][env:sandbox] ERROR [precise64  1527] [base.py:213] - Internal Server Error: /xqueue/submit/
Traceback (most recent call last):
  File "/edx/app/xqueue/venvs/xqueue/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 109, in get_response
    response = callback(request, *callback_args, **callback_kwargs)
  File "/edx/app/xqueue/venvs/xqueue/local/lib/python2.7/site-packages/django/views/decorators/csrf.py", line 77, in wrapped_view
    return view_func(*args, **kwargs)
  File "/edx/app/xqueue/venvs/xqueue/local/lib/python2.7/site-packages/django/contrib/auth/decorators.py", line 20, in _wrapped_view
    return view_func(request, *args, **kwargs)
  File "/edx/app/xqueue/venvs/xqueue/local/lib/python2.7/site-packages/statsd.py", line 97, in wrapped
    result = func(*args, **kwargs)
  File "/edx/app/xqueue/venvs/xqueue/local/lib/python2.7/site-packages/django/db/transaction.py", line 224, in inner
    return func(*args, **kwargs)
  File "/edx/app/xqueue/xqueue/queue/lms_interface.py", line 59, in submit
    s3_url = _upload_to_s3(request.FILES[filename], queue_name, s3_key)
  File "/edx/app/xqueue/venvs/xqueue/local/lib/python2.7/site-packages/statsd.py", line 97, in wrapped
    result = func(*args, **kwargs)
  File "/edx/app/xqueue/xqueue/queue/lms_interface.py", line 180, in _upload_to_s3
    bucket = conn.create_bucket(bucketname)
  File "/edx/app/xqueue/venvs/xqueue/local/lib/python2.7/site-packages/boto/s3/connection.py", line 441, in create_bucket
    response.status, response.reason, body)
S3ResponseError: S3ResponseError: 403 Forbidden
<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>InvalidAccessKeyId</Code><Message>The AWS Access Key Id you provided does not exist in our records.</Message><AWSAccessKeyId></AWSAccessKeyId><RequestId>EE77AEBBDD1AAE81</RequestId><HostId>8vZtNw8BPHZcdlZ4eutM49sqKHJE6tN5iiZvV2KOaBTWohIYy76qoZlToNqXhTO4</HostId></Error>
Jun  7 14:34:10 precise64 [service_variant=xqueue][django.request][env:sandbox] WARNING [precise64  1527] [csrf.py:164] - Forbidden (CSRF cookie not set.): /xqueue/submit/

Can you please tell me about this error.

shubhdev avatar Jun 07 '15 14:06 shubhdev

Hi, this problem is due to the small size of the field lms_callback_url in mysql table queue_submission. If you temporarily disable the annotation @transaction.commit_manually for method def submit (request) in the xqueue/queue/lms_interface.py, you will see in the logs as follows: DatabaseError: (1406, "Data too long for column ' lms_callback_url ' at row 1"). You can temporarily solve the problem: to connect to the mysql server and change the field size command: alter table modify queue_submission lms_callback_url VARCHAR (255);

danilkuznetsov avatar Jun 07 '15 19:06 danilkuznetsov

But,why is AWS coming into play when I am not even using AWS, I am running this on my local machine.

shubhdev avatar Jun 08 '15 04:06 shubhdev

Sorry, yesterday I was tired and ill read your log file. My answer does not help your problem. When you add files to the problems they are automatically uploaded to the aws but in preferences AWS_ACCESS_KEY_ID = null

danilkuznetsov avatar Jun 08 '15 06:06 danilkuznetsov

Hi shubhdev, If you see the log: File "/edx/app/xqueue/xqueue/queue/lms_interface.py", line 180, in _upload_to_s3 In case of file submission, edx uses S3 to store files. BTW it is not documented anywhere. You must have an Amazon S3 account as well.

knehez avatar Aug 02 '15 19:08 knehez

@danilkuznetsov
There is an error in your SQL syntax, It should be:
alter table queue_submission modify lms_callback_url VARCHAR (255);
: )

wwj718 avatar Oct 22 '15 07:10 wwj718