muccg/rdrf

Migration error on HSS UAT

Closed this issue · 1 comments

id2359 commented

[he182398a@lxnawc2app0002 cicservices]$ docker exec -it crc bash
ccg-user@crc:~$ django-admin showmigrations
/env/lib/python3.8/site-packages/dash_bootstrap_components/_table.py:5: UserWarning:
The dash_html_components package is deprecated. Please replace
import dash_html_components as html with from dash import html
import dash_html_components as html
Traceback (most recent call last):
File "/env/lib/python3.8/site-packages/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
psycopg2.errors.UndefinedTable: relation "dashboards_visualisationconfig" does not exist
LINE 1: ... "dashboards_visualisationconfig"."position" FROM "dashboard...
^

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/env/bin/django-admin", line 8, in
sys.exit(execute_from_command_line())
File "/env/lib/python3.8/site-packages/django/core/management/init.py", line 419, in execute_from_command_line
utility.execute()
File "/env/lib/python3.8/site-packages/django/core/management/init.py", line 413, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/env/lib/python3.8/site-packages/django/core/management/base.py", line 354, in run_from_argv
self.execute(*args, **cmd_options)
File "/env/lib/python3.8/site-packages/django/core/management/base.py", line 393, in execute
self.check()
File "/env/lib/python3.8/site-packages/django/core/management/base.py", line 419, in check
all_issues = checks.run_checks(
File "/env/lib/python3.8/site-packages/django/core/checks/registry.py", line 76, in run_checks
new_errors = check(app_configs=app_configs, databases=databases)
File "/env/lib/python3.8/site-packages/django/core/checks/urls.py", line 13, in check_url_config
return check_resolver(resolver)
File "/env/lib/python3.8/site-packages/django/core/checks/urls.py", line 23, in check_resolver
return check_method()
File "/env/lib/python3.8/site-packages/django/urls/resolvers.py", line 416, in check
for pattern in self.url_patterns:
File "/env/lib/python3.8/site-packages/django/utils/functional.py", line 48, in get
res = instance.dict[self.name] = self.func(instance)
File "/env/lib/python3.8/site-packages/django/urls/resolvers.py", line 602, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "/env/lib/python3.8/site-packages/django/utils/functional.py", line 48, in get
res = instance.dict[self.name] = self.func(instance)
File "/env/lib/python3.8/site-packages/django/urls/resolvers.py", line 595, in urlconf_module
return import_module(self.urlconf_name)
File "/usr/local/lib/python3.8/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1014, in _gcd_import
File "", line 991, in _find_and_load
File "", line 975, in _find_and_load_unlocked
File "", line 671, in _load_unlocked
File "", line 783, in exec_module
File "", line 219, in _call_with_frames_removed
File "/env/lib/python3.8/site-packages/rdrf/urls.py", line 462, in
re_path(r"^dashboards/", include(("dashboards.urls", "dashboards"))),
File "/env/lib/python3.8/site-packages/django/urls/conf.py", line 34, in include
urlconf_module = import_module(urlconf_module)
File "/usr/local/lib/python3.8/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1014, in _gcd_import
File "", line 991, in _find_and_load
File "", line 975, in _find_and_load_unlocked
File "", line 671, in _load_unlocked
File "", line 783, in exec_module
File "", line 219, in _call_with_frames_removed
File "/env/lib/python3.8/site-packages/dashboards/urls.py", line 7, in
from .dash_apps import single_app, all_app
File "/env/lib/python3.8/site-packages/dashboards/dash_apps.py", line 43, in
if len(single_configs) == 0:
File "/env/lib/python3.8/site-packages/django/db/models/query.py", line 262, in len
self._fetch_all()
File "/env/lib/python3.8/site-packages/django/db/models/query.py", line 1324, in _fetch_all
self._result_cache = list(self._iterable_class(self))
File "/env/lib/python3.8/site-packages/django/db/models/query.py", line 51, in iter
results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)
File "/env/lib/python3.8/site-packages/django/db/models/sql/compiler.py", line 1175, in execute_sql
cursor.execute(sql, params)
File "/env/lib/python3.8/site-packages/django/db/backends/utils.py", line 66, in execute
return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
File "/env/lib/python3.8/site-packages/django/db/backends/utils.py", line 75, in _execute_with_wrappers
return executor(sql, params, many, context)
File "/env/lib/python3.8/site-packages/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
File "/env/lib/python3.8/site-packages/django/db/utils.py", line 90, in exit
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/env/lib/python3.8/site-packages/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
django.db.utils.ProgrammingError: relation "dashboards_visualisationconfig" does not exist
LINE 1: ... "dashboards_visualisationconfig"."position" FROM "dashboard...

id2359 commented

fixed ( worked around) by first loading with SYSTEM_ROLE=CIC_PROMS
( this allows the migrations to run)
and then CIC_CLINICAL

Subsequent releases won;t need this as the migration tables will be populated