eduNEXT / eox-hooks

GNU Affero General Public License v3.0
3 stars 0 forks source link

Problem with programs #34

Closed DeimerM closed 1 year ago

DeimerM commented 2 years ago

Hello Team!

I created this topic because we have a problem at the moment with the configuration of the programs, to know more details about the programs this is the documentation.

Context:

We have an installation running on Kubernetes using the following edx-platform branch ednx-release/mango.master. The programs make use of the following action trigger_grades_assignment to retrieve the grading of the child courses, this action will be executed when the user requests their certificate.

Issue:

When the action is executed there is an error on the following line. https://github.com/eduNEXT/eox-hooks/blob/730e7c982da6c8c29032f4ec96d939eea4152d1e/eox_hooks/actions.py#L224 since django_request is none the execution of this function is throwing an error, I think this could be a problem with get_current_request, we take the following traceback from an instance of lms-worker.

    2022-10-11 18:50:44,871 ERROR 40 [lms.djangoapps.courseware.module_render] [user None] [ip None] module_render.py:340 - Error in get_module
    Traceback (most recent call last):
      File "/openedx/venv/lib/python3.8/site-packages/django/db/models/query.py", line 581, in get_or_create
        return self.get(**kwargs), False
      File "/openedx/venv/lib/python3.8/site-packages/django/db/models/query.py", line 435, in get
        raise self.model.DoesNotExist(
    eox_tenant.tenant_wise.proxies.TenantGeneratedCertificateProxy.DoesNotExist: TenantGeneratedCertificateProxy matching query does not exist.

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "/openedx/edx-platform/lms/djangoapps/courseware/module_render.py", line 327, in get_module
        return get_module_for_descriptor(user, request, descriptor, field_data_cache, usage_key.course_key,
      File "/openedx/edx-platform/lms/djangoapps/courseware/module_render.py", line 408, in get_module_for_descriptor
        xqueue_callback_url_prefix = get_xqueue_callback_url_prefix(request)
      File "/openedx/edx-platform/lms/djangoapps/courseware/module_render.py", line 389, in get_xqueue_callback_url_prefix
        proto=request.META.get('HTTP_X_FORWARDED_PROTO', 'https' if request.is_secure() else 'http'),
    AttributeError: 'NoneType' object has no attribute 'META'
    2022-10-11 18:50:44,872 ERROR 40 [eox_hooks.actions_handler] [user None] [ip None] actions_handler.py:26 - The action <function trigger_grades_assignment at 0x7feed0fde790> triggered by post_certificate_creation failed

Also, we discovered that in lilac, the certificates were generated by the sync server and after that version (maple) the certificates are generated by the async server, maybe this could be a possible problem. below we can find an example that makes use of a sync server instead of an async server in eox-taylor to generate the certificates.

sync certificates