Ecommerce - Create new course problem

50 views
Skip to first unread message

ODS_steel

unread,
Jul 24, 2019, 12:29:44 AM7/24/19
to General Open edX discussion
Hi,

I am trying to create a new course on the ecommerce platform but encounter the following error: "Error! Failed to publish commerce data for course-v1:SamsungUni+Sam001+2019Q4 to LMS." (see below for screenshot)

Selection_145.png



I am using ubuntu 16.04 on AWS and ironwood.master (V2).


The ecommerce log outputs indicate the following:


Jul 24 04:11:59 ip-172-31-27-102 [service_variant=ecommerce][ecommerce.courses.publishers] ERROR [ip-172-31-27-102  32431] [/edx/app/ecommerce/ecommerce/ecommerce/courses/publishers.py:112] - Failed to publish commerce data for [course-v1:SamsungUni+Sam001+2019Q4] to LMS.

Traceback (most recent call last):

  File "/edx/app/ecommerce/ecommerce/ecommerce/courses/publishers.py", line 100, in publish

    commerce_api_client = 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 457, 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 384, 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 142, in get_oauth_access_token

    return get_oauth_access_token(url, client_id, client_secret, token_type=token_type)

  File "/edx/app/ecommerce/venvs/ecommerce/local/lib/python2.7/site-packages/edx_rest_api_client/client.py", line 76, in get_oauth_access_token

    data = response.json()

  File "/edx/app/ecommerce/venvs/ecommerce/local/lib/python2.7/site-packages/requests/models.py", line 897, 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 400, in raw_decode

    return self.scan_once(s, idx=_w(s, idx).end())

JSONDecodeError: Expecting value: line 9 column 1 (char 8)

Jul 24 04:11:59 ip-172-31-27-102 [service_variant=ecommerce][ecommerce.extensions.api.serializers] ERROR [ip-172-31-27-102  32431] [/edx/app/ecommerce/ecommerce/ecommerce/extensions/api/serializers.py:585] - Failed to save and publish [course-v1:SamsungUni+Sam001+2019Q4]: [Failed to publish commerce data for course-v1:SamsungUni+Sam001+2019Q4 to LMS.]

Traceback (most recent call last):

  File "/edx/app/ecommerce/ecommerce/ecommerce/extensions/api/serializers.py", line 582, in save

    raise Exception(resp_message)

Exception: Failed to publish commerce data for course-v1:SamsungUni+Sam001+2019Q4 to LMS.






The LMS log outputs indicate the following:


Jul 24 04:24:53 ip-172-31-27-102 [service_variant=lms][openedx.core.djangoapps.catalog.utils][env:sandbox] WARNING [ip-172-31-27-102  32580] [utils.py:103] - Failed to get program UUIDs from the cache for site example.com.




I tried changing the WT_PUBLIC_SIGNING_JWK_SET to null in the lms.env.json and cms.env.json files (as suggested in this post) but it doesn't seem to be working



I set up ecommerce using the installation instructions here


Can anyone suggest any solutions please?


Thanks in advance



ODS_steel

unread,
Jul 29, 2019, 11:54:42 PM7/29/19
to General Open edX discussion
I wonder if it has anything to do with the cache settings in lms.env.json?
Below is a copy of the default settings I have in place. 

Do I need to replace "localhost:11211" with domain.com:11211?


"CACHES": {
        "celery": {
            "BACKEND": "django.core.cache.backends.memcached.MemcachedCache", 
            "KEY_FUNCTION": "util.memcache.safe_key", 
            "KEY_PREFIX": "celery", 
            "LOCATION": [
                "localhost:11211"
            ], 
            "TIMEOUT": "7200"
        }, 
        "configuration": {
            "BACKEND": "django.core.cache.backends.memcached.MemcachedCache", 
            "KEY_FUNCTION": "util.memcache.safe_key", 
            "KEY_PREFIX": "ip-172-31-27-102", 
            "LOCATION": [
                "localhost:11211"
            ]
        }, 
        "course_structure_cache": {
            "BACKEND": "django.core.cache.backends.memcached.MemcachedCache", 
            "KEY_FUNCTION": "util.memcache.safe_key", 
            "KEY_PREFIX": "course_structure", 
            "LOCATION": [
                "localhost:11211"
            ], 
            "TIMEOUT": "7200"
        }, 
        "default": {
            "BACKEND": "django.core.cache.backends.memcached.MemcachedCache", 
            "KEY_FUNCTION": "util.memcache.safe_key", 
            "KEY_PREFIX": "default", 
            "LOCATION": [
                "localhost:11211"
            ], 
Reply all
Reply to author
Forward
0 new messages