Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using the XQueue interface #96

Open
shubhdev opened this issue Jun 3, 2015 · 10 comments
Open

Using the XQueue interface #96

shubhdev opened this issue Jun 3, 2015 · 10 comments

Comments

@shubhdev
Copy link

shubhdev commented Jun 3, 2015

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.

@e0d
Copy link
Contributor

e0d commented Jun 3, 2015

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

@shubhdev
Copy link
Author

shubhdev commented Jun 3, 2015

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

@e0d
Copy link
Contributor

e0d commented Jun 3, 2015

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
#96 (comment).

@shubhdev
Copy link
Author

shubhdev commented Jun 3, 2015

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
Copy link
Author

shubhdev commented Jun 7, 2015

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 shubhdev closed this as completed Jun 7, 2015
@shubhdev shubhdev reopened this Jun 7, 2015
@danilkuznetsov
Copy link

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);

@shubhdev
Copy link
Author

shubhdev commented Jun 8, 2015

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

@danilkuznetsov
Copy link

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

@knehez
Copy link

knehez commented Aug 2, 2015

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.

@wwj718
Copy link

wwj718 commented Oct 22, 2015

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants