Skip to main content

12-awx구동시 AWX Upgrading 무한반복 출력 해결방법

사전작업

  1. AWX 설치 - 6 - AWX 설치절차

발생현상 및 조치방법

  1. AWX 설치 후 웹 UI 접근시 아래메시지창이 수십분이 흘러도 계속 출력함

  2. 컨테이너 로그 확인시 아래메시지 지속 출력
    #> docker logs awx_task
     
    The above exception was the direct cause of the following exception:
     
    Traceback (most recent call last):
      File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/awx/conf/settings.py", line 76, in _ctit_db_wrapper
        yield
      File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/awx/conf/settings.py", line 413, in __getattr__
        value = self._get_local(name)
      File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/awx/conf/settings.py", line 356, in _get_local
        setting = Setting.objects.filter(key=name, user__isnull=True).order_by('pk').first()
      File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/django/db/models/query.py", line 653, in first
        for obj in (self if self.ordered else self.order_by('pk'))[:1]:
      File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/django/db/models/query.py", line 274, in __iter__
        self._fetch_all()
      File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/django/db/models/query.py", line 1242, in _fetch_all
        self._result_cache = list(self._iterable_class(self))
      File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/django/db/models/query.py", line 55, in __iter__
        results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)
      File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/django/db/models/sql/compiler.py", line 1138, in execute_sql
        cursor = self.connection.cursor()
      File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/django/db/backends/base/base.py", line 256, in cursor
        return self._cursor()
      File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/django/db/backends/base/base.py", line 233, in _cursor
        self.ensure_connection()
      File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/django/db/backends/base/base.py", line 217, in ensure_connection
        self.connect()
      File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/django/db/utils.py", line 89, in __exit__
        raise dj_exc_value.with_traceback(traceback) from exc_value
      File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/django/db/backends/base/base.py", line 217, in ensure_connection
        self.connect()
      File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/django/db/backends/base/base.py", line 195, in connect
        self.connection = self.get_new_connection(conn_params)
      File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/django/db/backends/postgresql/base.py", line 178, in get_new_connection
        connection = Database.connect(**conn_params)
      File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/psycopg2/__init__.py", line 126, in connect
        conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
    django.db.utils.OperationalError: could not connect to server: Connection refused
            Is the server running on host "postgres" (172.18.0.2) and accepting
            TCP/IP connections on port 5432?
  3. AWX관련 전체 컨테이너 중지
    #> docker ps -a
    CONTAINER ID        IMAGE                COMMAND                  CREATED             STATUS              PORTS                     NAMES
    33de793adbef        ansible/awx:14.1.0   "/usr/bin/tini -- /u…"   23 minutes ago      Up 23 minutes       8052/tcp                  awx_task
    175225136ee7        ansible/awx:14.1.0   "/usr/bin/tini -- /b…"   23 minutes ago      Up 23 minutes       0.0.0.0:8080->8052/tcp    awx_web
    0ee6f7788971        postgres:10          "docker-entrypoint.s…"   23 minutes ago      Up 23 minutes       0.0.0.0:5432->5432/tcp    awx_postgres
    6a265ef642ec        redis                "docker-entrypoint.s…"   23 minutes ago      Up 23 minutes       6379/tcp                  awx_redis
     
     
    #> docker stop 33de793adbef 175225136ee7 0ee6f7788971 6a265ef642ec
  4. AWX전체 컨테이너 재기동
    #> cd /home/awx/awxcompose
    #> docker-compose up -d
    Creating awx_postgres ... done
    Creating awx_redis    ... done
    Creating awx_web      ... done
    Creating awx_task     ... done
  5. AWX Task 컨테이너 로그 재 확인
    #> docker logs awx_task
    Using /etc/ansible/ansible.cfg as config file
    127.0.0.1 | SUCCESS => {
        "ansible_facts": {
            "discovered_interpreter_python": "/usr/libexec/platform-python"
        },
        "changed": false,
        "elapsed": 0,
        "match_groupdict": {},
        "match_groups": [],
        "path": null,
        "port": 15432,
        "search_regex": null,
        "state": "started"
    }
    Using /etc/ansible/ansible.cfg as config file
    127.0.0.1 | SUCCESS => {
        "ansible_facts": {
            "discovered_interpreter_python": "/usr/libexec/platform-python"
        },
        "changed": false,
        "db": "awx"
    }
    2020-11-24 06:59:48,589 INFO     rbac_migrations Computing role roots..
    2020-11-24 06:59:48,591 INFO     rbac_migrations Found 0 roots in 0.000689 seconds, rebuilding ancestry map
    2020-11-24 06:59:48,591 INFO     rbac_migrations Rebuild ancestors completed in 0.000013 seconds
    2020-11-24 06:59:48,591 INFO     rbac_migrations Done.
    2020-11-24 06:59:52,929 INFO     rbac_migrations Computing role roots..
    2020-11-24 06:59:52,931 INFO     rbac_migrations Found 0 roots in 0.000256 seconds, rebuilding ancestry map
    2020-11-24 06:59:52,931 INFO     rbac_migrations Rebuild ancestors completed in 0.000008 seconds
    2020-11-24 06:59:52,932 INFO     rbac_migrations Done.