How do I use a xqueue to generate a certificate?

733 views
Skip to first unread message

Lucas Sodré

unread,
Jul 17, 2014, 10:13:24 AM7/17/14
to edx-...@googlegroups.com
Hi 

I'm trying to generate a certificate but it is not working
All that I have is generating certificates on the dashboard


I guess that may be a xqueue problem


thanks 

daizhiy...@gmail.com

unread,
Jul 21, 2014, 4:28:05 AM7/21/14
to edx-...@googlegroups.com
please https://github.com/edx/edx-certificates

在2014年7月17日星期四UTC +8下午10时13分24秒,卢卡斯Sodré港口写道:
你好 

我想生成一个证书,但它不工作
所有这一切我都被生成在仪表盘上的证书我想这可能是一个xqueue问题




谢谢 

Lucas Sodré

unread,
Jul 22, 2014, 9:51:11 AM7/22/14
to edx-...@googlegroups.com
  • I'm already  using the certificates repo

Antonio Pardo

unread,
Sep 2, 2014, 10:26:06 AM9/2/14
to edx-...@googlegroups.com
I'm having trouble generating certificates. Then I show the exception.
How could I fix it? Thanks.

apardo@stag-upex-01:/edx/app/edxapp/edx-platform$ sudo -u www-data
/edx/bin/python.edxapp ./manage.py lms --settings aws regenerate_user -u
apa...@alabs.org -c IAEN/EC1010/2014T3 --insecure
2014-09-02 09:20:37,113 INFO 17930 [dd.dogapi] dog_stats_api.py:66 -
Initializing dog api to use statsd: localhost, 8125
Fetching enrollment for student apa...@alabs.org in IAEN/EC1010/2014T3
Fetching course data for IAEN/EC1010/2014T3
2014-09-02 09:20:38,321 ERROR 17930 [xmodule.x_module] x_module.py:320 -
Unable to load item
i4x://IAEN/EC1010/vertical/a0cdf4e6ef6d440eb62582ca27268fa3, skipping
Traceback (most recent call last):
File
"/edx/app/edxapp/edx-platform/common/lib/xmodule/xmodule/x_module.py",
line 317, in get_children
child = self.runtime.get_block(child_loc)
File
"/edx/app/edxapp/edx-platform/common/lib/xmodule/xmodule/x_module.py",
line 1130, in get_block
return self.load_item(usage_id)
File
"/edx/app/edxapp/edx-platform/common/lib/xmodule/xmodule/modulestore/mongo/base.py",
line 186, in load_item
module = self.modulestore.get_item(location)
File
"/edx/app/edxapp/edx-platform/common/lib/xmodule/xmodule/modulestore/mongo/draft.py",
line 97, in get_item
return get_published()
File
"/edx/app/edxapp/edx-platform/common/lib/xmodule/xmodule/modulestore/mongo/draft.py",
line 79, in get_published
return wrap_draft(super(DraftModuleStore, self).get_item(usage_key,
depth=depth))
File
"/edx/app/edxapp/edx-platform/common/lib/xmodule/xmodule/modulestore/mongo/base.py",
line 843, in get_item
item = self._find_one(usage_key)
File
"/edx/app/edxapp/edx-platform/common/lib/xmodule/xmodule/modulestore/mongo/base.py",
line 769, in _find_one
raise ItemNotFoundError(location)
ItemNotFoundError:
i4x://IAEN/EC1010/vertical/a0cdf4e6ef6d440eb62582ca27268fa3
2014-09-02 09:20:38,361 INFO 17930
[requests.packages.urllib3.connectionpool] connectionpool.py:176 -
Starting new HTTP connection (1): localhost
apardo - generating

Ciao

El 22/07/14 a las 08:51, Lucas Sodré escibió:
> * I'm already using the certificates repo
signature.asc

Joe Blaylock

unread,
Sep 2, 2014, 6:38:11 PM9/2/14
to edx-...@googlegroups.com
Normal output will give the username and a series of lines for any code jail invocations that have to be done. It looks to me as if this exception is coming out of the grader, possibly having trouble retrieving parts of your course. I'm not sure why that would be, but you could look in the LMS logs and see if any exceptions are generated when accessing your course content, perhaps that would help you narrow it down.

Another place to look is the certificate agent log. If you're running the certificate agent under suprevisor, the log should be in /edx/var/log/supervisor, and be called something like certs-stderr.log or certs-stdout.log. If you tail -f the stdout log while running regenerate_cert, you will be able to see right away whether the cert request is making it to the certificate agent (in which case that's where the failure is) or whether the request is never even being enqueued.

If the certificate agent is getting the cert request, it may be failing for it - looking in the stderr file will show you any exceptions that come from failures during certification. Unfortunately, it's an outstanding bug in the certificate agent that if it fails so spectacularly that the daemon dies, the error won't be reported back to LMS, and the cert's status in the certificates_generatedcertificate mysql table will continue to be 'generating' even though the cert errored-out. Usually conditions that cause the certificate agent to spectacularly fail are pretty obvious in the stderr logs. Often the problem is a missing bit of configuration in settings.py or a missing template file.

Good luck!

Lucas Sodré

unread,
Sep 6, 2014, 8:56:41 PM9/6/14
to edx-...@googlegroups.com
My log looks like this for every course:

CRITICAL 3810 [certificates.gen_cert] gen_cert.py:123 - Unable to lookup long names for course edX/DemoX/Demo_Course
2014-09-06 19:51:12,357 CRITICAL 3810 [certificates: __main__] certificate_agent.py:90 - Unable to parse queue response submission (u'edX/DemoX/Demo_Course') : {u'xqueue_files': u'{}', u'xqueue_header': u'{"submission_id": 27, "submission_key": "36b60f72589b5bfe4e4617e94ef5058b"}', u'xqueue_body': u'{"username": "honor", "template_pdf": "blank-portrait.pdf", "course_name": "edX Demonstration Course", "name": "honor", "grade": "Pass", "course_id": "edX/DemoX/Demo_Course", "action": "create"}'}

but for the old demo course this goes without problems

Joe Blaylock

unread,
Sep 8, 2014, 12:52:29 PM9/8/14
to edx-...@googlegroups.com
On Sat, Sep 6, 2014 at 5:56 PM, Lucas Sodré <lucas...@gmail.com> wrote:
My log looks like this for every course:

CRITICAL 3810 [certificates.gen_cert] gen_cert.py:123 - Unable to lookup long names for course edX/DemoX/Demo_Course
2014-09-06 19:51:12,357 CRITICAL 3810 [certificates: __main__] certificate_agent.py:90 - Unable to parse queue response submission (u'edX/DemoX/Demo_Course') : {u'xqueue_files': u'{}', u'xqueue_header': u'{"submission_id": 27, "submission_key": "36b60f72589b5bfe4e4617e94ef5058b"}', u'xqueue_body': u'{"username": "honor", "template_pdf": "blank-portrait.pdf", "course_name": "edX Demonstration Course", "name": "honor", "grade": "Pass", "course_id": "edX/DemoX/Demo_Course", "action": "create"}'}

but for the old demo course this goes without problems


Ah, that's helpful. The certificate agent currently doesn't have a way to know what courses are configured on your instance of -platform, so you have to add configuration describing your courses. This is a dictionary organized by course id. There's a sample in, if I recall correctly, 'cert-data.yml'. After editing it, you'll have to restart your certificate agent to make sure the file gets reread.

You can also hand-generate certs inside the certificate repository by running the 'gen_cert' command. If you give the -h flag it will output its command line flags. You can try manually generating a cert for the course you're interested in with an arbitrary test name, and if there are any problems, you'll get an exception on the console. This is probably faster to test with than going through the xqueue and everything. It's not perfect - it doesn't confirm that your xqueue configuration is correct, for example - but it lets you test your certs configuration in isolation and be sure it's right before you (separately) debug other pieces, which is really nice.

Hope that helps!

Joe

Lucas Sodré

unread,
Sep 11, 2014, 3:03:05 AM9/11/14
to edx-...@googlegroups.com, jr...@stanford.edu
Thank you Joe 

this was quite helpful!
Message has been deleted

Jeng Jie huang

unread,
Feb 5, 2015, 3:03:55 AM2/5/15
to edx-...@googlegroups.com, jr...@stanford.edu
Hello joe

After editing cert-data.yml, how do i restart the certificate agent ?

I had try using "python  certificate_agent.py" but it doesn't work.

How do I write the commend line to restart the  certificate_agent.py ?

Can you help me?
Thanks!

J.J.Huang


Joe Blaylock於 2014年9月9日星期二 UTC+8上午12時52分29秒寫道:

Marco Re

unread,
Feb 5, 2015, 12:59:01 PM2/5/15
to edx-...@googlegroups.com, jr...@stanford.edu
You need to use supervisor commands:

  •  "sudo -u www-data /edx/bin/supervisorctl -c /edx/app/supervisor/supervisord.conf status "   to list all services status....you should see the certs services
  • "sudo -u www-data /edx/bin/supervisorctl -c /edx/app/supervisor/supervisord.conf restart certs  "   restart the certs services
Marco  
Message has been deleted

melvin bautista

unread,
May 28, 2015, 5:56:58 AM5/28/15
to edx-...@googlegroups.com, jr...@stanford.edu
Hi i still encounter this error 

May 28 17:17:15 ip-10-229-66-202 [service_variant=certs][certificates: __main__][env:] CRITICAL [ip-10-229-66-202  31011] [certificate_agent.py:90] - Unable to parse queue response submission (u'UniversityArkipel/DS1/2015_T2') : {u'xqueue_files': u'{}', u'xqueue_header': u'{"submission_id": 2, "submission_key": "114adbd3807a1a8c6aceda1eb565de8b"}', u'xqueue_body': u'{"username": "Melvin", "template_pdf": "certificate-template-UniversityArkipel-DS1.pdf", "course_name": "Artificial Inteligence 2", "name": "Melvin Bautista", "grade": "Pass", "course_id": "UniversityArkipel/DS1/2015_T2", "action": "create"}'}
May 28 17:17:20 ip-10-229-66-202 [service_variant=certs][requests.packages.urllib3.connectionpool][env:] INFO [ip-10-229-66-202  31022] [connectionpool.py:191] - Starting new HTTP connection (1): localhost
May 28 17:26:07 ip-10-229-66-202 [service_variant=certs][certificates.gen_cert][env:] CRITICAL [ip-10-229-66-202  31022] [gen_cert.py:123] - Unable to lookup long names for course UniversityArkipel/DS1/2015_T2

even though i see to the dashboard that the certificates are generating.

Your final grade: 90%.

  • Your Certificate is Generating
 

how can i generate my certificate?

I run this command to generate the certificate 
sudo -u www-data /edx/bin/python.edxapp ./manage.py lms --settings aws regenerate_user -u ho...@example.com -c xxxx/xxxx/xxxxMycourseName
Reply all
Reply to author
Forward
0 new messages