Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete courses #81

Closed
planesticud opened this issue Oct 11, 2018 · 5 comments

Comments

Projects
None yet
3 participants
@planesticud
Copy link

commented Oct 11, 2018

Hi, I am trying to delete a courses using this:

openedx@84c4dcdf0fb2:~/edx-platform$ ./manage.py cms --settings=aws delete_orphans course-v1:UD+001+208_3/about   

but show this:

Traceback (most recent call last):
  File "./manage.py", line 118, in <module>
    startup.run()
  File "/openedx/edx-platform/cms/startup.py", line 19, in run
    django.setup()
  File "/usr/local/lib/python2.7/dist-packages/django/__init__.py", line 22, in setup
    configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
  File "/usr/local/lib/python2.7/dist-packages/django/utils/log.py", line 75, in configure_logging
    logging_config_func(logging_settings)
  File "/usr/lib/python2.7/logging/config.py", line 794, in dictConfig
    dictConfigClass(config).configure()
  File "/usr/lib/python2.7/logging/config.py", line 576, in configure
    '%r: %s' % (name, e))
ValueError: Unable to configure handler 'local': [Errno 2] No such file or directory

Thank you for your help.

@regisb

This comment has been minimized.

Copy link
Owner

commented Oct 11, 2018

You should probably not use aws settings: as the name implies, they are made to run AWS, not inside a docker container.

Try instead to run without specifying the settings, which should be picked up from the DJANGO_SETTINGS_MODULE environment variable:

./manage.py cms delete_orphans course-v1:UD+001+208_3/about
@planesticud

This comment has been minimized.

Copy link
Author

commented Oct 11, 2018

Thank you very much
I could do it, whit this

 ./manage.py cms delete_course course-v1:edX+DemoX+Demo_Course
@regisb

This comment has been minimized.

Copy link
Owner

commented Oct 12, 2018

Good job! 👍

@regisb regisb closed this Oct 12, 2018

@crivet

This comment has been minimized.

Copy link

commented May 21, 2019

is this still the accepted solution for deleting a course? if so could I get a little more description on the process?

in attempting to replicate this (tutor v3.3.4, and running a custom fork of the edx-platform branched from ironwood.master) :

  • i've started up portainer to gain access to the running containers
  • connected to both the lms & cms containers respectively attempting to run the delete_course command, but regardless when attempting to perform the described action am greeted by the following:

command:
root@ab2c0efec7f6:/openedx/edx-platform# ./manage.py cms delete_course course-v1:testing+1+2019

output:

Traceback (most recent call last):
  File "./manage.py", line 123, in <module>
    execute_from_command_line([sys.argv[0]] + django_args)
  File "/openedx/venv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
    utility.execute()
  File "/openedx/venv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 356, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/openedx/venv/local/lib/python2.7/site-packages/django/core/management/base.py",line 283, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/openedx/venv/local/lib/python2.7/site-packages/django/core/management/base.py",line 330, in execute
    output = self.handle(*args, **options)
  File "/openedx/edx-platform/cms/djangoapps/contentstore/management/commands/delete_course.py", line 69, in handle
    if not modulestore().get_course(course_key):
  File "/openedx/edx-platform/common/lib/xmodule/xmodule/modulestore/django.py", line 316, in modulestore
    settings.MODULESTORE['default'].get('OPTIONS', {})
  File "/openedx/edx-platform/common/lib/xmodule/xmodule/modulestore/django.py", line 298, in create_modulestore_instance
    **_options
  File "/openedx/edx-platform/common/lib/xmodule/xmodule/modulestore/mixed.py", line 176, in __init__
    signal_handler=signal_handler,
  File "/openedx/edx-platform/common/lib/xmodule/xmodule/modulestore/django.py", line 298, in create_modulestore_instance
    **_options
  File "/openedx/edx-platform/common/lib/xmodule/xmodule/modulestore/split_mongo/split.py", line 707, in __init__
    self.db_connection = MongoConnection(**doc_store_config)
  File "/openedx/edx-platform/common/lib/xmodule/xmodule/modulestore/split_mongo/mongo_connection.py", line 278, in __init__
    retry_wait_time=retry_wait_time, **kwargs
  File "/openedx/edx-platform/common/lib/xmodule/xmodule/mongo_utils.py", line 50, in connect_to_mongodb
    **kwargs
  File "/openedx/venv/local/lib/python2.7/site-packages/pymongo/mongo_client.py", line 425, in __init__
    raise ConnectionFailure(str(e))
pymongo.errors.ConnectionFailure: [Errno 111] Connection refused

I've attempted to run this command from the following containers:

  • tutor_local_lms_1
  • tutor_local_cms_1
  • tutor_local_lms_worker_1
  • tutor_local_cms_worker_1

Additionally, I've tried activating the virtual environment before performing the operation as well.

I'm assuming this has something to do with how i'm attempting to perform the operation, would it be possible to get a little more detail as to how this is expected to be run?

@regisb

This comment has been minimized.

Copy link
Owner

commented May 22, 2019

@crivet This is a different issue than the original one. Would you mind creating a new topic on the discussion forums? https://discuss.overhang.io/
It should work from the tutor_local_cms_1 container. It looks like the mongodb container cannot be reached. Please verify that the mongodb container is up and running.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.