Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

local docker: awx_web ws_broadcast doesn't wait for awx_task migrations #7000

Closed
wenottingham opened this issue May 12, 2020 · 1 comment
Closed

Comments

@wenottingham
Copy link
Contributor

ISSUE TYPE
  • Bug Report
SUMMARY

When doing a fresh local docker install, awx_web startup doesn't wait for awx_task to finish migrations. This leads to an extreme amount of error messages, a la:

awx_postgres | 2020-05-12 15:00:26.224 UTC [88] ERROR:  relation "conf_setting" does not exist at character 158
awx_postgres | 2020-05-12 15:00:26.224 UTC [88] STATEMENT:  SELECT "conf_setting"."id", "conf_setting"."created", "conf_setting"."modified", "conf_setting"."key", "conf_setting"."value", "conf_setting"."user_id" FROM "conf_setting" WHERE ("conf_setting"."key" = 'OAUTH2_PROVIDER' AND "conf_setting"."user_id" IS NULL) ORDER BY "conf_setting"."id" ASC  LIMIT 1
awx_web      | 2020-05-12 15:00:26,225 ERROR    awx.conf.settings Database settings are not available, using defaults.
awx_web      | Traceback (most recent call last):
awx_web      |   File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/django/db/backends/utils.py", line 84, in _execute
awx_web      |     return self.cursor.execute(sql, params)
awx_web      | psycopg2.errors.UndefinedTable: relation "conf_setting" does not exist
awx_web      | LINE 1: ...f_setting"."value", "conf_setting"."user_id" FROM "conf_sett...
awx_web      |                                                              ^
awx_web      | 
awx_web      | 
awx_web      | The above exception was the direct cause of the following exception:
awx_web      | 
awx_web      | Traceback (most recent call last):
awx_web      |   File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/awx/conf/settings.py", line 76, in _ctit_db_wrapper
awx_web      |     yield
awx_web      |   File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/awx/conf/settings.py", line 404, in __getattr__
awx_web      |     value = self._get_local(name)
awx_web      |   File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/awx/conf/settings.py", line 347, in _get_local
awx_web      |     setting = Setting.objects.filter(key=name, user__isnull=True).order_by('pk').first()
awx_web      |   File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/django/db/models/query.py", line 653, in first
awx_web      |     for obj in (self if self.ordered else self.order_by('pk'))[:1]:
awx_web      |   File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/django/db/models/query.py", line 274, in __iter__
awx_web      |     self._fetch_all()
awx_web      |   File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/django/db/models/query.py", line 1242, in _fetch_all
awx_web      |     self._result_cache = list(self._iterable_class(self))
awx_web      |   File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/django/db/models/query.py", line 55, in __iter__
awx_web      |     results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)
awx_web      |   File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/django/db/models/sql/compiler.py", line 1140, in execute_sql
awx_web      |     cursor.execute(sql, params)
awx_web      |   File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/django/db/backends/utils.py", line 67, in execute
awx_web      |     return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
awx_web      |   File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/django/db/backends/utils.py", line 76, in _execute_with_wrappers
awx_web      |     return executor(sql, params, many, context)
awx_web      |   File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/django/db/backends/utils.py", line 84, in _execute
awx_web      |     return self.cursor.execute(sql, params)
awx_web      |   File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/django/db/utils.py", line 89, in __exit__
awx_web      |     raise dj_exc_value.with_traceback(traceback) from exc_value
awx_web      |   File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/django/db/backends/utils.py", line 84, in _execute
awx_web      |     return self.cursor.execute(sql, params)
awx_web      | django.db.utils.ProgrammingError: relation "conf_setting" does not exist
awx_web      | LINE 1: ...f_setting"."value", "conf_setting"."user_id" FROM "conf_sett...
awx_web      |                                                              ^
awx_web      | 
awx_web      | Traceback (most recent call last):
awx_web      |   File "/usr/bin/awx-manage", line 8, in <module>
awx_web      |     sys.exit(manage())
awx_web      |   File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/awx/__init__.py", line 152, in manage
awx_web      |     execute_from_command_line(sys.argv)
awx_web      |   File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
awx_web      |     utility.execute()
awx_web      |   File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/django/core/management/__init__.py", line 375, in execute
awx_web      |     self.fetch_command(subcommand).run_from_argv(self.argv)
awx_web      |   File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/django/core/management/base.py", line 323, in run_from_argv
awx_web      |     self.execute(*args, **cmd_options)
awx_web      |   File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/django/core/management/base.py", line 364, in execute
awx_web      |     output = self.handle(*args, **options)
awx_web      |   File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/awx/main/management/commands/run_wsbroadcast.py", line 128, in handle
awx_web      |     broadcast_websocket_mgr = BroadcastWebsocketManager()
awx_web      |   File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/awx/main/wsbroadcast.py", line 154, in __init__
awx_web      |     self.local_hostname = get_local_host()
awx_web      |   File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/awx/main/wsbroadcast.py", line 45, in get_local_host
awx_web      |     return Instance.objects.me().hostname
awx_web      |   File "/var/lib/awx/venv/awx/lib/python3.6/site-packages/awx/main/managers.py", line 116, in me
awx_web      |     raise RuntimeError("No instance found with the current cluster host id")
awx_web      | RuntimeError: No instance found with the current cluster host id
awx_web      | 2020-05-12 15:00:39,443 INFO exited: wsbroadcast (exit status 1; not expected)

until migrations finish. It's just a lot of noise.

ENVIRONMENT
  • AWX version: 11.2
  • AWX install method: docker on linux
@wenottingham wenottingham changed the title local docker: awx_web doesn't wait for awx_task migrations local docker: awx_web ws_broadcast doesn't wait for awx_task migrations May 12, 2020
@rchaud
Copy link
Contributor

rchaud commented May 18, 2020

I see the same issue in 11.2.0 deploying in Kubernetes.

ryanpetrello added a commit to ryanpetrello/awx that referenced this issue May 19, 2020
this command yells a lot until migrations are finished; let's make it
not do that

see: ansible#7000
ryanpetrello added a commit to ryanpetrello/awx that referenced this issue May 19, 2020
this command yells a lot until migrations are finished; let's make it
not do that

see: ansible#7000
ryanpetrello added a commit to ryanpetrello/awx that referenced this issue May 19, 2020
this command yells a lot until migrations are finished; let's make it
not do that

see: ansible#7000
ryanpetrello added a commit to ryanpetrello/awx that referenced this issue May 19, 2020
this command yells a lot until migrations are finished; let's make it
not do that

see: ansible#7000
ryanpetrello added a commit to ryanpetrello/awx that referenced this issue May 19, 2020
this command yells a lot until migrations are finished; let's make it
not do that

see: ansible#7000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants