Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-14486

sqlite3 /var/lib/rpm/rpmdb.sqlite 'pragma integrity_check;' removes the "rpmdb.sqlite-shm" and "rpmdb.sqlite-wal" files

Linking RHIVOS CVEs to...Migration: Automation ...SWIFT: POC ConversionSync from "Extern...XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not a Bug
    • Icon: Minor Minor
    • None
    • rhel-9.2.0
    • rpm
    • None
    • None
    • Moderate
    • rhel-swm
    • ssg_core_services
    • None
    • False
    • False
    • Hide

      None

      Show
      None
    • None
    • Red Hat Enterprise Linux
    • None
    • None
    • None
    • None

      What were you trying to do that didn't work?

       

      sqlite3 /var/lib/rpm/rpmdb.sqlite 'pragma integrity_check;'

      This command deletes the "rpmdb.sqlite-shm" and "rpmdb.sqlite-wal" files

      Please provide the package NVR for which bug is seen:

      rpm-4.16.1.3-22.el9.x86_64

      How reproducible:

      Everytime

      Steps to reproduce

      [root@r9 rpm]# pwd
      /var/lib/rpm

      [root@r9 rpm]# ls
      rpmdb.sqlite rpmdb.sqlite-shm rpmdb.sqlite-wal

      [root@r9 rpm]# sqlite3 /var/lib/rpm/rpmdb.sqlite 'pragma integrity_check;'
      ok

      [root@r9 rpm]# ls
      rpmdb.sqlite

      [root@r9 rpm]# su - user
      Last login: Mon Oct 23 15:26:56 EDT 2023 on pts/0

      [user@r9 ~]$ rpm -qa
      error: sqlite failure: CREATE TABLE IF NOT EXISTS 'Packages' (hnum INTEGER PRIMARY KEY AUTOINCREMENT,blob BLOB NOT NULL): attempt to write a readonly database
      error: cannot open Packages index using sqlite - No such file or directory (2)
      error: cannot open Packages database in /var/lib/rpm

      Expected Results

      These files should not be deleted or they should be recreated immediately. Without them non-privileged users can not read the database

      Actual Results

      The files are removed until a privileged user runs an rpm command which regenerates them.

              packaging-team-maint packaging-team-maint
              rhn-support-jcastran John Castranio
              packaging-team-maint packaging-team-maint
              Software Management QE Software Management QE
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: