Ansible Tower upgrade fails on task awx_install : Migrate settings from files to database.

Solution Verified - Updated -

Issue

When upgrading Ansible Tower, it fails with the following stack trace:

TASK [awx_install : Migrate settings from files to database.] *******************************************************************************************************************************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "cmd": ["tower-manage", "migrate_to_database_settings", "--skip-errors"], "delta": "0:00:03.238636", "end": "2017-05-18 11:37:17.067855", "failed": true, "rc": 1, "start": "2017-05-18 11:37:13.829219", "stderr": "Traceback (most recent call last):\n  File \"/bin/tower-manage\", line 9, in \n    load_entry_point('ansible-tower==3.1.3', 'console_scripts', 'tower-manage')()\n  File \"/lib/python2.7/site-packages/awx/__init__.py\", line 105, in manage\n  File \"/var/lib/awx/venv/tower/lib/python2.7/site-packages/django/core/management/__init__.py\", line 354, in execute_from_command_line\n    utility.execute()\n  File \"/var/lib/awx/venv/tower/lib/python2.7/site-packages/django/core/management/__init__.py\", line 346, in execute\n    self.fetch_command(subcommand).run_from_argv(self.argv)\n  File \"/var/lib/awx/venv/tower/lib/python2.7/site-packages/django/core/management/base.py\", line 394, in run_from_argv\n    self.execute(*args, **cmd_options)\n  File \"/var/lib/awx/venv/tower/lib/python2.7/site-packages/django/core/management/base.py\", line 445, in execute\n    output = self.handle(*args, **options)\n  File \"/var/lib/awx/venv/tower/lib/python2.7/site-packages/django/utils/decorators.py\", line 145, in inner\n    return func(*args, **kwargs)\n  File \"/lib/python2.7/site-packages/awx/conf/management/commands/migrate_to_database_settings.py\", line 101, in handle\n  File \"/lib/python2.7/site-packages/awx/conf/management/commands/migrate_to_database_settings.py\", line 452, in _migrate_settings\n  File \"/lib/python2.7/site-packages/awx/conf/utils.py\", line 26, in comment_assignments\n  File \"/lib/python2.7/site-packages/awx/conf/utils.py\", line 101, in comment_assignments_in_file\nIOError: [Errno 13] Permission denied: '/etc/tower/conf.d/ldap.py'", "stderr_lines": ["Traceback (most recent call last):", "  File \"/bin/tower-manage\", line 9, in ", "    load_entry_point('ansible-tower==3.1.3', 'console_scripts', 'tower-manage')()", "  File \"/lib/python2.7/site-packages/awx/__init__.py\", line 105, in manage", "  File \"/var/lib/awx/venv/tower/lib/python2.7/site-packages/django/core/management/__init__.py\", line 354, in execute_from_command_line", "    utility.execute()", "  File \"/var/lib/awx/venv/tower/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/tower/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/tower/lib/python2.7/site-packages/django/core/management/base.py\", line 445, in execute", "    output = self.handle(*args, **options)", "  File \"/var/lib/awx/venv/tower/lib/python2.7/site-packages/django/utils/decorators.py\", line 145, in inner", "    return func(*args, **kwargs)", "  File \"/lib/python2.7/site-packages/awx/conf/management/commands/migrate_to_database_settings.py\", line 101, in handle", "  File \"/lib/python2.7/site-packages/awx/conf/management/commands/migrate_to_database_settings.py\", line 452, in _migrate_settings", "  File \"/lib/python2.7/site-packages/awx/conf/utils.py\", line 26, in comment_assignments", "  File \"/lib/python2.7/site-packages/awx/conf/utils.py\", line 101, in comment_assignments_in_file", "IOError: [Errno 13] Permission denied: '/etc/tower/conf.d/ldap.py'"], "stdout": "Discovering settings to be migrated and commented:\n  AUTH_LDAP_USER_ATTR_MAP: Migrate + Comment\n  AUTH_LDAP_ORGANIZATION_MAP: Migrate + Comment\n  AUTH_LDAP_TEAM_MAP: Migrate + Comment\nMigrating settings to database:\n  AUTH_LDAP_USER_ATTR_MAP: Updated\n  AUTH_LDAP_ORGANIZATION_MAP: Updated\n  AUTH_LDAP_TEAM_MAP: Updated\nCommenting settings in files:", "stdout_lines": ["Discovering settings to be migrated and commented:", "  AUTH_LDAP_USER_ATTR_MAP: Migrate + Comment", "  AUTH_LDAP_ORGANIZATION_MAP: Migrate + Comment", "  AUTH_LDAP_TEAM_MAP: Migrate + Comment", "Migrating settings to database:", "  AUTH_LDAP_USER_ATTR_MAP: Updated", "  AUTH_LDAP_ORGANIZATION_MAP: Updated", "  AUTH_LDAP_TEAM_MAP: Updated", "Commenting settings in files:"]}

Important line to notice in the stack is:

IOError: [Errno 13] Permission denied: '/etc/tower/conf.d/ldap.py'

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In