Configure edx-enterprise in tutor-14.1.2 (nutmeg.2)

Hello All,

I’m trying to setup edx-enterprise on tutor version 14.1.2

I tried steps for it:

  1. Installed and enabled discover plugin
    -tutor plugins enable discovery
    -tutor local quickstart

  2. https://discovery.lms-host/admin/catalogs/catalog/add/
    Name: myCat
    Query: GET /api/v1/search/courses

  3. Added new enterprise customer https://lms-host/admin/enterprise/enterprisecustomer/

  4. Added below flags in plugin:
    COURSE_CATALOG_API_URL = “https://discovery.lms-host

  5. Executed the below commands.
    tutor local run discovery ./manage.py refresh_course_metadata --partner_code=openedx
    tutor local run discovery ./manage.py update_index --disable-change-limit
    tutor local run lms ./manage.py lms create_catalog_integrations --enabled
    –internal_api_url=“http://discovery.lms-host/api/v1
    –service_username=lms_catalog_service_user
    tutor local run lms ./manage.py lms cache_programs

I’m getting the below error when I enroll the learner in the enterprise using admin.

lms_1 | Traceback (most recent call last):
lms_1 | File “/openedx/venv/lib/python3.8/site-packages/django/core/handlers/exception.py”, line 47, in inner
lms_1 | response = get_response(request)
lms_1 | File “/openedx/venv/lib/python3.8/site-packages/django/core/handlers/base.py”, line 181, in _get_response
lms_1 | response = wrapped_callback(request, *callback_args, **callback_kwargs)
lms_1 | File “/opt/pyenv/versions/3.8.12/lib/python3.8/contextlib.py”, line 75, in inner
lms_1 | return func(*args, **kwds)
lms_1 | File “/openedx/venv/lib/python3.8/site-packages/django/utils/decorators.py”, line 130, in _wrapped_view
lms_1 | response = view_func(request, *args, **kwargs)
lms_1 | File “/openedx/venv/lib/python3.8/site-packages/django/views/decorators/cache.py”, line 44, in _wrapped_view_func
lms_1 | response = view_func(request, *args, **kwargs)
lms_1 | File “/openedx/venv/lib/python3.8/site-packages/django/contrib/admin/sites.py”, line 232, in inner
lms_1 | return view(request, *args, **kwargs)
lms_1 | File “/openedx/venv/lib/python3.8/site-packages/django/views/generic/base.py”, line 70, in view
lms_1 | return self.dispatch(request, *args, **kwargs)
lms_1 | File “/openedx/venv/lib/python3.8/site-packages/django/views/generic/base.py”, line 98, in dispatch
lms_1 | return handler(request, *args, **kwargs)
lms_1 | File “/openedx/venv/lib/python3.8/site-packages/enterprise/admin/views.py”, line 744, in post
lms_1 | if manage_learners_form.is_valid():
lms_1 | File “/openedx/venv/lib/python3.8/site-packages/django/forms/forms.py”, line 175, in is_valid
lms_1 | return self.is_bound and not self.errors
lms_1 | File “/openedx/venv/lib/python3.8/site-packages/django/forms/forms.py”, line 170, in errors
lms_1 | self.full_clean()
lms_1 | File “/openedx/venv/lib/python3.8/site-packages/django/forms/forms.py”, line 372, in full_clean
lms_1 | self._clean_fields()
lms_1 | File “/openedx/venv/lib/python3.8/site-packages/django/forms/forms.py”, line 393, in clean_fields
lms_1 | value = getattr(self, 'clean
%s’ % name)()
lms_1 | File “/openedx/venv/lib/python3.8/site-packages/enterprise/admin/forms.py”, line 206, in clean_course
lms_1 | course_details = utils.validate_course_exists_for_enterprise(enterprise_customer, course_id)
lms_1 | File “/openedx/venv/lib/python3.8/site-packages/enterprise/utils.py”, line 2234, in validate_course_exists_for_enterprise
lms_1 | if not enterprise_customer.catalog_contains_course(course_id):
lms_1 | File “/openedx/venv/lib/python3.8/site-packages/enterprise/models.py”, line 615, in catalog_contains_course
lms_1 | if EnterpriseCatalogApiClient().enterprise_contains_content_items(self.uuid, [course_run_id]):
lms_1 | File “/openedx/venv/lib/python3.8/site-packages/enterprise/api_client/lms.py”, line 100, in inner
lms_1 | return func(self, *args, **kwargs)
lms_1 | File “/openedx/venv/lib/python3.8/site-packages/enterprise/api_client/enterprise_catalog.py”, line 294, in enterprise_contains_content_items
lms_1 | return endpoint.contains_content_items.get(**query_params)[‘contains_content_items’]
lms_1 | File “/openedx/venv/lib/python3.8/site-packages/slumber/init.py”, line 155, in get
lms_1 | resp = self._request(“GET”, params=kwargs)
lms_1 | File “/openedx/venv/lib/python3.8/site-packages/slumber/init.py”, line 97, in _request
lms_1 | resp = self._store[“session”].request(method, url, data=data, params=params, files=files, headers=headers)
lms_1 | File “/openedx/venv/lib/python3.8/site-packages/requests/sessions.py”, line 529, in request
lms_1 | resp = self.send(prep, **send_kwargs)
lms_1 | File “/openedx/venv/lib/python3.8/site-packages/requests/sessions.py”, line 645, in send
lms_1 | r = adapter.send(request, **kwargs)
lms_1 | File “/openedx/venv/lib/python3.8/site-packages/requests/adapters.py”, line 519, in send
lms_1 | raise ConnectionError(e, request=request)
lms_1 | requests.exceptions.ConnectionError: HTTPConnectionPool(host=‘enterprise.catalog.app’, port=18160): Max retries exceeded with url: /api/v1/enterprise-customer/4c70b45d-565c-4c2e-9b8d-1f36e544d2d1/contains_content_items/?course_run_ids=course-v1%3ALITHAN%2BADP%2BADP-IN0920-26NOV2021 (Caused by NewConnectionError(‘<urllib3.connection.HTTPConnection object at 0x7f5c09085f10>: Failed to establish a new connection: [Errno -2] Name or service not known’))
lms_1 | [pid: 7|app: 0|req: 1/2] 172.20.0.6 () {66 vars in 3993 bytes} [Tue Dec 27 07:28:14 2022] POST /admin/enterprise/enterprisecustomer/4c70b45d-565c-4c2e-9b8d-1f36e544d2d1/manage_learners => generated 12351 bytes in 1516 msecs (HTTP/1.1 500) 8 headers in 574 bytes (1 switches on core 0)

Any pointers or help identifying the issue is appreciated.

Thanks & Regards
Sahil

hello there ,
unfortunately, you need to install a new plugin called enterprise catalog!

there no much documentation regarding this service! to my understanding, they are trying to migrate the enterprise to stand alone outside of openedx instance! I’m currently in the process of trying to figure out its configuration! however please note what I figured out in these past weeks :
you need to add a new subdomain running the new service for example: enterprise-catalog.example.com
be careful with the docker-compose file ! as you need to run the containers by yourself (tutor scripts will bring them down whenever you try : tutor local start -d or launch (quickstart))
the new containers must have the same project name as the lms/cms/discovery etc there will be an os environment variable holding this name if i remember it will be: tutor_local
or the containers will not simply see/talk to each others .
in order to add a new subdomain you need to locate the caddy file located in the .local/share/tutor/env/apps/caddy/Caddyfile and add an entry for the new subdomain ( a simple restart all will do the trick of updating the caddy container )
you need to add ENTERPRISE_CATALOG_INTERNAL_ROOT_URL to your lms config file