2

On rare occasions, after running yum update one or more packages gets installed with 0 size files and the problem gets fixed after reinstalling the affected package.

I would have believe an external factor but the timestamp is always the same with the installed package.

I'm using Oracle Linux 7.9

uname -r
5.4.17-2102.200.13.el7uek.x86_64

rpm -q rpm --last
rpm-4.11.3-48.el7_9.x86_64                    Sun 05 Jun 2022 05:07:48 AM UTC

rpm -q yum --last
yum-3.4.3-168.0.3.el7.noarch                  Fri 21 May 2021 02:23:50 PM UTC

Eg.:

# showing the last transaction
rpm -q gzip --last
gzip-1.5-11.el7_9.x86_64                      Sat 13 Aug 2022 05:30:27 AM UTC

# showing information for the file size and timestamp
stat /usr/bin/gzip
  File: ‘/usr/bin/gzip’
  Size: 0           Blocks: 0          IO Block: 4096   regular empty file
Device: fd01h/64769d    Inode: 50463530    Links: 1
Access: (0755/-rwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2022-08-17 07:18:10.066983772 +0000
Modify: 2022-05-11 17:23:29.000000000 +0000
Change: 2022-08-13 05:30:27.680595054 +0000
 Birth: -

# validating package integrity shows that size and the MD5 sum differs from rpmdb.
rpm -V gzip
S.5......    /usr/bin/gunzip
S.5......    /usr/bin/gzexe
S.5......    /usr/bin/gzip
S.5......    /usr/bin/zcat
S.5......    /usr/bin/zcmp
S.5......    /usr/bin/zdiff
S.5......    /usr/bin/zegrep
S.5......    /usr/bin/zfgrep
S.5......    /usr/bin/zforce
S.5......    /usr/bin/zgrep
S.5......    /usr/bin/zless
S.5......    /usr/bin/zmore
S.5......    /usr/bin/znew
S.5......  d /usr/share/doc/gzip-1.5/AUTHORS
S.5......  d /usr/share/doc/gzip-1.5/ChangeLog
S.5......  d /usr/share/doc/gzip-1.5/NEWS
S.5......  d /usr/share/doc/gzip-1.5/README
S.5......  d /usr/share/doc/gzip-1.5/THANKS
S.5......  d /usr/share/doc/gzip-1.5/TODO
S.5......  d /usr/share/info/gzip.info.gz
S.5......  d /usr/share/man/man1/gunzip.1.gz
S.5......  d /usr/share/man/man1/gzexe.1.gz
S.5......  d /usr/share/man/man1/gzip.1.gz
S.5......  d /usr/share/man/man1/zcat.1.gz
S.5......  d /usr/share/man/man1/zcmp.1.gz
S.5......  d /usr/share/man/man1/zdiff.1.gz
S.5......  d /usr/share/man/man1/zforce.1.gz
S.5......  d /usr/share/man/man1/zgrep.1.gz
S.5......  d /usr/share/man/man1/zless.1.gz
S.5......  d /usr/share/man/man1/zmore.1.gz
S.5......  d /usr/share/man/man1/znew.1.gz

This is the yum update log, I've redacted the other packages:

    Loaded plugins: fastestmirror, product-id, search-disabled-repos, subscription-
              : manager

Loading mirror speeds from cached hostfile

foreman-private-oracle-latest                              | 2.1 kB     00:00       

Resolving Dependencies
--> Running transaction check
---> Package gzip.x86_64 0:1.5-10.el7 will be updated
---> Package gzip.x86_64 0:1.5-11.el7_9 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
Package      Arch   Version            Repository                         Size
================================================================================
Updating:
gzip         x86_64 1.5-11.el7_9       foreman-private-oracle-latest 129 k

Transaction Summary
================================================================================
Upgrade  132 Packages

Total download size: 305 M
Downloading packages:
No Presto metadata available for foreman-private-oracle-latest

(37/132): gzip-1.5-11.el7_9.x86_64.rpm                     | 129 kB   00:00     

--------------------------------------------------------------------------------
Total                                               24 MB/s | 305 MB  00:12     

Running transaction check

Running transaction test

Transaction test succeeded
Running transaction
  Updating   : gzip-1.5-11.el7_9.x86_64                        36/264 
  Cleanup    : gzip-1.5-10.el7.x86_64                                   227/264 
  Verifying  : gzip-1.5-11.el7_9.x86_64                                  65/264 
  Verifying  : gzip-1.5-10.el7.x86_64                                   157/264 

Updated:                                    
  gzip.x86_64 0:1.5-11.el7_9  
2
  • A (ongoing) filesystem corruption due to e.g. power outage? RPM doesn't do that. I've been using RPM/YUM/DNF for over 25 years now - never seen anything like that. Check journalctl for anything unusual. Aug 17, 2022 at 12:08
  • Power outage is excluded as I'm running it on AWS EC2, and I've seen this happening on different machines with different packages. I will be enabling audits on files, as logs do not show anything unusual.
    – Mihail
    Aug 17, 2022 at 13:01

1 Answer 1

1

Found the problem so I am answering my own question.

Run "sync" before reboot.

Turns out that Oracle Linux 7.9 is not working happily with AWS API reboots. The updater tool that I was using, did two steps: yum update and reboot from AWS API. Doing this, the kernel did not have time to sync all data buffered in memory out to disk, so the newly created files either were not saved at all or had size 0 with no content in it.

This problem only occurs when doing the reboot process from AWS API, as it doesn't reproduce with OS reboot command.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .