Hi,
I tried to redeploy commcareHQ, but failed with the following error message:
A migration must be performed before this environment can be upgraded to the latest version of CommCareHQ. This migration is run using the management command opulate_application_access
/home/cchq/www/echis/releases/2020-01-11_07.11/python_env-3.6/lib/python3.6/site-packages/psycopg2/init.py:144: UserWarning: The psycopg2 wheel package will be renamed from release 2.8; in order to keep installing from binary please use "pip install psycopg2-binary" instead. For details see: http://initd.org/psycopg/docs/install.html#binary-install-from-pypi.
""")
Unknown command: 'populate_application_access'
Type 'manage.py help' for usage.
(ansible) ansible@echis0:~/.commcare-cloud/repo$ cchq echis django-manage opulate_application_access
File "/home/cchq/www/echis/releases/2020-01-11_07.11/corehq/apps/app_manager/fixtures/init.py", line 1, in
from corehq.apps.app_manager.fixtures.mobile_ucr import (
File "/home/cchq/www/echis/releases/2020-01-11_07.11/corehq/apps/app_manager/fixtures/mobile_ucr.py", line 34, in
from corehq.apps.userreports.models import get_report_config
File "/home/cchq/www/echis/releases/2020-01-11_07.11/corehq/apps/userreports/models.py", line 74, in
from corehq.apps.userreports.reports.factory import (
File "/home/cchq/www/echis/releases/2020-01-11_07.11/corehq/apps/userreports/reports/factory.py", line 10, in
from corehq.apps.userreports.reports.specs import (
File "/home/cchq/www/echis/releases/2020-01-11_07.11/corehq/apps/userreports/reports/specs.py", line 18, in
from sqlagg.columns import (
from sqlagg.columns import (
ImportError: cannot import name 'ArrayAggColumn'
Sentry is attempting to send 0 pending error messages
Waiting up to 2 seconds
Running cchq echis django-manage populate_application_access will attempt to run the command on the current release directory, which was created in #1 above, though the command isn't available until #2.
While a deploy can't be completed until the command is run, a more recent release directory can be set up, which should allow for this command to be run.
cchq echis fab setup_limited_release:keep_days=1 --set code_branch=origin/master
Then you can ssh to the django manage machine:
cchq echis ssh django_manage
Navigate to the newly created directory, which should be the most recent timestamp in /home/cchq/www/echis/releases/ (the setup_limited_release command will also output the location of this directory)
Then you can enter the python environment and run the command manually:
Alternatively, you could deploy a commit from after the command was added and before the migration made it mandatory, run cchq echis django-manage populate_application_access, then deploy the latest code. That's more straightforward to describe, but requires two full deploys, and isn't actually any easier in my opinion. Whichever you're more comfortable with should be fine.