I have a weird issue with pacman and database signatures.
The default pacman.conf reads (partially) - in fact I cannot remember it has been different
# By default, pacman accepts packages signed by keys that its local keyring
# trusts (see pacman-key and its man page), as well as unsigned packages.
SigLevel = Optional DatabaseOptional
LocalFileSigLevel = Optional
#RemoteFileSigLevel = Required
In the repo there is no .db.sig file so the file cannot be downloaded from the mirror but for some time now I have been having issues like this
â sync sudo pacman -Syu
:: Synchronizing package databases...
core 165,8 KiB 54,0 MiB/s 00:00 [########################################################################################] 100%
core.sig 1057,0 B 0,00 B/s 00:00 [########################################################################################] 100%
error: GPGME error: No data
error: failed to update core (invalid or corrupted database (PGP signature))
Clearing the sync folder and rerunning pacman -Syu
gives the above errors and the sync folder is populated with db.sig files which has no correlation to pacage databases.
They all have the same size and the same timestamp?
On further investigation the sig files is the 404 html file send in response to the request for the non existing files
â ~ ls /var/lib/pacman/sync -l
total 9092
-rw-r--r-- 1 root root 6882304 28 feb 09:01 community.db
-rw-r--r-- 1 root root 1057 17 jan 11:22 community.db.sig
-rw-r--r-- 1 root root 169795 27 feb 23:52 core.db
-rw-r--r-- 1 root root 1057 17 jan 11:22 core.db.sig
-rw-r--r-- 1 root root 2045061 27 feb 23:52 extra.db
-rw-r--r-- 1 root root 1057 17 jan 11:22 extra.db.sig
-rw-r--r-- 1 root root 185670 27 feb 23:52 multilib.db
-rw-r--r-- 1 root root 1057 17 jan 11:22 multilib.db.sig
This problem can be made go away by setting the SigLevel to
SigLevel = Optional DatabaseNever
That approach is a cure but not a solution.
- The issue is new and it appears on my pinephone as well as my various computers.
My first record of the issue is Update archive corrupted - #7 by linux-aarhus from January 22
There is a similar issue here Pacman -Syyu error: GPGME error: No data and failed to update due to invalid or corrupted database but apparently this could be solved by running an update using a different mirror? - Why is there suddenly db.sig files in the sync folder - where there is usually none?
- In my mirror log I see frequent requests from clients using pacman/5.2.x and Pamac/10.x requesting the signature files but none exist - they are responded to as 404.
- When I build ISO the buildiso script fails because pacman fails when pulling databases and only by editing the buildiso versions of pacman.conf (/usr/share/manjaro-tools) I can successfully build ISO.
Partial content listing of the mirrorâs unstable â core â x86_64 folder
â x86_64 ls -l core*
lrwxrwxrwx 1 root http 14 Jan 5 2020 core.db -> core.db.tar.gz
-rwxr-xr-x 1 root root 169791 Feb 28 14:04 core.db.tar.gz
lrwxrwxrwx 1 root http 17 Jan 5 2020 core.files -> core.files.tar.gz
-rwxr-xr-x 1 root root 1615995 Feb 28 14:04 core.files.tar.gz
This occurs both with pacman 6.0-alpha and pacman 5.2
â sync pacman --version
.--. Pacman v5.2.2 - libalpm v12.0.2
/ _.-' .-. .-. .-. Copyright (C) 2006-2020 Pacman Development Team
\ '-. '-' '-' '-' Copyright (C) 2002-2006 Judd Vinet
'--'
This program may be freely redistributed under
the terms of the GNU General Public License.
What is going on?
Is this by any chance connected to the change made in pacman 5.2 regarding delta packages which according to Allan McRae created security issue?
If it is - why is it only surfacing after more than a year?
We have completely removed support for delta packages. This was a massively underused feature, usually made updates slower for a slight saving on bandwidth, and had a massive security hole. Essentially, a malicious package database in combination with delta packages could run arbitrary commands on your system. This would be less of an issue if a certain Linux distro signed their package databases⌠Anyway, on balance I judged it better to remove this feature altogether. - Pacman 5.2 Release | Allan McRae
I think I will take a look at my mirror script - see if something hides there.
Nope - nothing there - if the db.sig files exist the primary mirror is not providing them.
rsync -rtlvH --safe-links \
--bwlimit=${BWLIMIT} \
--delete-after --progress \
-h ${QUIET} --timeout=300 --contimeout=120 -p \
--delay-updates --no-motd \
--temp-dir="${TMP}" \
${SOURCE} \
"${TARGET}"
This leads back to the questions
- why has pacman begun to create .db.sig files?
- why it is requesting sig files from the mirror?
Partial mirror log
...
2021/02/28 14:12:45 [error] 609#609: *909 open() "xxxx/manjaro/stable/multilib/x86_64/multilib.files.sig" failed (2: No such file or directory), client: 93.185.26.xx, server: uex.dk, request: "GET /xxxx/manjaro/stable/multilib/x86_64/multilib.files.sig HTTP/1.1", host: "www.uex.dk"
2021/02/28 14:12:50 [error] 609#609: *922 open() "xxxx/manjaro/stable/extra/x86_64/extra.db.sig" failed (2: No such file or directory), client: 98.128.181.xx, server: uex.dk, request: "GET /xxxx/manjaro/stable/extra/x86_64/extra.db.sig HTTP/1.1", host: "www.uex.dk"
2021/02/28 14:12:50 [error] 609#609: *922 open() "xxxx/manjaro/stable/multilib/x86_64/multilib.db.sig" failed (2: No such file or directory), client: 98.128.181.xx, server: uex.dk, request: "GET /xxxx/manjaro/stable/multilib/x86_64/multilib.db.sig HTTP/1.1", host: "www.uex.dk"
2021/02/28 14:12:55 [error] 609#609: *926 open() "xxxx/manjaro/arm-unstable/core/aarch64/core.db.sig" failed (2: No such file or directory), client: 94.31.84.xx, server: uex.dk, request: "GET /xxxx/manjaro/arm-unstable/core/aarch64/core.db.sig HTTP/1.1", host: "www.uex.dk"
...
2021/02/28 14:13:19 [error] 609#609: *936 open() "xxxx/manjaro/stable/extra/x86_64/extra.db.sig" failed (2: No such file or directory), client: 98.128.181.xx, server: uex.dk, request: "GET /xxxx/manjaro/stable/extra/x86_64/extra.db.sig HTTP/1.1", host: "www.uex.dk"
2021/02/28 14:13:19 [error] 609#609: *936 open() "xxxx/manjaro/stable/multilib/x86_64/multilib.db.sig" failed (2: No such file or directory), client: 98.128.181.xx, server: uex.dk, request: "GET /xxxx/manjaro/stable/multilib/x86_64/multilib.db.sig HTTP/1.1", host: "www.uex.dk"
2021/02/28 14:13:24 [error] 609#609: *927 open() "xxxx/manjaro/stable/community/x86_64/community.db.sig" failed (2: No such file or directory), client: 82.203.162.xx, server: uex.dk, request: "GET /xxxx/manjaro/stable/community/x86_64/community.db.sig HTTP/1.1", host: "www.uex.dk"
2021/02/28 14:13:25 [error] 609#609: *927 open() "xxxx/manjaro/stable/multilib/x86_64/multilib.db.sig" failed (2: No such file or directory), client: 82.203.162.xx, server: uex.dk, request: "GET /xxxx/manjaro/stable/multilib/x86_64/multilib.db.sig HTTP/1.1", host: "www.uex.dk"
2021/02/28 14:13:28 [error] 609#609: *938 open() "xxxx/manjaro/stable/extra/x86_64/extra.db.sig" failed (2: No such file or directory), client: 98.128.181.xx, server: uex.dk, request: "GET /xxxx/manjaro/stable/extra/x86_64/extra.db.sig HTTP/1.1", host: "www.uex.dk"
2021/02/28 14:13:28 [error] 609#609: *938 open() "xxxx/manjaro/stable/multilib/x86_64/multilib.db.sig" failed (2: No such file or directory), client: 98.128.181.xx, server: uex.dk, request: "GET /xxxx/manjaro/stable/multilib/x86_64/multilib.db.sig HTTP/1.1", host: "www.uex.dk"
...