New install on OEL7.5 (RHEL clone) following the latest install guide doc.
Everything works fine until the 'sudo -u awx /opt/awx/bin/awx-manage create_preload_data' step. I get this:
root@box # sudo -u awx /opt/awx/bin/awx-manage create_preload_data
Traceback (most recent call last):
File "/opt/awx/bin/awx-manage", line 11, in <module>
sys.exit(manage())
File "/opt/awx/embedded/lib/python2.7/site-packages/awx/__init__.py", line 109, in manage
execute_from_command_line(sys.argv)
File "/opt/awx/embedded/lib64/python2.7/site-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
utility.execute()
File "/opt/awx/embedded/lib64/python2.7/site-packages/django/core/management/__init__.py", line 356, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/opt/awx/embedded/lib64/python2.7/site-packages/django/core/management/base.py", line 283, in run_from_argv
self.execute(*args, **cmd_options)
File "/opt/awx/embedded/lib64/python2.7/site-packages/django/core/management/base.py", line 330, in execute
output = self.handle(*args, **options)
File "/opt/awx/embedded/lib/python2.7/site-packages/awx/main/management/commands/create_preload_data.py", line 47, in handle
created_by=superuser)
File "/opt/awx/embedded/lib64/python2.7/site-packages/django/db/models/manager.py", line 85, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/opt/awx/embedded/lib64/python2.7/site-packages/django/db/models/query.py", line 394, in create
obj.save(force_insert=True, using=self.db)
File "/opt/awx/embedded/lib/python2.7/site-packages/awx/main/models/inventory.py", line 700, in save
super(Host, self).save(*args, **kwargs)
File "/opt/awx/embedded/lib/python2.7/site-packages/awx/main/models/base.py", line 275, in save
super(PrimordialModel, self).save(*args, **kwargs)
File "/opt/awx/embedded/lib/python2.7/site-packages/awx/main/models/base.py", line 164, in save
super(CreatedModifiedModel, self).save(*args, **kwargs)
File "/opt/awx/embedded/lib64/python2.7/site-packages/django/db/models/base.py", line 808, in save
force_update=force_update, update_fields=update_fields)
File "/opt/awx/embedded/lib64/python2.7/site-packages/django/db/models/base.py", line 848, in save_base
update_fields=update_fields, raw=raw, using=using,
File "/opt/awx/embedded/lib64/python2.7/site-packages/django/dispatch/dispatcher.py", line 193, in send
for receiver in self._live_receivers(sender)
File "/opt/awx/embedded/lib/python2.7/site-packages/awx/main/signals.py", line 146, in emit_update_inventory_on_created_or_deleted
update_inventory_computed_fields.delay(inventory.id, True)
File "/opt/awx/embedded/lib/python2.7/site-packages/celery/app/task.py", line 461, in delay
return self.apply_async(args, kwargs)
File "/opt/awx/embedded/lib/python2.7/site-packages/celery/app/task.py", line 573, in apply_async
**dict(self._get_exec_options(), **options)
File "/opt/awx/embedded/lib/python2.7/site-packages/celery/app/base.py", line 345, in send_task
options = router.route(options, name, args, kwargs)
File "/opt/awx/embedded/lib/python2.7/site-packages/celery/app/routes.py", line 50, in route
route = self.lookup_route(task, args, kwargs)
File "/opt/awx/embedded/lib/python2.7/site-packages/celery/app/routes.py", line 78, in lookup_route
return _first_route(self.routes, task, args, kwargs)
File "/opt/awx/embedded/lib/python2.7/site-packages/celery/utils/functional.py", line 233, in _matcher
answer = getattr(maybe_evaluate(obj), method)(*args, **kwargs)
File "/opt/awx/embedded/lib/python2.7/site-packages/awx/main/utils/ha.py", line 58, in route_for_task
(changed, instance) = Instance.objects.get_or_register()
File "/opt/awx/embedded/lib/python2.7/site-packages/awx/main/managers.py", line 106, in get_or_register
return (False, self.me())
File "/opt/awx/embedded/lib/python2.7/site-packages/awx/main/managers.py", line 88, in me
raise RuntimeError("No instance found with the current cluster host id")
RuntimeError: No instance found with the current cluster host id
If I run the same command again it completes fine. Just curious why it fails and then runs okay the second time.
Should I worry about it failing the first time? As long as it completes the second time it's okay?
I saw another closed issue that had the same error and it was mentioned the hostname was the issue.
root@box # cat /etc/hosts
#THIS FILE IS UNDER PUPPET CONTROL
#MANUAL EDITS TO THIS FILE WILL BE OVERWRITTEN
#DO NOT ALTER THIS FILE ON THE HOST
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
ip.ip.ip.ip box.domain.com box loghost
root@box # cat /etc/hostname
box
root@box # hostname -f
box.domain.com
root@box # hostnamectl
Static hostname: box
I saw in /etc/awx/settings.py it sets the HOSTNAME and CLUSTER_HOST_ID. If I run that python code in a test script as awx it returns the proper hostname:
awx@box $ cat test.py
# AWX settings file
import os
import platform
HOSTNAME = platform.node()
print(HOSTNAME)
CLUSTER_HOST_ID = HOSTNAME
print(CLUSTER_HOST_ID)
awx@box $ ./python ./test.py
box
box