Problem with ecommerce and hawthorn

179 views
Skip to first unread message

mmir...@quoma.com.ar

unread,
Oct 1, 2018, 3:44:36 PM10/1/18
to General Open edX discussion
I have some problems with the ecommerce and the version hawthorn. When I tried to created a course I obtain the error: "Error! Failed to publish commerce data for course-v1:edX+Test+Test_Course to LMS."

Logs (/edx/var/log/ecommerce/edx.log):

Oct  1 19:21:35 ip-172-31-17-48 [service_variant=ecommerce][django.request] WARNING [ip-172-31-17-48  17912] [/edx/app/ecommerce/venvs/ecommerce/local/lib/python2.7/site-packages/django/core/handlers/base.py:152] - Not Found: /api/v2/courses/course-v1:edX+Test+Test_Course/
Oct  1 19:21:35 ip-172-31-17-48 [service_variant=ecommerce][django.request] WARNING [ip-172-31-17-48  17912] [/edx/app/ecommerce/venvs/ecommerce/local/lib/python2.7/site-packages/django/core/handlers/base.py:152] - Not Found: /api/v2/courses/course-v1:edX+Test+Test_Course/
Oct  1 19:21:35 ip-172-31-17-48 [service_variant=ecommerce][django.request] WARNING [ip-172-31-17-48  17912] [/edx/app/ecommerce/venvs/ecommerce/local/lib/python2.7/site-packages/django/core/handlers/base.py:152] - Not Found: /api/v2/courses/course-v1:edX+Test+Test_Course/
Oct  1 19:21:35 ip-172-31-17-48 [service_variant=ecommerce][ecommerce.courses.models] INFO [ip-172-31-17-48  17912] [/edx/app/ecommerce/ecommerce/ecommerce/courses/models.py:216] - Course seat product with certificate type [] for [course-v1:edX+Test+Test_Course] does not exist. Instantiated a new instance.
Oct  1 19:21:35 ip-172-31-17-48 [service_variant=ecommerce][ecommerce.courses.models] INFO [ip-172-31-17-48  17912] [/edx/app/ecommerce/ecommerce/ecommerce/courses/models.py:258] - Course seat product stock record with certificate type [] for [course-v1:edX+Test+Test_Course] does not exist. Instantiated a new instance.
Oct  1 19:21:35 ip-172-31-17-48 [service_variant=ecommerce][ecommerce.courses.models] INFO [ip-172-31-17-48  17912] [/edx/app/ecommerce/ecommerce/ecommerce/courses/models.py:216] - Course seat product with certificate type [verified] for [course-v1:edX+Test+Test_Course] does not exist. Instantiated a new instance.
Oct  1 19:21:35 ip-172-31-17-48 [service_variant=ecommerce][ecommerce.courses.models] INFO [ip-172-31-17-48  17912] [/edx/app/ecommerce/ecommerce/ecommerce/courses/models.py:258] - Course seat product stock record with certificate type [verified] for [course-v1:edX+Test+Test_Course] does not exist. Instantiated a new instance.
Oct  1 19:21:35 ip-172-31-17-48 [service_variant=ecommerce][ecommerce.courses.publishers] ERROR [ip-172-31-17-48  17912] [/edx/app/ecommerce/ecommerce/ecommerce/courses/publishers.py:112] - Failed to publish commerce data for [course-v1:edX+Test+Test_Course] to LMS.
Traceback (most recent call last):
  File "/edx/app/ecommerce/ecommerce/ecommerce/courses/publishers.py", line 100, in publish
    commerce_api_client = course.site.siteconfiguration.commerce_api_client
  File "/edx/app/ecommerce/venvs/ecommerce/local/lib/python2.7/site-packages/django/utils/functional.py", line 35, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/edx/app/ecommerce/ecommerce/ecommerce/core/models.py", line 430, in commerce_api_client
    return EdxRestApiClient(self.build_lms_url('/api/commerce/v1/'), jwt=self.access_token)
  File "/edx/app/ecommerce/ecommerce/ecommerce/core/models.py", line 377, in access_token
    token_type='jwt'
  File "/edx/app/ecommerce/venvs/ecommerce/local/lib/python2.7/site-packages/edx_rest_api_client/client.py", line 36, in get_oauth_access_token
    data = response.json()
  File "/edx/app/ecommerce/venvs/ecommerce/local/lib/python2.7/site-packages/requests/models.py", line 894, in json
    return complexjson.loads(self.text, **kwargs)
  File "/edx/app/ecommerce/venvs/ecommerce/local/lib/python2.7/site-packages/simplejson/__init__.py", line 518, in loads
    return _default_decoder.decode(s)
  File "/edx/app/ecommerce/venvs/ecommerce/local/lib/python2.7/site-packages/simplejson/decoder.py", line 370, in decode
    obj, end = self.raw_decode(s)
  File "/edx/app/ecommerce/venvs/ecommerce/local/lib/python2.7/site-packages/simplejson/decoder.py", line 377, in raw_decode
    """Decode a JSON document from ``s`` (a ``str`` or ``unicode``
NameError: global name 'logger' is not defined
Oct  1 19:21:35 ip-172-31-17-48 [service_variant=ecommerce][ecommerce.extensions.api.serializers] ERROR [ip-172-31-17-48  17912] [/edx/app/ecommerce/ecommerce/ecommerce/extensions/api/serializers.py:497] - Failed to save and publish [course-v1:edX+Test+Test_Course]: [Failed to publish commerce data for course-v1:edX+Test+Test_Course to LMS.]
Traceback (most recent call last):
  File "/edx/app/ecommerce/ecommerce/ecommerce/extensions/api/serializers.py", line 494, in save
    raise Exception(resp_message)
Exception: Failed to publish commerce data for course-v1:edX+Test+Test_Course to LMS.

Could someone help me in this regard?

Thanks

mmir...@quoma.com.ar

unread,
Oct 1, 2018, 3:56:37 PM10/1/18
to General Open edX discussion
Hi,
I tried with the release hawthorn.1 and hawthorn.2.

kritika arora

unread,
Oct 7, 2018, 8:34:18 AM10/7/18
to General Open edX discussion
I want to enable course talk / reviews widget in eucalyptus version can anyone help me regarding this

Sreedhar Valluru

unread,
Jan 14, 2019, 6:19:27 AM1/14/19
to General Open edX discussion
Hi There


are you able to solve this issue, i am also facing same issue, if you have solution please share @sridhar...@gmail.com

Thanks
Sreedhar

Şükrü Kocakaya

unread,
Jul 9, 2019, 8:03:24 AM7/9/19
to General Open edX discussion
Hi All,

I'm dealing with the same problem. Dİd you find  a solution for this?

Josh McLaughlin

unread,
Jul 10, 2019, 7:05:02 AM7/10/19
to General Open edX discussion
Hello,
    How did you setup your Site Configuration and OIDC integration with ecommerce?
This is a guide for configuring with the devstack, but similar steps can be taken on a live instance:
https://edx.readthedocs.io/projects/edx-installing-configuring-and-running/en/latest/ecommerce/install_ecommerce.html#configure-edx-openid-connect-oidc

It looks as though there could be an authentication failure when ecommerce attempts to connect to the LMS. Getting these credentials to work can be a bit tricky.
You'll want to make sure that the keys in this section match the keys in the LMS:
https://edx.readthedocs.io/projects/edx-installing-configuring-and-running/en/latest/ecommerce/install_ecommerce.html#configure-a-site-partner-and-site-configuration

You'll also want to make sure that the OIDC user has permissions required for ecommerce. You can use a staff or superuser to test that these permissions aren't the issue.

Thanks,
    -Josh
Reply all
Reply to author
Forward
0 new messages