Topic: “requested datatype primary not available” when adding Remi repos
Hello everyone,
This question was originally posted at SuperUser: https://superuser.com/questions/1495051 … positories
But since nobody can answer there, I am going to repeat it here
In our daily autotests we install PHP 7.3 from Remi's repository using Ansible. Usually it works fine, but sometimes (few times a month) it fails with the error like below:
fatal: [vm1.int.zone]: FAILED! => {
"changed": false,
"invocation": {
"module_args": {
"allow_downgrade": false,
"conf_file": null,
"disable_gpg_check": false,
"disable_plugin": [],
"disablerepo": null,
"enable_plugin": [],
"enablerepo": "epel,remi,remi-php73",
"exclude": null,
"install_repoquery": true,
"installroot": "/",
"list": null,
"name": [
"php",
"php-mcrypt",
"php-mbstring",
"php-xml",
"php-xsl",
"php-xmlrpc",
"php-pdo",
"php-cli",
"php-pgsql",
"php-pspell",
"php-pecl-ssh2",
"php-pecl-zip",
"php-smbclient",
"php-intl",
"php-mysql",
"php-curl",
"php-xdebug",
"php-process"
],
"security": false,
"skip_broken": false,
"state": "installed",
"update_cache": false,
"update_only": false,
"validate_certs": true
}
},
"msg": "Failure talking to yum: requested datatype primary not available"
There are 3 Remi repos:
# ll -d /var/cache/yum/x86_64/7/remi*
drwxr-xr-x 4 root root 4096 Oct 22 22:12 /var/cache/yum/x86_64/7/remi
drwxr-xr-x 4 root root 4096 Oct 22 22:12 /var/cache/yum/x86_64/7/remi-php73
drwxr-xr-x 4 root root 4096 Oct 22 22:12 /var/cache/yum/x86_64/7/remi-safe
and any of these cause the problem if running certain yum commands, for example:
# yum repolist
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror2.int.zone
* epel: mirror2.int.zone
* extras: mirror2.int.zone
* remi-safe: mirror.serverion.com
* updates: mirror2.int.zone
Error: requested datatype primary not available
If disable Remi's repos, everything goes fine. The problem is in broken cache for Remi's repository, for example:
# ll /var/cache/yum/x86_64/7/remi-php73/
total 20
-rw-r--r-- 1 root root 0 Oct 22 22:12 cachecookie
drwxr-xr-x 2 root root 4096 Oct 22 22:12 gen
-rw-r--r-- 1 root root 2996 Oct 22 22:12 mirrorlist.txt
drwxr-xr-x 2 root root 4096 Oct 22 22:12 packages
-rw-r--r-- 1 root root 2259 Oct 22 22:12 repomd.xml
# ll /var/cache/yum/x86_64/7/remi-php73/gen/
total 0
Usually, this directory looks like this:
# ll /var/cache/yum/x86_64/7/remi-php73/
total 232
-rw-r--r-- 1 root root 211219 Oct 22 14:03 7042a64df80e22496ef9a31990242357a84898e0f0272915cf7cce20b705d863-primary.sqlite.bz2
-rw-r--r-- 1 root root 0 Oct 23 04:24 cachecookie
drwxr-xr-x 2 root root 4096 Oct 23 04:24 gen
-rw-r--r-- 1 root root 2996 Oct 23 04:24 mirrorlist.txt
drwxr-xr-x 2 root root 4096 Oct 23 04:25 packages
-rw-r--r-- 1 root root 3095 Oct 22 14:03 repomd.xml
# ll /var/cache/yum/x86_64/7/remi-php73/gen/
total 996
-rw-r--r-- 1 root root 1015808 Oct 22 14:03 primary_db.sqlite
So the files {long_id}-primary.sqlite.bz2 and gen/primary_db.sqlite are missing for some reason sometimes.
yum makecache recreates the cache and fixes the issue.
The question is what can be a reason of this?
Thank you!