Certificate - Students cannot download it

716 views
Skip to first unread message

Lucas Guerreiro

unread,
Jul 14, 2014, 11:23:36 AM7/14/14
to edx-...@googlegroups.com
Hello, 

I'm working with the certificates of the courses, but the students are not being able to download the certificates. The certificate download button is shown on the dashboard, however the link looks like this: 

Obviously, I can't download the certificate, even changing the address to my server's one, I cannot make it to work.

Where can I modify it in order to enable the download of the certificates?

PS.: if I navigate to the path /edx/var/certs/www-data/downloads/e3a9bbf9353743e994df6863467cfcca/Certificate.pdf   I can see that the certificate for this student was generated correctly.


Thanks!

Leonardo Salom

unread,
Jul 30, 2014, 6:47:26 AM7/30/14
to edx-...@googlegroups.com
Hi,

How you solved this? (if you did)

Lucas Guerreiro

unread,
Jul 31, 2014, 9:59:40 AM7/31/14
to edx-...@googlegroups.com

Hello, 

I could not solve it yet, if you get any clues please let me know. If I solve I will post it here.

Ovnicraft

unread,
Aug 15, 2014, 12:44:42 PM8/15/14
to edx-...@googlegroups.com
On Mon, Jul 14, 2014 at 10:23 AM, Lucas Guerreiro <guerre...@gmail.com> wrote:
Hello, 

I'm working with the certificates of the courses, but the students are not being able to download the certificates. The certificate download button is shown on the dashboard, however the link looks like this: 

Obviously, I can't download the certificate, even changing the address to my server's one, I cannot make it to work.

Where can I modify it in order to enable the download of the certificates?

Do you generated with django command from certificate apps ? 
 

PS.: if I navigate to the path /edx/var/certs/www-data/downloads/e3a9bbf9353743e994df6863467cfcca/Certificate.pdf   I can see that the certificate for this student was generated correctly.


Thanks!

Lucas Sodré

unread,
Aug 18, 2014, 2:29:47 PM8/18/14
to edx-...@googlegroups.com
I believe that the certificate is generated 
but when the user click on the link within the dashboard nothing happens

Joe Blaylock

unread,
Aug 18, 2014, 11:39:44 PM8/18/14
to edx-...@googlegroups.com
I'm glossing over some details in what follows, but I hope this will get you pointed in the right direction.

The problem is that the link on the dashboard just uses the URL stored in the certificates_generatedcertificate MySQL table at the time that the certs are generated. That value appears to have the hostname set to 'localhost', which always points to whatever computer the web browser is running on. Since the user's own computer is not a web server with a downloads folder, the certificates can't be found.

I'm not sure if I'm going to be able to help much, as I haven't tried serving certs off of the edx host; I've only set it up to upload certs to s3 and then serve them from there. But, I suspect that your edx server doesn't know its internet hostname, and so it's branding the certificates incorrectly. If you run 'hostname' at the command-line, it should return the name of the server that users type in their browser to reach your machine. If that looks correct, then the next thing to look at is your settings in /edx/app/edxapp/lms.env.json and /edx/app/edxapp/cms.env.json. Unfortunately I don't know what the local URL parameter is in the .env.json files, and I don't have my devstack handy to check. But I'm pretty sure you can find it fairly soon.

Once that's sorted out and your host knows what its name is, you'll need to either regenerate your certs or fix them. Regenerating is easiest - just delete the certificate_generatedcertificate rows for the course in question, and rerun the ./manage.py ungenerated_certs.

If you want to fix them, you'll need to patch up the 'download_url' column in the certificates_generatedcertificate table in MySQL. But beware that the default cert template also prints the verification page URL right on them, and that's likely to be wrong as well. So an in-place fixup may be unsatisfying.

Hope this helps. Good luck!

Joe Blaylock

unread,
Aug 18, 2014, 11:44:24 PM8/18/14
to edx-...@googlegroups.com
Oh, an additional thing that may be a problem, after the links are correctly pointing at your host, is that your web server (nginx, if you're using the normal setup) may not be configured to proxy requests for /downloads to /edx/var/certs/www-data/downloads. This is a pretty normal thing to want to do though, and looking at stack overflow and the example nginx configurations in the devstack should help you figure out how it should look. Remember that after you reconfigure nginx, you'll have to restart the service before it will start serving /downloads correctly. Your nginx logs in /edx/var/log/nginx (if I recall correctly) will probably help you tell what's happening to requests for /downloads.

Good luck
Joe


On Monday, July 14, 2014 8:23:36 AM UTC-7, Lucas Guerreiro wrote:

Lucas Guerreiro

unread,
Aug 21, 2014, 12:04:34 PM8/21/14
to edx-...@googlegroups.com
It was really helpful Joe, I'll take a look on that, thanks!!

By the way, since you are generating the certificates, do you know why sometimes they are generated and sometimes they are not? i.e. I see that the certificates are created in the certificates_generatedcertificate for the Demo course; however, any other courses have status "generating" and it is not getting to downloadable. In consequence of that they are not even being generated.

Thank you again, 

Lucas.

Joe Blaylock

unread,
Aug 21, 2014, 6:38:46 PM8/21/14
to edx-...@googlegroups.com
Certificate generation can fail for a variety of reasons; some of the changes in the Stanford branch (which hasn't landed yet) are to make the generator a little bit more robust. Something you can do to try to find root causes is to look in the certificate agent log, which on our instance is in the files /edx/var/log/supervisor/cert*.log. The -stderr.log file in particular should be helpful.

The way the certificate machinery on the edx-platform side is designed, certs which are in status 'generating' won't be regenerated. So a cert that fails partway through is in an awkward kind of purgatory. If you're sure that those represent actual certificate agent failures and not just a very deep xqueue, you can drop those rows from certificate_generatedcertificates and re-do the certificate run, and they'll be recreated the next time around (assuming the reason for the certificate agent's failure has been corrected.)

One way to be pretty sure it's not just queue depth is to select on status generating, but sort of the creation date - anything older than a few hours is probably a failure.

I've created a task card for myself to write a housekeeper that expires old 'generating' entries, but it's a lower priority than some of my other work, and I'm not sure when I'll be able to get to it. I'm happy to share my thoughts with anyone that wants to take a crack at it though. :)  (One can imagine not even having a housekeeping task, but instead just making the generator assume that any cert in 'generating' status older than some value X is bad, and updating its status to 'error' lazily, then re-queing that cert for creation.... I think this would be on edx-platform in like lms/djangoapps/certificates/queue.py and lms/djangoapps/certificates/managament/commands/*.py - but can't say where exactly without referencing my source, which I naturally don't have handy at the moment.

Hope that helps!
Joe

朱劲寿

unread,
Aug 21, 2014, 11:42:39 PM8/21/14
to edx-...@googlegroups.com
Modify /edx/app/certs/env.json

在 2014年7月14日星期一UTC+8下午11时23分36秒,Lucas Guerreiro写道:

melvin bautista

unread,
Jun 4, 2015, 8:00:12 AM6/4/15
to edx-...@googlegroups.com
Hi Lucas,

I can see the certificate on the /edx/var/certs/www-data/downloads directory folder but i can't see the button shown in dashboard :(.

How can i see the download button in the dashboard?

see the attachfile

Please help
Selection_356.png
Reply all
Reply to author
Forward
0 new messages