Hi
I’m trying to install AWX in a K8s cluster but i get the following error:
TASK [kubernetes : Migrate database] *******************************************
fatal: [localhost]: FAILED! => {“changed”: true, “cmd”: “kubectl -n awx exec ansible-tower-management – bash -c "awx-manage migrate --noinput"”, “delta”: “0:00:03.199232”, “end”: “2019-03-22 11:05:05.014685”, “msg”: “non-zero return code”, “rc”: 1, “start”: “2019-03-22 11:05:01.815453”, “stderr”: “Traceback (most recent call last):\n File "/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/db/utils.py", line 115, in load_backend\n return import_module(‘%s.base’ % backend_name)\n File "/usr/lib64/python3.6/importlib/init.py", line 126, in import_module\n return _bootstrap._gcd_import(name[level:], package, level)\n File "", line 994, in _gcd_import\n File "", line 971, in _find_and_load\n File "", line 941, in _find_and_load_unlocked\n File "", line 219, in _call_with_frames_removed\n File "", line 994, in _gcd_import\n File "", line 971, in _find_and_load\n File "", line 941, in _find_and_load_unlocked\n File "", line 219, in _call_with_frames_removed\n File "", line 994, in _gcd_import\n File "", line 971, in _find_and_load\n File "", line 953, in _find_and_load_unlocked\nModuleNotFoundError: No module named ‘awx.main.db’\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File "/usr/bin/awx-manage", line 11, in \n load_entry_point(‘awx==3.0.1.0’, ‘console_scripts’, ‘awx-manage’)()\n File "/var/lib/awx/venv/awx/lib64/python3.6/site-packages/awx/init.py", line 140, in manage\n execute_from_command_line(sys.argv)\n File "/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/core/management/init.py", line 364, in execute_from_command_line\n utility.execute()\n File "/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/core/management/init.py", line 338, in execute\n django.setup()\n File "/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/init.py", line 27, in setup\n apps.populate(settings.INSTALLED_APPS)\n File "/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/apps/registry.py", line 108, in populate\n app_config.import_models()\n File "/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/apps/config.py", line 202, in import_models\n self.models_module = import_module(models_module_name)\n File "/usr/lib64/python3.6/importlib/init.py", line 126, in import_module\n return _bootstrap._gcd_import(name[level:], package, level)\n File "", line 994, in _gcd_import\n File "", line 971, in _find_and_load\n File "", line 955, in _find_and_load_unlocked\n File "", line 665, in _load_unlocked\n File "", line 678, in exec_module\n File "", line 219, in _call_with_frames_removed\n File "/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/contrib/auth/models.py", line 4, in \n from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager\n File "/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/contrib/auth/base_user.py", line 52, in \n class AbstractBaseUser(models.Model):\n File "/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/db/models/base.py", line 124, in new\n new_class.add_to_class(‘_meta’, Options(meta, app_label))\n File "/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/db/models/base.py", line 325, in add_to_class\n value.contribute_to_class(cls, name)\n File "/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/db/models/options.py", line 214, in contribute_to_class\n self.db_table = truncate_name(self.db_table, connection.ops.max_name_length())\n File "/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/db/init.py", line 33, in getattr\n return getattr(connections[DEFAULT_DB_ALIAS], item)\n File "/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/db/utils.py", line 211, in getitem\n backend = load_backend(db[‘ENGINE’])\n File "/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/db/utils.py", line 134, in load_backend\n raise ImproperlyConfigured(error_msg)\ndjango.core.exceptions.ImproperlyConfigured: ‘awx.main.db.profiled_pg’ isn’t an available database backend.\nTry using ‘django.db.backends.XXX’, where XXX is one of:\n ‘mysql’, ‘oracle’, ‘postgresql’, ‘sqlite3’\nError was: No module named ‘awx.main.db’\ncommand terminated with exit code 1”, “stderr_lines”: [“Traceback (most recent call last):”, " File "/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/db/utils.py", line 115, in load_backend", " return import_module(‘%s.base’ % backend_name)“, " File "/usr/lib64/python3.6/importlib/init.py", line 126, in import_module”, " return _bootstrap._gcd_import(name[level:], package, level)“, " File "", line 994, in _gcd_import”, " File "", line 971, in _find_and_load", " File "", line 941, in _find_and_load_unlocked", " File "", line 219, in _call_with_frames_removed", " File "", line 994, in _gcd_import", " File "", line 971, in _find_and_load", " File "", line 941, in _find_and_load_unlocked", " File "", line 219, in _call_with_frames_removed", " File "", line 994, in _gcd_import", " File "", line 971, in _find_and_load", " File "", line 953, in _find_and_load_unlocked", “ModuleNotFoundError: No module named ‘awx.main.db’”, “”, “During handling of the above exception, another exception occurred:”, “”, “Traceback (most recent call last):”, " File "/usr/bin/awx-manage", line 11, in “, " load_entry_point(‘awx==3.0.1.0’, ‘console_scripts’, ‘awx-manage’)()”, " File "/var/lib/awx/venv/awx/lib64/python3.6/site-packages/awx/init.py", line 140, in manage", " execute_from_command_line(sys.argv)“, " File "/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/core/management/init.py", line 364, in execute_from_command_line”, " utility.execute()“, " File "/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/core/management/init.py", line 338, in execute”, " django.setup()“, " File "/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/init.py", line 27, in setup”, " apps.populate(settings.INSTALLED_APPS)“, " File "/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/apps/registry.py", line 108, in populate”, " app_config.import_models()“, " File "/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/apps/config.py", line 202, in import_models”, " self.models_module = import_module(models_module_name)“, " File "/usr/lib64/python3.6/importlib/init.py", line 126, in import_module”, " return _bootstrap._gcd_import(name[level:], package, level)“, " File "", line 994, in _gcd_import”, " File "", line 971, in _find_and_load", " File "", line 955, in _find_and_load_unlocked", " File "", line 665, in _load_unlocked", " File "", line 678, in exec_module", " File "", line 219, in _call_with_frames_removed", " File "/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/contrib/auth/models.py", line 4, in “, " from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager”, " File "/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/contrib/auth/base_user.py", line 52, in “, " class AbstractBaseUser(models.Model):”, " File "/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/db/models/base.py", line 124, in new", " new_class.add_to_class(‘_meta’, Options(meta, app_label))“, " File "/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/db/models/base.py", line 325, in add_to_class”, " value.contribute_to_class(cls, name)“, " File "/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/db/models/options.py", line 214, in contribute_to_class”, " self.db_table = truncate_name(self.db_table, connection.ops.max_name_length())“, " File "/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/db/init.py", line 33, in getattr”, " return getattr(connections[DEFAULT_DB_ALIAS], item)“, " File "/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/db/utils.py", line 211, in getitem”, " backend = load_backend(db[‘ENGINE’])“, " File "/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/db/utils.py", line 134, in load_backend”, " raise ImproperlyConfigured(error_msg)“, “django.core.exceptions.ImproperlyConfigured: ‘awx.main.db.profiled_pg’ isn’t an available database backend.”, “Try using ‘django.db.backends.XXX’, where XXX is one of:”, " ‘mysql’, ‘oracle’, ‘postgresql’, ‘sqlite3’”, “Error was: No module named ‘awx.main.db’”, “command terminated with exit code 1”], “stdout”: “”, “stdout_lines”: }
PLAY RECAP *********************************************************************
localhost : ok=21 changed=9 unreachable=0 failed=1
The Pods in my awx namespace are:
NAME READY STATUS RESTARTS AGE
ansible-tower-management 1/1 Running 0 21m
awx-0 4/4 Running 0 21m
awx-postgresql-postgresql-0 0/1 Pending 0 22m
then I display the evento of the postgress pod an I get:
Events:
Type Reason Age From Message
Warning FailedScheduling 2m28s (x31 over 17m) default-scheduler pod has unbound immediate PersistentVolumeClaims
Finally my inventory file only have these lines uncommented:
localhost ansible_connection=local ansible_python_interpreter=“/usr/bin/env python”
[all:vars]
dockerhub_base=ansible
kubernetes_context=awx-context
kubernetes_namespace=awx
tiller_namespace=kube-system
awx_task_hostname=awx
awx_web_hostname=awxweb
postgres_data_dir=/tmp/pgdocker
host_port=80
docker_compose_dir=/var/lib/awx
pg_username=awx
pg_password=awxpass
pg_database=awx
pg_port=5432
rabbitmq_password=awxpass
rabbitmq_erlang_cookie=cookiemonster
admin_user=admin
admin_password=Passw0rd
create_preload_data=False
secret_key=awxsecret
awx_alternate_dns_servers=“4.2.2.1,4.2.2.2”
project_data_dir=/var/lib/awx/projects
I don’t know what I’m doing bad.
If someone can help me … it will be appreciated.
Michael