awx icon indicating copy to clipboard operation
awx copied to clipboard

ProgrammingError: relation "celery_taskmeta" does not exist in awx_task

Open silver8ack opened this issue 9 years ago • 6 comments

ISSUE TYPE
  • Bug Report
COMPONENT NAME
  • Installer
SUMMARY

Database migrations not completing. Relation 'celery_taskmeta' is missing and the awx_task container will not complete initialization.

ENVIRONMENT
  • AWX version: 1.0.0.365
  • Ansible version: 2.3.1.0
  • Operating System: Ansible/Local OS: MacOS Sierra. Target OS: Red Hat Enterprise Linux Server release 7.3
  • Web Browser: Chrome
STEPS TO REPRODUCE

Running the installation for standalone docker build with an existing postgresql server.

EXPECTED RESULTS

Expect the awx_task container to show the results as shown in the INSTALL.md. Also, for the web UI to stop showing the 'Upgrading' page.

ACTUAL RESULTS

awx_task container repeating this log entry...

[2017-09-14 19:28:14,434: INFO/MainProcess] Scheduler: Sending due task task_manager (awx.main.scheduler.tasks.run_task_manager)
[2017-09-14 19:28:14,437: DEBUG/MainProcess] awx.main.scheduler.tasks.run_task_manager sent. id->f563d5a3-a3e8-48ae-99e9-7e73b80c55e4
[2017-09-14 19:28:14,438: DEBUG/MainProcess] beat: Waking up in 19.88 seconds.
[2017-09-14 19:28:14,440: INFO/MainProcess] Received task: awx.main.scheduler.tasks.run_task_manager[f563d5a3-a3e8-48ae-99e9-7e73b80c55e4] expires:[2017-09-14 19:28:34.436247+00:00]
[2017-09-14 19:28:14,440: DEBUG/MainProcess] TaskPool: Apply <function _fast_trace_task at 0x6db27d0> (args:(u'awx.main.scheduler.tasks.run_task_manager', u'f563d5a3-a3e8-48ae-99e9-7e73b80c55e4', [], {}, {u'utc': True, u'is_eager': False, u'chord': None, u'group': None, u'args': [], u'retries': 0, u'delivery_info': {u'priority': None, u'redelivered': False, u'routing_key': u'tower', u'exchange': u'tower'}, u'expires': u'2017-09-14T19:28:34.436247+00:00', u'hostname': 'celery@localhost', u'task': u'awx.main.scheduler.tasks.run_task_manager', u'callbacks': None, u'correlation_id': u'f563d5a3-a3e8-48ae-99e9-7e73b80c55e4', u'errbacks': None, u'timelimit': [None, None], u'taskset': None, u'kwargs': {}, u'eta': None, u'reply_to': u'30d03390-0769-3601-9e73-a6fef6902902', u'id': u'f563d5a3-a3e8-48ae-99e9-7e73b80c55e4', u'headers': {}}) kwargs:{})
[2017-09-14 19:28:14,444: DEBUG/MainProcess] Task accepted: awx.main.scheduler.tasks.run_task_manager[f563d5a3-a3e8-48ae-99e9-7e73b80c55e4] pid:146
[2017-09-14 19:28:14,456: CRITICAL/MainProcess] Task awx.main.scheduler.tasks.run_task_manager[f563d5a3-a3e8-48ae-99e9-7e73b80c55e4] INTERNAL ERROR: ProgrammingError('relation "celery_taskmeta" does not exist\nLINE 1: ...taskmeta"."hidden", "celery_taskmeta"."meta" FROM "celery_ta...\n                                                             ^\n',)
Traceback (most recent call last):
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/celery/app/trace.py", line 235, in trace_task
    request=task_request,
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/celery/backends/base.py", line 256, in store_result
    request=request, **kwargs)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/djcelery/backends/database.py", line 29, in _store_result
    traceback=traceback, children=self.current_task_children(request),
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/djcelery/managers.py", line 42, in _inner
    return fun(*args, **kwargs)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/djcelery/managers.py", line 181, in store_result
    'meta': {'children': children}})
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/djcelery/managers.py", line 87, in update_or_create
    return get_queryset(self).update_or_create(**kwargs)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/djcelery/managers.py", line 70, in update_or_create
    obj, created = self.get_or_create(**kwargs)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/query.py", line 405, in get_or_create
    return self.get(**lookup), False
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/query.py", line 328, in get
    num = len(clone)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/query.py", line 144, in __len__
    self._fetch_all()
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/query.py", line 965, in _fetch_all
    self._result_cache = list(self.iterator())
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/query.py", line 238, in iterator
    results = compiler.execute_sql()
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 840, in execute_sql
    cursor.execute(sql, params)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/utils.py", line 98, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
ProgrammingError: relation "celery_taskmeta" does not exist
LINE 1: ...taskmeta"."hidden", "celery_taskmeta"."meta" FROM "celery_ta...
ADDITIONAL INFORMATION

silver8ack avatar Sep 14 '17 19:09 silver8ack

I believe this is likely a dupe of https://github.com/ansible/awx/issues/138

Remove the directory that we mapped to postgres (and is defined in the inventory file) and re-run and it should straighten itself out.

matburt avatar Sep 14 '17 19:09 matburt

Thanks for the feedback. I'm using a pg_hostname variable, and an existing postgresql server. It looks like I'm having a few issues however, that may be causing this one.

FYI, I stopped all containers, deleted the images and rebuilt with the postgres_data_dir commented out. I don't have a data directory at the path in the inventory file. Same issue. Below is the full log after the awx_task container starts up. I'll look into the config issue, although, I'm not sure I really want to allow my app db_user access to the postgres database... This may not be a bug, so perhaps I should take this up on the mailing list.

Using /etc/ansible/ansible.cfg as config file
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: OperationalError: FATAL:  no pg_hba.conf entry for host "<IPADDR>", user "awxpguser", database "postgres", SSL off
127.0.0.1 | FAILED! => {
    "changed": false,
    "failed": true,
    "msg": "unable to connect to database: FATAL:  no pg_hba.conf entry for host \"<IPADDR>\", user \"awxpguser\", database \"postgres\", SSL off\n"
}
Operations to perform:
  Synchronize unmigrated apps: solo, api, staticfiles, messages, channels, django_extensions, ui, rest_framework, polymorphic
  Apply all migrations: sso, taggit, sessions, djcelery, sites, kombu_transport_django, social_auth, contenttypes, auth, conf, main
Synchronizing apps without migrations:
  Creating tables...
    Running deferred SQL...
  Installing custom SQL...
Running migrations:
  Rendering model states... DONE
Traceback (most recent call last):
  File "/usr/bin/awx-manage", line 9, in <module>
    load_entry_point('awx==1.0.0.365', 'console_scripts', 'awx-manage')()
  File "/usr/lib/python2.7/site-packages/awx/__init__.py", line 107, in manage
    execute_from_command_line(sys.argv)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/core/management/__init__.py", line 354, in execute_from_command_line
    utility.execute()
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/core/management/__init__.py", line 346, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/core/management/base.py", line 394, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/core/management/base.py", line 445, in execute
    output = self.handle(*args, **options)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/core/management/commands/migrate.py", line 222, in handle
    executor.migrate(targets, plan, fake=fake, fake_initial=fake_initial)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/migrations/executor.py", line 110, in migrate
    self.apply_migration(states[migration], migration, fake=fake, fake_initial=fake_initial)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/migrations/executor.py", line 148, in apply_migration
    state = migration.apply(state, schema_editor)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/migrations/migration.py", line 115, in apply
    operation.database_forwards(self.app_label, schema_editor, old_state, project_state)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/migrations/operations/models.py", line 59, in database_forwards
    schema_editor.create_model(model)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/backends/base/schema.py", line 286, in create_model
    self.execute(sql, params or None)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/backends/base/schema.py", line 111, in execute
    cursor.execute(sql, params)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/utils.py", line 98, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/backends/utils.py", line 62, in execute
    return self.cursor.execute(sql)
django.db.utils.ProgrammingError: type "jsonb" does not exist
LINE 1: ...NOT NULL, "module" varchar(128) NOT NULL, "facts" jsonb NOT ...
                                                             ^

Python 2.7.5 (default, Aug  4 2017, 00:39:18)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-16)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/contrib/auth/models.py", line 191, in create_superuser
    **extra_fields)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/contrib/auth/models.py", line 182, in _create_user
    user.save(using=self._db)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/base.py", line 734, in save
    force_update=force_update, update_fields=update_fields)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/base.py", line 762, in save_base
    updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/base.py", line 846, in _save_table
    result = self._do_insert(cls._base_manager, using, fields, update_pk, raw)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/base.py", line 885, in _do_insert
    using=using, raw=raw)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/manager.py", line 127, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/query.py", line 920, in _insert
    return query.get_compiler(using=using).execute_sql(return_id)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 974, in execute_sql
    cursor.execute(sql, params)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/utils.py", line 98, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
IntegrityError: duplicate key value violates unique constraint "auth_user_username_key"
DETAIL:  Key (username)=(admin) already exists.


Traceback (most recent call last):
  File "/usr/bin/awx-manage", line 9, in <module>
    load_entry_point('awx==1.0.0.365', 'console_scripts', 'awx-manage')()
  File "/usr/lib/python2.7/site-packages/awx/__init__.py", line 107, in manage
    execute_from_command_line(sys.argv)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/core/management/__init__.py", line 354, in execute_from_command_line
    utility.execute()
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/core/management/__init__.py", line 346, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/core/management/base.py", line 394, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/core/management/base.py", line 445, in execute
    output = self.handle(*args, **options)
  File "/usr/lib/python2.7/site-packages/awx/main/management/commands/create_preload_data.py", line 25, in handle
    o = Organization.objects.create(name='Default')
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/manager.py", line 127, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/query.py", line 348, in create
    obj.save(force_insert=True, using=self.db)
  File "/usr/lib/python2.7/site-packages/awx/main/models/base.py", line 290, in save
    super(PrimordialModel, self).save(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/awx/main/models/base.py", line 185, in save
    super(CreatedModifiedModel, self).save(*args, **kwargs)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/base.py", line 734, in save
    force_update=force_update, update_fields=update_fields)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/base.py", line 762, in save_base
    updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/base.py", line 846, in _save_table
    result = self._do_insert(cls._base_manager, using, fields, update_pk, raw)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/base.py", line 885, in _do_insert
    using=using, raw=raw)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/manager.py", line 127, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/query.py", line 920, in _insert
    return query.get_compiler(using=using).execute_sql(return_id)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 974, in execute_sql
    cursor.execute(sql, params)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/utils.py", line 98, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
django.db.utils.ProgrammingError: column "admin_role_id" of relation "main_organization" does not exist
LINE 1: ...tion", "created_by_id", "modified_by_id", "name", "admin_rol...
                                                             ^

Traceback (most recent call last):
  File "/usr/bin/awx-manage", line 9, in <module>
    load_entry_point('awx==1.0.0.365', 'console_scripts', 'awx-manage')()
  File "/usr/lib/python2.7/site-packages/awx/__init__.py", line 107, in manage
    execute_from_command_line(sys.argv)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/core/management/__init__.py", line 354, in execute_from_command_line
    utility.execute()
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/core/management/__init__.py", line 346, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/core/management/base.py", line 394, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/core/management/base.py", line 445, in execute
    output = self.handle(*args, **options)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/utils/decorators.py", line 145, in inner
    return func(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/awx/main/management/commands/provision_instance.py", line 43, in handle
    self._register_hostname(options.get('hostname'))
  File "/usr/lib/python2.7/site-packages/awx/main/management/commands/provision_instance.py", line 33, in _register_hostname
    instance.save()
  File "/usr/lib64/python2.7/contextlib.py", line 35, in __exit__
    self.gen.throw(type, value, traceback)
  File "/usr/lib/python2.7/site-packages/awx/main/utils/pglock.py", line 14, in advisory_lock
    yield internal_lock
  File "/usr/lib64/python2.7/contextlib.py", line 35, in __exit__
    self.gen.throw(type, value, traceback)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django_pglocks/__init__.py", line 80, in advisory_lock
    cursor.execute(command)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/backends/utils.py", line 59, in execute
    self.db.validate_no_broken_transaction()
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/backends/base/base.py", line 327, in validate_no_broken_transaction
    "An error occurred in the current transaction. You can't "
django.db.transaction.TransactionManagementError: An error occurred in the current transaction. You can't execute queries until the end of the 'atomic' block.
Traceback (most recent call last):
  File "/usr/bin/awx-manage", line 9, in <module>
    load_entry_point('awx==1.0.0.365', 'console_scripts', 'awx-manage')()
  File "/usr/lib/python2.7/site-packages/awx/__init__.py", line 107, in manage
    execute_from_command_line(sys.argv)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/core/management/__init__.py", line 354, in execute_from_command_line
    utility.execute()
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/core/management/__init__.py", line 346, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/core/management/base.py", line 394, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/core/management/base.py", line 445, in execute
    output = self.handle(*args, **options)
  File "/usr/lib/python2.7/site-packages/awx/main/management/commands/register_queue.py", line 33, in handle
    if ig.exists():
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/query.py", line 586, in exists
    return self.query.has_results(using=self.db)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/sql/query.py", line 484, in has_results
    return compiler.has_results()
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 811, in has_results
    return bool(self.execute_sql(SINGLE))
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 840, in execute_sql
    cursor.execute(sql, params)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/utils.py", line 98, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
django.db.utils.ProgrammingError: relation "main_instancegroup" does not exist
LINE 1: SELECT (1) AS "a" FROM "main_instancegroup" WHERE "main_inst...
                               ^

  Applying main.0002_squashed_v300_release...>>> >>> 2017-09-14 20:26:11,568 CRIT Supervisor running as root (no user in config file)
2017-09-14 20:26:11,568 WARN For [program:awx-celeryd-beat], redirect_stderr=true but stderr_logfile has also been set to a filename, the filename has been ignored
Unlinking stale socket /tmp/supervisor.sock
2017-09-14 20:26:11,883 INFO RPC interface 'supervisor' initialized
2017-09-14 20:26:11,883 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2017-09-14 20:26:11,883 INFO supervisord started with pid 90
2017-09-14 20:26:12,887 INFO spawned: 'celery' with pid 93
2017-09-14 20:26:12,889 INFO spawned: 'channels-worker' with pid 94
2017-09-14 20:26:12,891 INFO spawned: 'callback-receiver' with pid 95
2017-09-14 20:26:12,893 INFO spawned: 'awx-celeryd-beat' with pid 96
2017-09-14 20:26:13,896 INFO success: celery entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2017-09-14 20:26:13,896 INFO success: channels-worker entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2017-09-14 20:26:13,896 INFO success: callback-receiver entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2017-09-14 20:26:13,896 INFO success: awx-celeryd-beat entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2017-09-14 20:26:18,400 WARNING  py.warnings /var/lib/awx/venv/awx/lib/python2.7/site-packages/django/core/management/base.py:260: RemovedInDjango19Warning: "requires_model_validation" is deprecated in favor of "requires_system_checks".
  RemovedInDjango19Warning)

[2017-09-14 20:26:18,540: DEBUG/MainProcess] Setting default socket timeout to 30
[2017-09-14 20:26:18,540: INFO/MainProcess] beat: Starting...
2017-09-14 20:26:18,591 - INFO - runworker - Using single-threaded worker.
2017-09-14 20:26:18,592 - INFO - runworker - Running worker against channel layer default (asgi_amqp.core.AMQPChannelLayer)
2017-09-14 20:26:18,592 - INFO - worker - Listening on channels websocket.connect, websocket.disconnect, websocket.receive
2017-09-14 20:26:18,595 WARNING  py.warnings /var/lib/awx/venv/awx/lib/python2.7/site-packages/django/core/management/base.py:260: RemovedInDjango19Warning: "requires_model_validation" is deprecated in favor of "requires_system_checks".
  RemovedInDjango19Warning)

2017-09-14 20:26:18,653 INFO     awx.main.tasks Syncing Schedules
2017-09-14 20:26:18,653 INFO     awx.main.tasks Syncing Schedules
2017-09-14 20:26:18,664 WARNING  py.warnings /var/lib/awx/venv/awx/lib/python2.7/site-packages/celery/platforms.py:766: RuntimeWarning: You are running the worker with superuser privileges, which is
absolutely not recommended!

Please specify a different user using the -u option.

User information: uid=0 euid=0 gid=0 egid=0

  uid=uid, euid=euid, gid=gid, egid=egid,

[2017-09-14 20:26:18,683: DEBUG/MainProcess] | Worker: Preparing bootsteps.
[2017-09-14 20:26:18,687: DEBUG/MainProcess] | Worker: Building graph...
[2017-09-14 20:26:18,688: DEBUG/MainProcess] | Worker: New boot order: {StateDB, Timer, Hub, Queues (intra), Pool, Autoscaler, Beat, Autoreloader, Consumer}
[2017-09-14 20:26:18,694: DEBUG/MainProcess] | Consumer: Preparing bootsteps.
[2017-09-14 20:26:18,695: DEBUG/MainProcess] | Consumer: Building graph...
[2017-09-14 20:26:18,703: DEBUG/MainProcess] | Consumer: New boot order: {Connection, Agent, Events, Mingle, Tasks, Control, Heart, Gossip, event loop}
[2017-09-14 20:26:18,708: DEBUG/MainProcess] | Worker: Starting Hub
[2017-09-14 20:26:18,709: DEBUG/MainProcess] ^-- substep ok
[2017-09-14 20:26:18,709: DEBUG/MainProcess] | Worker: Starting Pool
[2017-09-14 20:26:18,710: DEBUG/MainProcess] ^-- substep ok
[2017-09-14 20:26:18,710: DEBUG/MainProcess] | Worker: Starting Autoscaler
[2017-09-14 20:26:18,710: DEBUG/MainProcess] ^-- substep ok
[2017-09-14 20:26:18,710: DEBUG/MainProcess] | Worker: Starting Consumer
[2017-09-14 20:26:18,710: DEBUG/MainProcess] | Consumer: Starting Connection
[2017-09-14 20:26:18,731: DEBUG/MainProcess] Start from server, version: 0.9, properties: {u'information': u'Licensed under the MPL.  See http://www.rabbitmq.com/', u'product': u'RabbitMQ', u'copyright': u'Copyright (C) 2007-2017 Pivotal Software, Inc.', u'capabilities': {u'exchange_exchange_bindings': True, u'connection.blocked': True, u'authentication_failure_close': True, u'direct_reply_to': True, u'basic.nack': True, u'per_consumer_qos': True, u'consumer_priorities': True, u'consumer_cancel_notify': True, u'publisher_confirms': True}, u'cluster_name': u'rabbit@69248b7cd389', u'platform': u'Erlang/OTP 19.2.1', u'version': u'3.6.12'}, mechanisms: [u'PLAIN', u'AMQPLAIN'], locales: [u'en_US']
[2017-09-14 20:26:18,734: DEBUG/MainProcess] Open OK!
[2017-09-14 20:26:18,734: INFO/MainProcess] Connected to amqp://guest:**@rabbitmq:5672/awx
[2017-09-14 20:26:18,734: DEBUG/MainProcess] ^-- substep ok
[2017-09-14 20:26:18,734: DEBUG/MainProcess] | Consumer: Starting Events
[2017-09-14 20:26:18,768: DEBUG/MainProcess] Start from server, version: 0.9, properties: {u'information': u'Licensed under the MPL.  See http://www.rabbitmq.com/', u'product': u'RabbitMQ', u'copyright': u'Copyright (C) 2007-2017 Pivotal Software, Inc.', u'capabilities': {u'exchange_exchange_bindings': True, u'connection.blocked': True, u'authentication_failure_close': True, u'direct_reply_to': True, u'basic.nack': True, u'per_consumer_qos': True, u'consumer_priorities': True, u'consumer_cancel_notify': True, u'publisher_confirms': True}, u'cluster_name': u'rabbit@69248b7cd389', u'platform': u'Erlang/OTP 19.2.1', u'version': u'3.6.12'}, mechanisms: [u'PLAIN', u'AMQPLAIN'], locales: [u'en_US']
[2017-09-14 20:26:18,780: DEBUG/MainProcess] Open OK!
[2017-09-14 20:26:18,781: DEBUG/MainProcess] using channel_id: 1
[2017-09-14 20:26:18,782: DEBUG/MainProcess] Channel open
[2017-09-14 20:26:18,783: DEBUG/MainProcess] ^-- substep ok
[2017-09-14 20:26:18,783: DEBUG/MainProcess] | Consumer: Starting Mingle
[2017-09-14 20:26:18,784: INFO/MainProcess] mingle: searching for neighbors
[2017-09-14 20:26:18,784: DEBUG/MainProcess] using channel_id: 1
[2017-09-14 20:26:18,795: DEBUG/MainProcess] Channel open
[2017-09-14 20:26:19,839: INFO/MainProcess] mingle: all alone
[2017-09-14 20:26:19,839: DEBUG/MainProcess] ^-- substep ok
[2017-09-14 20:26:19,839: DEBUG/MainProcess] | Consumer: Starting Tasks
[2017-09-14 20:26:20,943: DEBUG/MainProcess] Current schedule:
<Entry: purge_stdout_files awx.main.tasks.purge_old_stdout_files() <freq: 7.00 days>
<Entry: tower_scheduler awx.main.tasks.awx_periodic_scheduler() <freq: 30.00 seconds>
<Entry: authtoken_cleanup awx.main.tasks.cleanup_authtokens() <freq: 30.00 days>
<Entry: celery.backend_cleanup celery.backend_cleanup() <crontab: 0 4 * * * (m/h/d/dM/MY)>
<Entry: task_manager awx.main.scheduler.tasks.run_task_manager() <freq: 20.00 seconds>
<Entry: cluster_heartbeat awx.main.tasks.cluster_node_heartbeat() <freq: 1.00 minute>
<Entry: admin_checks awx.main.tasks.run_administrative_checks() <freq: 30.00 days>
[2017-09-14 20:26:20,944: DEBUG/MainProcess] beat: Ticking with max interval->1.00 minute
[2017-09-14 20:26:22,065: DEBUG/MainProcess] Start from server, version: 0.9, properties: {u'information': u'Licensed under the MPL.  See http://www.rabbitmq.com/', u'product': u'RabbitMQ', u'copyright': u'Copyright (C) 2007-2017 Pivotal Software, Inc.', u'capabilities': {u'exchange_exchange_bindings': True, u'connection.blocked': True, u'authentication_failure_close': True, u'direct_reply_to': True, u'basic.nack': True, u'per_consumer_qos': True, u'consumer_priorities': True, u'consumer_cancel_notify': True, u'publisher_confirms': True}, u'cluster_name': u'rabbit@69248b7cd389', u'platform': u'Erlang/OTP 19.2.1', u'version': u'3.6.12'}, mechanisms: [u'PLAIN', u'AMQPLAIN'], locales: [u'en_US']
[2017-09-14 20:26:22,067: DEBUG/MainProcess] Open OK!
[2017-09-14 20:26:22,071: INFO/MainProcess] Scheduler: Sending due task cluster_heartbeat (awx.main.tasks.cluster_node_heartbeat)
[2017-09-14 20:26:22,076: DEBUG/MainProcess] using channel_id: 1
[2017-09-14 20:26:22,077: DEBUG/MainProcess] Channel open
[2017-09-14 20:26:22,080: DEBUG/MainProcess] beat: Synchronizing schedule...
[2017-09-14 20:26:22,095: DEBUG/MainProcess] ^-- substep ok
[2017-09-14 20:26:22,095: DEBUG/MainProcess] | Consumer: Starting Control
[2017-09-14 20:26:22,095: DEBUG/MainProcess] using channel_id: 2
[2017-09-14 20:26:22,096: DEBUG/MainProcess] Channel open
[2017-09-14 20:26:22,099: DEBUG/MainProcess] ^-- substep ok
[2017-09-14 20:26:22,100: DEBUG/MainProcess] | Consumer: Starting Heart
[2017-09-14 20:26:22,101: DEBUG/MainProcess] ^-- substep ok
[2017-09-14 20:26:22,101: DEBUG/MainProcess] | Consumer: Starting Gossip
[2017-09-14 20:26:22,101: DEBUG/MainProcess] using channel_id: 3
[2017-09-14 20:26:22,102: DEBUG/MainProcess] Channel open
[2017-09-14 20:26:22,108: DEBUG/MainProcess] ^-- substep ok
[2017-09-14 20:26:22,108: DEBUG/MainProcess] | Consumer: Starting event loop
[2017-09-14 20:26:22,110: WARNING/MainProcess] celery@localhost ready.
[2017-09-14 20:26:22,110: DEBUG/MainProcess] | Worker: Hub.register Autoscaler...
[2017-09-14 20:26:22,110: DEBUG/MainProcess] | Worker: Hub.register Pool...
[2017-09-14 20:26:22,110: DEBUG/MainProcess] basic.qos: prefetch_count->4
[2017-09-14 20:26:23,524: DEBUG/MainProcess] awx.main.tasks.cluster_node_heartbeat sent. id->c7288a1a-82dd-48f6-92f7-a5a7cf7dee1b
[2017-09-14 20:26:23,526: INFO/MainProcess] Scheduler: Sending due task task_manager (awx.main.scheduler.tasks.run_task_manager)
[2017-09-14 20:26:23,534: INFO/MainProcess] Received task: awx.main.tasks.cluster_node_heartbeat[c7288a1a-82dd-48f6-92f7-a5a7cf7dee1b] expires:[2017-09-14 20:27:12.076293+00:00]
[2017-09-14 20:26:23,534: INFO/MainProcess] Scaling up 1 processes.
[2017-09-14 20:26:23,530: DEBUG/MainProcess] awx.main.scheduler.tasks.run_task_manager sent. id->8d2dab3f-9d32-4d5a-9b99-992f8283ca8f
[2017-09-14 20:26:23,531: INFO/MainProcess] Scheduler: Sending due task tower_scheduler (awx.main.tasks.awx_periodic_scheduler)
[2017-09-14 20:26:23,545: DEBUG/MainProcess] TaskPool: Apply <function _fast_trace_task at 0x5dd07d0> (args:(u'awx.main.tasks.cluster_node_heartbeat', u'c7288a1a-82dd-48f6-92f7-a5a7cf7dee1b', [], {}, {u'utc': True, u'is_eager': False, u'chord': None, u'group': None, u'args': [], u'retries': 0, u'delivery_info': {u'priority': None, u'redelivered': False, u'routing_key': u'awx', u'exchange': u'awx'}, u'expires': u'2017-09-14T20:27:12.076293+00:00', u'hostname': 'celery@localhost', u'task': u'awx.main.tasks.cluster_node_heartbeat', u'callbacks': None, u'correlation_id': u'c7288a1a-82dd-48f6-92f7-a5a7cf7dee1b', u'errbacks': None, u'timelimit': [None, None], u'taskset': None, u'kwargs': {}, u'eta': None, u'reply_to': u'87210304-6616-3e5c-acf1-b6fa431a10ea', u'id': u'c7288a1a-82dd-48f6-92f7-a5a7cf7dee1b', u'headers': {}}) kwargs:{})
[2017-09-14 20:26:23,546: DEBUG/MainProcess] basic.qos: prefetch_count->8
[2017-09-14 20:26:23,542: DEBUG/MainProcess] awx.main.tasks.awx_periodic_scheduler sent. id->91d5cd71-771c-447f-bb25-6d9efc71ff12
[2017-09-14 20:26:23,543: DEBUG/MainProcess] beat: Waking up in 19.99 seconds.
[2017-09-14 20:26:23,550: INFO/MainProcess] Received task: awx.main.scheduler.tasks.run_task_manager[8d2dab3f-9d32-4d5a-9b99-992f8283ca8f] expires:[2017-09-14 20:26:43.528439+00:00]
[2017-09-14 20:26:23,550: INFO/MainProcess] Scaling up 1 processes.
[2017-09-14 20:26:23,560: DEBUG/MainProcess] TaskPool: Apply <function _fast_trace_task at 0x5dd07d0> (args:(u'awx.main.scheduler.tasks.run_task_manager', u'8d2dab3f-9d32-4d5a-9b99-992f8283ca8f', [], {}, {u'utc': True, u'is_eager': False, u'chord': None, u'group': None, u'args': [], u'retries': 0, u'delivery_info': {u'priority': None, u'redelivered': False, u'routing_key': u'tower', u'exchange': u'tower'}, u'expires': u'2017-09-14T20:26:43.528439+00:00', u'hostname': 'celery@localhost', u'task': u'awx.main.scheduler.tasks.run_task_manager', u'callbacks': None, u'correlation_id': u'8d2dab3f-9d32-4d5a-9b99-992f8283ca8f', u'errbacks': None, u'timelimit': [None, None], u'taskset': None, u'kwargs': {}, u'eta': None, u'reply_to': u'87210304-6616-3e5c-acf1-b6fa431a10ea', u'id': u'8d2dab3f-9d32-4d5a-9b99-992f8283ca8f', u'headers': {}}) kwargs:{})
[2017-09-14 20:26:23,564: INFO/MainProcess] Received task: awx.main.tasks.awx_periodic_scheduler[91d5cd71-771c-447f-bb25-6d9efc71ff12] expires:[2017-09-14 20:26:43.541465+00:00]
[2017-09-14 20:26:23,565: INFO/MainProcess] Scaling up 1 processes.
[2017-09-14 20:26:23,573: DEBUG/MainProcess] TaskPool: Apply <function _fast_trace_task at 0x5dd07d0> (args:(u'awx.main.tasks.awx_periodic_scheduler', u'91d5cd71-771c-447f-bb25-6d9efc71ff12', [], {}, {u'utc': True, u'is_eager': False, u'chord': None, u'group': None, u'args': [], u'retries': 0, u'delivery_info': {u'priority': None, u'redelivered': False, u'routing_key': u'tower', u'exchange': u'tower'}, u'expires': u'2017-09-14T20:26:43.541465+00:00', u'hostname': 'celery@localhost', u'task': u'awx.main.tasks.awx_periodic_scheduler', u'callbacks': None, u'correlation_id': u'91d5cd71-771c-447f-bb25-6d9efc71ff12', u'errbacks': None, u'timelimit': [None, None], u'taskset': None, u'kwargs': {}, u'eta': None, u'reply_to': u'87210304-6616-3e5c-acf1-b6fa431a10ea', u'id': u'91d5cd71-771c-447f-bb25-6d9efc71ff12', u'headers': {}}) kwargs:{})
[2017-09-14 20:26:23,606: DEBUG/MainProcess] basic.qos: prefetch_count->16
[2017-09-14 20:26:23,609: DEBUG/MainProcess] Task accepted: awx.main.tasks.cluster_node_heartbeat[c7288a1a-82dd-48f6-92f7-a5a7cf7dee1b] pid:141
[2017-09-14 20:26:23,633: DEBUG/MainProcess] Task accepted: awx.main.scheduler.tasks.run_task_manager[8d2dab3f-9d32-4d5a-9b99-992f8283ca8f] pid:142
2017-09-14 20:26:23,655 WARNING  py.warnings /var/lib/awx/venv/awx/lib/python2.7/site-packages/celery/app/trace.py:365: RuntimeWarning: Exception raised outside body: ProgrammingError('relation "celery_taskmeta" does not exist\nLINE 1: ...taskmeta"."hidden", "celery_taskmeta"."meta" FROM "celery_ta...\n                                                             ^\n',):
Traceback (most recent call last):
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/celery/app/trace.py", line 235, in trace_task
    request=task_request,
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/celery/backends/base.py", line 256, in store_result
    request=request, **kwargs)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/djcelery/backends/database.py", line 29, in _store_result
    traceback=traceback, children=self.current_task_children(request),
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/djcelery/managers.py", line 42, in _inner
    return fun(*args, **kwargs)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/djcelery/managers.py", line 181, in store_result
    'meta': {'children': children}})
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/djcelery/managers.py", line 87, in update_or_create
    return get_queryset(self).update_or_create(**kwargs)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/djcelery/managers.py", line 70, in update_or_create
    obj, created = self.get_or_create(**kwargs)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/query.py", line 405, in get_or_create
    return self.get(**lookup), False
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/query.py", line 328, in get
    num = len(clone)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/query.py", line 144, in __len__
    self._fetch_all()
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/query.py", line 965, in _fetch_all
    self._result_cache = list(self.iterator())
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/query.py", line 238, in iterator
    results = compiler.execute_sql()
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 840, in execute_sql
    cursor.execute(sql, params)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/utils.py", line 98, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
ProgrammingError: relation "celery_taskmeta" does not exist
LINE 1: ...taskmeta"."hidden", "celery_taskmeta"."meta" FROM "celery_ta...
                                                             ^


  exc, exc_info.traceback)))

silver8ack avatar Sep 14 '17 20:09 silver8ack

Looks like this right here is your problem:

unable to connect to database: FATAL: no pg_hba.conf entry for host \"<IPADDR>\", user \"awxpguser\", database \"postgres\", SSL off

matburt avatar Sep 14 '17 20:09 matburt

Yep, I'll look into it. I'm just not sure why the app needs access to the postgres database. That's not the database name I'm using when running the build. Also, I see the tables created on the proper database 'awx_development'.

I can alter the postgres config to allow that connection for now, but I'm just not sure why it needs access to the postgres database. That's not something that I think our DB Admins will allow in a non-dev environment.

silver8ack avatar Sep 14 '17 20:09 silver8ack

FYI, after allowing access to the postgres database, I also had to upgrade postgres(that was throwing the jsonb error). Everything's working now. Thanks for the help.

silver8ack avatar Sep 18 '17 13:09 silver8ack

Oh man, Just spent a while digging before realizing I need postgres 9.4+ to fix this. Up and running at last.

rootameen avatar Sep 24 '17 20:09 rootameen