openedx / edx-platform

The Open edX LMS & Studio, powering education sites around the world!
https://openedx.org
GNU Affero General Public License v3.0
7.47k stars 3.89k forks source link

Paver update_db is busted #32252

Closed robrap closed 9 months ago

robrap commented 1 year ago

Using paver update_db gives the following:

root@lms:/edx/app/edxapp/edx-platform# paver update_db
---> pavelib.servers.update_db
---> pavelib.prereqs.install_prereqs
---> pavelib.prereqs.install_node_prereqs
Node prereqs unchanged, skipping...
---> pavelib.prereqs.install_python_prereqs
---> pavelib.prereqs.uninstall_python_packages
NO_PYTHON_UNINSTALL is set. No attempts will be made to uninstall old Python libs.
Python prereqs unchanged, skipping...
pip freeze > /edx/app/edxapp/edx-platform/test_root/log/pip_freeze.log
********************************************************************************
* WARNING: Mac users should run this from both the lms and studio shells
* in docker devstack to avoid startup errors that kill your CPU.
* For more details, see:
* https://github.com/openedx/devstack#docker-is-using-lots-of-cpu-time-when-it-should-be-idle
********************************************************************************
NO_EDXAPP_SUDO=1 EDX_PLATFORM_SETTINGS_OVERRIDE=devstack_docker /edx/bin/edxapp-migrate-lms --traceback --pythonpath=. 
/bin/sh: 1: /edx/bin/edxapp-migrate-lms: not found

Captured Task Output:
---------------------

---> pavelib.servers.update_db
---> pavelib.prereqs.install_prereqs
---> pavelib.prereqs.install_node_prereqs
---> pavelib.prereqs.install_python_prereqs
---> pavelib.prereqs.uninstall_python_packages
pip freeze > /edx/app/edxapp/edx-platform/test_root/log/pip_freeze.log
NO_EDXAPP_SUDO=1 EDX_PLATFORM_SETTINGS_OVERRIDE=devstack_docker /edx/bin/edxapp-migrate-lms --traceback --pythonpath=. 

Build failed running pavelib.servers.update_db: Subprocess return code: 127

Multiple people have seen this. A workaround seems to be to run make dev.migrate.lms in devstack, and/or what that runs, which doesn't seem to be paver.

There is no DEPR for paver, but should there be? Should this be removed and docs updated, rather than fixing? Not sure, but we probably shouldn't leave this broken.

kdmccormick commented 1 year ago

(I'm not working actively on Devstack, but I have some leftover context)

/edx/bin/edxapp-migrate-lms was a trivial wrapper around ./manage.py lms migrate that existed on the Ansible-based images. Any remaining Ansible-based deployments probably still use it. My intuition is that the script was provided as an abstraction around migration in case it ever happend that ./manage.py ... migrate wasn't sufficient; AFAICT that never happened.

I am guessing that this error is happening because the new Ansible-free edx-platform images don't include that wrapper script. So, one solution would be to add /edx/bin/edxapp-migrate-lms to the Ansible-free edx-platform image.

Another solution (and my recommendation) is to deprecate paver update_db, since neither Tutor nor Devstack need it. For backwards compatibility for Ansible deployers, openedx/configuration could be updated to use ./manage.py ... migrate instead of paver.

Regarding general deprecation of Paver: paver update_assets is being deprecated, and the remaining edx-platform Paver commands strike me as trivial and/or unused.

robrap commented 1 year ago

Would it make sense to add migrate to the Makefile to better match other services and the cookiecutter? https://github.com/openedx/edx-cookiecutters/blob/7fdf208c0844cdbdeeb6234df16d29a6af11a41c/cookiecutter-django-ida/%7B%7Bcookiecutter.repo_name%7D%7D/Makefile#L88-L89

kdmccormick commented 1 year ago

I'm supportive of it!

robrap commented 1 year ago

Possibly this ticket should be moved to a DEPR for paver update_db.

robrap commented 1 year ago

The DEPR has been created here: https://github.com/openedx/edx-platform/issues/32683

kdmccormick commented 9 months ago

Closed per https://github.com/openedx/edx-platform/issues/32683