Hi,
There is a problem with the preview button in the studio. When I click it, it makes an internal server error
Here is the lms log
tutor_local-lms-1 | 2023-05-24 17:34:19,378 INFO 19 [openedx.core.djangoapps.cors_csrf.helpers] [user 4] [ip 195.251.141.31] helpers.py:64 - Origin 'https://preview.mooc.xxxx.com' was not in `CORS_ORIGIN_WHITELIST`; full referer was 'https://preview.mooc.xxxx.com/login?next=/courses/course-v1%3AUnv%2BCS101%2B2023_T2/courseware/0bba6e642af1465da5e67c2cda87d0e8/707ebcb39ca54a809a58970134bd6c53/1%3Factivate_block_id%3Dblock-v1%253AUnv%252BCS101%252B2023_T2%252Btype%2540vertical%252Bblock%25402c07fe16f0b74390bf2c2b6955e20bdd' and requested host was 'preview.mooc.xxx.com'; CORS_ORIGIN_ALLOW_ALL=False
tutor_local-lms-1 | 2023-05-24 17:34:20,678 ERROR 19 [edx.courseware] [user 4] [ip 195.251.141.31] views.py:749 - Error in /courses/course-v1:Unv+CS101+2023_T2/courseware/0bba6e642af1465da5e67c2cda87d0e8/707ebcb39ca54a809a58970134bd6c53/1: user=g, effective_user=, course=course-v1:Unv+CS101+2023_T2
tutor_local-lms-1 | Traceback (most recent call last):
tutor_local-lms-1 | File "/openedx/edx-platform/./lms/djangoapps/courseware/views/index.py", line 154, in get
tutor_local-lms-1 | return self.render(request)
tutor_local-lms-1 | File "/openedx/edx-platform/./lms/djangoapps/courseware/views/index.py", line 260, in render
tutor_local-lms-1 | return render_to_response('courseware/courseware.html', self._create_courseware_context(request))
tutor_local-lms-1 | File "/openedx/edx-platform/./lms/djangoapps/courseware/views/index.py", line 496, in _create_courseware_context
tutor_local-lms-1 | courseware_context['fragment'] = self.section.render(self.view, section_context)
tutor_local-lms-1 | File "/openedx/venv/lib/python3.8/site-packages/xblock/core.py", line 198, in render
tutor_local-lms-1 | return self.runtime.render(self, view, context)
tutor_local-lms-1 | File "/openedx/edx-platform/common/lib/xmodule/xmodule/x_module.py", line 2186, in render
tutor_local-lms-1 | return self.__getattr__('render')(block, view_name, context)
tutor_local-lms-1 | File "/openedx/edx-platform/common/lib/xmodule/xmodule/x_module.py", line 1428, in render
tutor_local-lms-1 | return super().render(block, view_name, context=context)
tutor_local-lms-1 | File "/openedx/venv/lib/python3.8/site-packages/xblock/runtime.py", line 847, in render
tutor_local-lms-1 | frag = view_fn(context)
tutor_local-lms-1 | File "/openedx/edx-platform/common/lib/xmodule/xmodule/seq_module.py", line 490, in student_view
tutor_local-lms-1 | return self._student_or_public_view(context, prereq_met, prereq_meta_info, banner_text)
tutor_local-lms-1 | File "/openedx/edx-platform/common/lib/xmodule/xmodule/seq_module.py", line 621, in _student_or_public_view
tutor_local-lms-1 | fragment.add_content(self.runtime.service(self, 'mako').render_template("seq_module.html", params))
tutor_local-lms-1 | File "/openedx/edx-platform/common/djangoapps/edxmako/services.py", line 30, in render_template
tutor_local-lms-1 | return render_to_string(template_file, dictionary, namespace=self.namespace_prefix + namespace)
tutor_local-lms-1 | File "/openedx/edx-platform/common/djangoapps/edxmako/shortcuts.py", line 178, in render_to_string
tutor_local-lms-1 | return template.render(dictionary, request)
tutor_local-lms-1 | File "/openedx/edx-platform/common/djangoapps/edxmako/template.py", line 82, in render
tutor_local-lms-1 | return self.mako_template.render_unicode(**context_dictionary)
tutor_local-lms-1 | File "/openedx/venv/lib/python3.8/site-packages/mako/template.py", line 444, in render_unicode
tutor_local-lms-1 | return runtime._render(
tutor_local-lms-1 | File "/openedx/venv/lib/python3.8/site-packages/mako/runtime.py", line 874, in _render
tutor_local-lms-1 | _render_context(
tutor_local-lms-1 | File "/openedx/venv/lib/python3.8/site-packages/mako/runtime.py", line 916, in _render_context
tutor_local-lms-1 | _exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
tutor_local-lms-1 | File "/openedx/venv/lib/python3.8/site-packages/mako/runtime.py", line 943, in _exec_template
tutor_local-lms-1 | callable_(context, *args, **kwargs)
tutor_local-lms-1 | File "/tmp/mako_lms/f1543ed24543a70de2c17ebfc03bb76a/seq_module.html.py", line 146, in render_body
tutor_local-lms-1 | __M_writer(filters.html_escape(filters.decode.utf8(chapter_completion_aggregator_url)))
tutor_local-lms-1 | File "/openedx/venv/lib/python3.8/site-packages/mako/filters.py", line 47, in decode
tutor_local-lms-1 | return decode(str(x))
tutor_local-lms-1 | File "/openedx/venv/lib/python3.8/site-packages/mako/runtime.py", line 230, in __str__
tutor_local-lms-1 | raise NameError("Undefined")
tutor_local-lms-1 | NameError: Undefined
tutor_local-lms-1 | 2023-05-24 17:34:20,830 ERROR 19 [django.request] [user None] [ip None] log.py:224 - Internal Server Error: /courses/course-v1:Unv+CS101+2023_T2/courseware/0bba6e642af1465da5e67c2cda87d0e8/707ebcb39ca54a809a58970134bd6c53/1
tutor_local-lms-1 | [pid: 19|app: 0|req: 4820/11238] 172.18.0.11 () {60 vars in 4975 bytes} [Wed May 24 17:34:19 2023] GET /courses/course-v1:Unv+CS101+2023_T2/courseware/0bba6e642af1465da5e67c2cda87d0e8/707ebcb39ca54a809a58970134bd6c53/1?activate_block_id=block-v1%3AUnv%2BCS101%2B2023_T2%2Btype%40vertical%2Bblock%402c07fe16f0b74390bf2c2b6955e20bdd => generated 17216 bytes in 1580 msecs (HTTP/1.1 500) 8 headers in 574 bytes (1 switches on core 0)
I have set the PREVIEW_LMS_BASE in lms.env.yml and cms.env.yml
Also, the preview.mooc.xxx.com takes me to /dashboard
I wonder If I have to set the CORS_ORIGIN_WHITELIST or to do something else. If I need to set the CORS_ORIGIN_WHITELIST where and how to do it?