Comment 0 for bug 1750656

Revision history for this message
git-harry (git-harry) wrote :

If `apt_repository` fails when attempting to update the apt cache after adding the repository, and the task is set to retry on failure, the second attempt finds the repository has already been added and so no change is made resulting in no attempt to update the cache. This means the second attempt always succeeds without updating the cache. This can result in the failure to install libmariadbclient-dev.

The following example failures where seen on the stable/pike version of galera_client and galera_server but there may be similar examples in other roles.

```
TASK [galera_client : Add galera repo] *****************************************
Friday 16 February 2018 14:42:14 -0600 (0:00:00.713) 0:36:52.759 *******
FAILED - RETRYING: Add galera repo (5 retries left).
ok: [infra1_repo_container-55057f82]

TASK [galera_client : Install galera distro packages] **************************
Friday 16 February 2018 14:42:21 -0600 (0:00:06.969) 0:36:59.729 *******
FAILED - RETRYING: Install galera distro packages (5 retries left).
FAILED - RETRYING: Install galera distro packages (4 retries left).
FAILED - RETRYING: Install galera distro packages (3 retries left).
FAILED - RETRYING: Install galera distro packages (2 retries left).
FAILED - RETRYING: Install galera distro packages (1 retries left).
fatal: [infra1_repo_container-55057f82]: FAILED! => {"attempts": 5, "changed": false, "failed": true, "msg": "No package matching 'libmariadbclient-dev' is available"}
```

```
TASK [galera_server : Add galera repo] *****************************************
Friday 16 February 2018 14:37:20 -0600 (0:00:00.921) 1:01:47.812 *******
FAILED - RETRYING: Add galera repo (5 retries left).
ok: [infra3_galera_container-01038d4c]

TASK [galera_server : Add percona repo] ****************************************
Friday 16 February 2018 14:37:27 -0600 (0:00:07.075) 1:01:54.888 *******
ok: [infra3_galera_container-01038d4c]

TASK [galera_server : Preseed galera password(s)] ******************************
Friday 16 February 2018 14:37:28 -0600 (0:00:00.844) 1:01:55.732 *******
changed: [infra3_galera_container-01038d4c] => (item={u'vtype': u'string', u'question': u'mysql-server/root_password', u'name': u'mariadb-server-10.1', u'value': u'***'})
changed: [infra3_galera_container-01038d4c] => (item={u'vtype': u'string', u'question': u'mysql-server/root_password_again', u'name': u'mariadb-server-10.1', u'value': u'***'})

TASK [galera_server : Prevent galera from starting on install] *****************
Friday 16 February 2018 14:37:29 -0600 (0:00:01.332) 1:01:57.064 *******
changed: [infra3_galera_container-01038d4c]

TASK [galera_server : Install galera_server role remote packages (apt)] ********
Friday 16 February 2018 14:37:30 -0600 (0:00:01.271) 1:01:58.335 *******
fatal: [infra3_galera_container-01038d4c]: FAILED! => {"changed": false, "failed": true, "msg": "No package matching 'libmariadbclient-dev' is available"}
```