Zypper error "rpmpkg: detected non-zero blob, trying auto repair"

I tried to do a zypper dup today and it failed on about 5% of the packages with the error “rpmpkg: detected non-zero blob, trying auto repair”. I tried refreshing, cleaning, re-downloading, and installing the packages individually, but nothing seems to work. The broken packages include essentials like kernel-default.


localhost:/ # zypper ref
Repository 'Main Repository (NON-OSS)' is up to date.                                                                      
Repository 'Main Repository (OSS)' is up to date.                                                                          
Repository 'Main Update Repository' is up to date.                                                                         
All repositories have been refreshed.
localhost:/ # zypper clean
All repositories have been cleaned up.
localhost:/ # uname -a
Linux localhost 5.5.9-1-default #1 SMP Thu Mar 12 06:33:05 UTC 2020 (70a6377) x86_64 x86_64 x86_64 GNU/Linux
localhost:/ # zypper in kernel-default
Loading repository data...
Reading installed packages...
Resolving package dependencies...

The following NEW package is going to be installed:
  kernel-default-5.6.12-1.3

The following package requires a system reboot:
  kernel-default-5.6.12-1.3

1 new package to install.
Overall download size: 77.3 MiB. Already cached: 0 B. After the operation, additional 164.5 MiB will be used.

    Note: System reboot required.
Continue? [y/n/v/...? shows all options] (y): 
Retrieving package kernel-default-5.6.12-1.3.x86_64                                   (1/1),  77.3 MiB (164.5 MiB unpacked)
Retrieving: kernel-default-5.6.12-1.3.x86_64.rpm ........................................................[done (1.6 MiB/s)]

Checking for file conflicts: ........................................................................................[done]
(1/1) Installing: kernel-default-5.6.12-1.3.x86_64 .................................................................[error]
Installation of kernel-default-5.6.12-1.3.x86_64 failed:
Error: Subprocess failed. Error: RPM failed: warning: rpmpkg: detected non-zero blob, trying auto repair
error: kernel-default-5.6.12-1.3.x86_64: install failed

Abort, retry, ignore? [a/r/i] (a): 

Below you can see the size and various hashes of the file. As far as I can tell, the RPM itself is not corrupted. I get the same exact file when I download from another system; URL https://download.opensuse.org/repositories/openSUSE:/Factory/standard/x86_64/kernel-default-5.6.12-1.3.x86_64.rpm


localhost:/ # ls -la /var/cache/zypp/packages/download.opensuse.org-oss/x86_64/kernel-default-5.6.12-1.3.x86_64.rpm 
-rw-r--r-- 1 root root 81004652 May 20 14:35 /var/cache/zypp/packages/download.opensuse.org-oss/x86_64/kernel-default-5.6.12-1.3.x86_64.rpm
localhost:/ # sha1sum /var/cache/zypp/packages/download.opensuse.org-oss/x86_64/kernel-default-5.6.12-1.3.x86_64.rpm 
2c64205e563cfab9561970f2d70c1d0f3ad8ae82  /var/cache/zypp/packages/download.opensuse.org-oss/x86_64/kernel-default-5.6.12-1.3.x86_64.rpm
localhost:/ # sha256sum /var/cache/zypp/packages/download.opensuse.org-oss/x86_64/kernel-default-5.6.12-1.3.x86_64.rpm 
7634949ec5c0fd8e20c09c93b1b3b3e26518a423073486592431bd9c1790bb63  /var/cache/zypp/packages/download.opensuse.org-oss/x86_64/kernel-default-5.6.12-1.3.x86_64.rpm
localhost:/ # sha512sum /var/cache/zypp/packages/download.opensuse.org-oss/x86_64/kernel-default-5.6.12-1.3.x86_64.rpm 
ff13d625ebbae8733d1d35af80c008fee77391d3b0c2814f05c6b8e4e1c1a4664b418655e8b4db8ae11048baf7e9d5f855fa289c5c45a3383d9bbc09c4c553f8  /var/cache/zypp/packages/download.opensuse.org-oss/x86_64/kernel-default-5.6.12-1.3.x86_64.rpm
localhost:/ # md5sum /var/cache/zypp/packages/download.opensuse.org-oss/x86_64/kernel-default-5.6.12-1.3.x86_64.rpm 
482760d1cc197c9d6c0d03836fbdb7b9  /var/cache/zypp/packages/download.opensuse.org-oss/x86_64/kernel-default-5.6.12-1.3.x86_64.rpm
localhost:/ # rpm -i /var/cache/zypp/packages/download.opensuse.org-oss/x86_64/kernel-default-5.6.12-1.3.x86_64.rpm 
warning: rpmpkg: detected non-zero blob, trying auto repair
error: kernel-default-5.6.12-1.3.x86_64: install failed
localhost:/ # 

SOLUTION:

rpm --rebuilddb

How I found that:
0. Found the RPM in the zypper cache and attempt manual installation (rpm -i …) which failed with the same error.

  1. Run strace on the RPM install command:
strace rpm -i /var/cache/zypp/packages/download.opensuse.org-oss/x86_64/kernel-default-5.6.12-1.3.x86_64.rpm  > kdefaulterr.txt 2>&1
  1. Looked at the big output file for the error message near the bottom:
write(2, "rpmpkg: detected non-zero blob, "..., 51rpmpkg: detected non-zero blob, trying auto repair
) = 51
  1. Looked for the system calls immediately before that that would tell me what non zero blob it was reading:
pread64(4, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 65536, 180039648) = 65536
pread64(4, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 65536, 180105184) = 61472
  1. These were reading file handle 4. Looked back for which file handle number 4 was. (search for " = 4" at the end of a line) Near the beginning you find it:
openat(AT_FDCWD, "/usr/lib/sysimage/rpm/Packages.db", O_RDWR) = 4
  1. So this means the /usr/lib/sysimage/rpm/Packages.db file isn’t as expected. Google shows this is the RPM DB and can be rebuilt with rpm --rebuilddb
1 Like

I have never run into this problem. I’m glad that you found a solution. And thanks for reporting it.

1 Like

Thank you for the solution. That solved my problem.