AWX Installation issue

Hello Team

I am new to AWX, after installation, I see that awx page says “Server Error” and below exceptions, I see on awx_tasks. Can someone help me on this issue?

2019-02-20 16:22:51,741 INFO exited: dispatcher (exit status 1; not expected)
2019-02-20 16:22:52,744 INFO spawned: ‘dispatcher’ with pid 477
2019-02-20 16:22:53,745 INFO success: dispatcher entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2019-02-20 16:22:54,486 WARNING awx.conf.settings Database settings are not available, using defaults, error:
Traceback (most recent call last):
File “/usr/bin/awx-manage”, line 12, 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 356, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/core/management/base.py”, line 283, in run_from_argv
self.execute(*args, **cmd_options)
File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/core/management/base.py”, line 327, in execute
self.check()
File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/core/management/base.py”, line 359, in check
include_deployment_checks=include_deployment_checks,
File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/core/management/base.py”, line 346, in _run_checks
return checks.run_checks(**kwargs)
File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/core/checks/registry.py”, line 81, in run_checks
new_errors = check(app_configs=app_configs)
File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/core/checks/urls.py”, line 16, in check_url_config
return check_resolver(resolver)
File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/core/checks/urls.py”, line 26, in check_resolver
return check_method()
File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/urls/resolvers.py”, line 256, in check
for pattern in self.url_patterns:
File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/utils/functional.py”, line 35, in get
res = instance.dict[self.name] = self.func(instance)
File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/urls/resolvers.py”, line 407, in url_patterns
patterns = getattr(self.urlconf_module, “urlpatterns”, self.urlconf_module)
File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/utils/functional.py”, line 35, in get
res = instance.dict[self.name] = self.func(instance)
File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/urls/resolvers.py”, line 400, in urlconf_module
return import_module(self.urlconf_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/awx/urls.py”, line 17, in
url(r’^sso/', include(‘social_django.urls’, namespace=‘social’)),
File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/conf/urls/init.py”, line 50, in include
urlconf_module = import_module(urlconf_module)
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/social_django/urls.py”, line 6, in
from . import views
File “”, line 1023, in _handle_fromlist
File “”, line 219, in _call_with_frames_removed
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/social_django/views.py”, line 10, in
from .utils import psa
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/social_django/utils.py”, line 13, in
BACKENDS = settings.AUTHENTICATION_BACKENDS
File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/awx/conf/settings.py”, line 542, in getattr_without_cache
return getattr(self._wrapped, name)
File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/awx/conf/settings.py”, line 446, in getattr
value = self._get_local(name)
File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/awx/conf/settings.py”, line 363, in _get_local
self._preload_cache()
File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/awx/conf/settings.py”, line 325, in _preload_cache
for setting in Setting.objects.filter(key__in=settings_to_cache.keys(), user__isnull=True).order_by(‘pk’):
File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/db/models/query.py”, line 250, in iter
self._fetch_all()
File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/db/models/query.py”, line 1121, in _fetch_all
self._result_cache = list(self._iterable_class(self))
File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/db/models/query.py”, line 53, in iter
results = compiler.execute_sql(chunked_fetch=self.chunked_fetch)
File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/db/models/sql/compiler.py”, line 887, in execute_sql
cursor = self.connection.cursor()
File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/db/backends/base/base.py”, line 254, in cursor
return self._cursor()
File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/db/backends/base/base.py”, line 229, in _cursor
self.ensure_connection()
File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/db/backends/base/base.py”, line 213, in ensure_connection
self.connect()
File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/db/utils.py”, line 94, in exit
six.reraise(dj_exc_type, dj_exc_value, traceback)
File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/utils/six.py”, line 685, in reraise
raise value.with_traceback(tb)
File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/db/backends/base/base.py”, line 213, in ensure_connection
self.connect()
File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/db/backends/base/base.py”, line 189, in connect
self.connection = self.get_new_connection(conn_params)
File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/db/backends/postgresql/base.py”, line 176, in get_new_connection
connection = Database.connect(**conn_params)
File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/psycopg2/init.py”, line 130, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
OperationalError: invalid sslmode value: “__omit_place_holder__d378694810071be9256c264994bfb329b544bd3b”

Traceback (most recent call last):
File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/db/backends/base/base.py”, line 213, in ensure_connection
self.connect()
File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/db/backends/base/base.py”, line 189, in connect
self.connection = self.get_new_connection(conn_params)
File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/db/backends/postgresql/base.py”, line 176, in get_new_connection
connection = Database.connect(**conn_params)
File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/psycopg2/init.py”, line 130, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
psycopg2.OperationalError: invalid sslmode value: “__omit_place_holder__d378694810071be9256c264994bfb329b544bd3b”

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “/usr/bin/awx-manage”, line 12, 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 356, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/core/management/base.py”, line 283, in run_from_argv
self.execute(*args, **cmd_options)
File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/core/management/base.py”, line 330, in execute
output = self.handle(*args, **options)
File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/awx/main/management/commands/run_dispatcher.py”, line 121, in handle
reaper.reap()
File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/awx/main/dispatch/reaper.py”, line 36, in reap
me = instance or Instance.objects.me()
File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/awx/main/managers.py”, line 86, in me
if node.exists():
File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/db/models/query.py”, line 673, in exists
return self.query.has_results(using=self.db)
File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/db/models/sql/query.py”, line 517, in has_results
return compiler.has_results()
File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/db/models/sql/compiler.py”, line 858, in has_results
return bool(self.execute_sql(SINGLE))
File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/db/models/sql/compiler.py”, line 887, in execute_sql
cursor = self.connection.cursor()
File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/db/backends/base/base.py”, line 254, in cursor
return self._cursor()
File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/db/backends/base/base.py”, line 229, in _cursor
self.ensure_connection()
File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/db/backends/base/base.py”, line 213, in ensure_connection
self.connect()
File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/db/utils.py”, line 94, in exit
six.reraise(dj_exc_type, dj_exc_value, traceback)
File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/utils/six.py”, line 685, in reraise
raise value.with_traceback(tb)
File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/db/backends/base/base.py”, line 213, in ensure_connection
self.connect()
File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/db/backends/base/base.py”, line 189, in connect
self.connection = self.get_new_connection(conn_params)
File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/django/db/backends/postgresql/base.py”, line 176, in get_new_connection
connection = Database.connect(**conn_params)
File “/var/lib/awx/venv/awx/lib64/python3.6/site-packages/psycopg2/init.py”, line 130, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
django.db.utils.OperationalError: invalid sslmode value: “__omit_place_holder__d378694810071be9256c264994bfb329b544bd3b”

Regards
Pratap Bachu

When AWX starts for the first time it has to create the db tables. By the looks of it, your db connection fails.
How did you configure the db in your inventory file?
What installation method did you use for awx?
Is your db in a container or external?

Did you build from source? I recently built AWX from source and had similar problems. It compiled/built, but none of the settings for the DB, RabbitMQ, etc. made their way into the individual containers. I ended up modifying the /etc/tower/settings.py file on the various containers to reflect the database information. For some reason, I also commented out these lines, as it would not work without the comment:

if os.getenv(“DATABASE_SSLMODE”, False):

DATABASES[‘default’][‘OPTIONS’] = {‘sslmode’: os.getenv(“DATABASE_SSLMODE”)}

John M. Foley

IT Specialist

http://www.loc.gov/staff/emailsig/logos/lloc.jpg

Yes, i did build from source. I uncommented and made sslmode as disable.

[root@#######installer]# grep sslmode inventory
pg_sslmode=disable
[root@####### installer]#

(attachments)

image001.jpg

Did that fix it?

(attachments)

image001.jpg

I haven’t built the images in about a week but from

2019-02-20 16:22:54,486 WARNING awx.conf.settings Database settings are not available, using defaults, error:

it sounds like something prevented AWX from correctly loading your DATABASE settings in /etc/tower/settings.py? It could be that there’s a typo in a configuration item. Get into the web or task container and run
`
awx-manage print_settings

`
and inspect the DATABASE settings. Also, I think the default for pg_sslmode is false, what happens if you just leave the variable commented out in the inventory file during installation?