Preview button not working

Hi.

Running Juniper here.

When I click on “Preview” button in Studio (trying to preview a yet unpublished unit) I get a 404 page not found error.

This is the URL that I get:
https://preview.mooc.mydomain.com/courses/course-v1:UEU+test101+2020_T3/jump_to/block-v1:UEU+test101+2020_T3+type@vertical+block@ddda706e510a4bb88162872127012463

(my course is hosted in mooc.mydomain.com)

I checked that my /edx/etc/lms.yml has a correct PREVIEW_LMS_BASE setting:

PREVIEW_LMS_BASE: preview.mooc.mydomain.com

Same happens with studio.yml. I added preview.mooc.mydomain.com to my local /etc/hosts file (I will add it to my DNS zone once I get it working)

Trying to know why I get that error, I also set the DEBUG_ACCESS variable to true here:
https://github.com/edx/edx-platform/blob/master/lms/djangoapps/courseware/access_utils.py#L31

but I don’t know where is it logging the access messages (if it is logging anything at all…)
I checked all these files to no avail (no access information or errors happening there):

sudo tail -f /edx/var/log/supervisor/lms* /edx/var/log/lms/edx.log /edx/var/log/cms/edx.log /edx/var/log/nginx/error.log

So how can I make the PREVIEW button to work? Or how can I know why is it giving me a 404 error?

Thanks!

Hey,

Not sure, but check the dates if the course is released and if that also does not work try publishing and then have a look.

Hi @chintan,

the course is released. I just added a new unit and wanted to preview it before publishing. It is my understanding that Preview’s aim is just to allow that (preview a unit before publishing). In fact, I’d also say that Preview should also allow to preview a unit that is in a course not yet released, shouldn’t it?

I’m wondering how could I debug why isn’t it working…

Okay, I usually just use the same domain as my main domain instead of adding preview in it.

Try that, but keep a trailing / in the end because without it there are some other pages which gives 404

Yep, I found your answer in this previous post, and tried to set

PREVIEW_LMS_BASE: mooc.mydomain.com/ <-- with a slash
and
LMS_BASE: mooc.mydomain.com <-- without a slash
but didn’t work. I’ll have to dig further in the code to figure out the reason of this behaviour…