Unable to import edX.org course into Dogwood.3

297 views
Skip to first unread message

Aparna P

unread,
Jun 29, 2016, 6:42:16 AM6/29/16
to General Open edX discussion
Hi,
On importing my course from edx.org onto a local development Dogwood.3 server, at the "Updating Course" stage, I am getting the following error:

Updating Course

There was an error while importing the new course to our database. 'NoneType' object has no attribute 'data_dir'


Has anyone encountered this?
Thanks,
Aparna

cdodg...@gmail.com

unread,
Jun 29, 2016, 1:54:05 PM6/29/16
to General Open edX discussion
Hi Aparna,

Could you look in your console/logs inside your local development and see if you can find the full stack trace around this error? That would be helpful in debuging this for you.

- Chris

Peter Pinch

unread,
Jun 29, 2016, 4:16:41 PM6/29/16
to edx-...@googlegroups.com
I suspect this is the same issue as described in https://openedx.atlassian.net/browse/ECOM-4409

If it is, you would see a message about an `InvalidTabsException` in your servers logs. 

It would be super helpful if you could add some steps to reproduce in on the JIRA ticket, because the original case that I reported doesn't exhibit error any more. 

- Peter



--
You received this message because you are subscribed to the Google Groups "General Open edX discussion" group.
To view this discussion on the web visit https://groups.google.com/d/msgid/edx-code/8fa119dd-6fe1-4c00-9cd6-d48c5ccd594b%40googlegroups.com.

Aparna P

unread,
Jun 30, 2016, 6:30:51 AM6/30/16
to General Open edX discussion
Hi,

Here is the error seen in /edx/var/log/cms/edx.log
-------------
Traceback (most recent call last):
  File "/edx/app/edxapp/edx-platform/common/lib/xmodule/xmodule/modulestore/xml.py", line 402, in try_load_course
    course_descriptor = self.load_course(course_dir, course_ids, errorlog.tracker, target_course_id)
  File "/edx/app/edxapp/edx-platform/common/lib/xmodule/xmodule/modulestore/xml.py", line 576, in load_course
    course_descriptor = system.process_xml(etree.tostring(course_data, encoding='unicode'))
  File "/edx/app/edxapp/edx-platform/common/lib/xmodule/xmodule/modulestore/xml.py", line 196, in process_xml
    id_manager,
  File "/edx/app/edxapp/edx-platform/common/lib/xmodule/xmodule/x_module.py", line 1508, in xblock_from_node
    block = block_class.parse_xml(node, self, keys, id_generator)
  File "/edx/app/edxapp/edx-platform/common/lib/xmodule/xmodule/xml_module.py", line 516, in parse_xml
    return super(XmlParserMixin, cls).parse_xml(node, runtime, keys, id_generator)  # pylint: disable=bad-super-call
  File "/edx/app/edxapp/edx-platform/common/lib/xmodule/xmodule/x_module.py", line 1027, in parse_xml
    block = cls.from_xml(xml, runtime, id_generator)
  File "/edx/app/edxapp/edx-platform/common/lib/xmodule/xmodule/course_module.py", line 1019, in from_xml
    instance = super(CourseDescriptor, cls).from_xml(xml_data, system, id_generator)
  File "/edx/app/edxapp/edx-platform/common/lib/xmodule/xmodule/xml_module.py", line 505, in from_xml
    id_generator,
  File "/edx/app/edxapp/edx-platform/common/lib/xmodule/xmodule/xml_module.py", line 389, in parse_xml
    field_data,
  File "/edx/app/edxapp/venvs/edxapp/src/xblock/xblock/runtime.py", line 635, in construct_xblock_from_class
    *args, **kwargs
  File "/edx/app/edxapp/edx-platform/common/lib/xmodule/xmodule/course_module.py", line 968, in __init__
    if not getattr(self, "tabs", []):
  File "/edx/app/edxapp/venvs/edxapp/src/xblock/xblock/fields.py", line 474, in __get__
    value = self.from_json(field_data.get(xblock, self.name))
  File "/edx/app/edxapp/edx-platform/common/lib/xmodule/xmodule/tabs.py", line 459, in from_json
    self.validate_tabs(values)
  File "/edx/app/edxapp/edx-platform/common/lib/xmodule/xmodule/tabs.py", line 412, in validate_tabs
    "Expected first tab to have type 'courseware'.  tabs: '{0}'".format(tabs))
-----------
It does look the tab of type "courseware" is expected before "course_info". However, on edx.org(and edge.edx.org), the default order is "course_info" followed by "courseware" and there is no way to reorder these two tabs(other tabs such as Wiki and user-added pages can be reordered). So there seems to be no way to resolve this except to make a code change. On Dogwood.3 as well as Cypress, the order is "courseware" followed by "course_info".

Is there a way to avoid the code fix?
Thanks!
Aparna

Peter Pinch

unread,
Jun 30, 2016, 6:56:10 AM6/30/16
to edx-...@googlegroups.com
It’s pretty easy to edit the exported course. You just need to untar/unzip it, edit the policy.json file, and then tar/gzip it again. 

In the policy.json you just need to change the order of the tabs so that courseware is first. 

If you need more details, let me know (you can also try to find me on Slack).

Can I confirm that you encountered this problem when you exported a course from edx.org and then imported it into a dogwood devstack? 

Thanks,
Peter

Aparna P

unread,
Jul 1, 2016, 5:51:58 AM7/1/16
to General Open edX discussion
Thanks, Peter.
We were able to do this and needed confirmation that this was the 'right' way to do it.

Thanks again!
Aparna
Reply all
Reply to author
Forward
0 new messages