Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qubes-vm-update fails on recent fedora-41-xfce templates - history.sqlite not initialized #9744

Closed
marmarek opened this issue Jan 29, 2025 · 0 comments · Fixed by QubesOS/qubes-builder-rpm#143
Labels
affects-4.2 This issue affects Qubes OS 4.2. affects-4.3 This issue affects Qubes OS 4.3. C: Fedora C: updates diagnosed Technical diagnosis has been performed (see issue comments). P: major Priority: major. Between "default" and "critical" in severity. pr submitted A pull request has been submitted for this issue. updates testing Issue regarding an update that is currently in testing. Triage before migrating update to stable.

Comments

@marmarek
Copy link
Member

Qubes OS release

Qubes OS 4.2, Qubes OS 4.3

Brief summary

Update of a recent fedora-41-xfce template fails

Steps to reproduce

  1. Install most recent fedora-41-xfce template from the testing repo (older templates do not have this issue)
  2. Try to update it with qubes-vm-update tool

Expected behavior

Update proceeds normally

Actual behavior

The update fails with:

fedora-41-xfce:out: Refreshing package info
fedora-41-xfce:err: History database is not writable: SQLite error on "/var/lib/dnf/history.sqlite": Executing an SQL statement failed: no such table: config
fedora-41-xfce:err: History database is not writable: SQLite error on "/var/lib/dnf/history.sqlite": Executing an SQL statement failed: no such table: config
fedora-41-xfce:err: SQLite error on "/var/lib/dnf/history.sqlite": Executing an SQL statement failed: no such table: config

Additional information

qubes-vm-update uses python DNF API, which I think still uses DNF4. DNF4 uses /var/lib/dnf/history.sqlite, while DNF5 uses /usr/lib/sysimage/libdnf5/transaction_history.sqlite. The structure looks similar, but definitely not the same.

@marmarek marmarek added C: updates P: major Priority: major. Between "default" and "critical" in severity. updates testing Issue regarding an update that is currently in testing. Triage before migrating update to stable. labels Jan 29, 2025
marmarek added a commit to marmarek/qubes-builder-rpm that referenced this issue Jan 29, 2025
Do not leave uninitialized history.sqlite in the template. When it
doesn't exist, dnf will create it with the proper structure. But when it
exists, it will expect its tables to exist already. Empty sqlite file
(just headers) breaks this assumption resulting in update errors like:

fedora-41-xfce:out: Refreshing package info
fedora-41-xfce:err: History database is not writable: SQLite error on "/var/lib/dnf/history.sqlite": Executing an SQL statement failed: no such table: config
fedora-41-xfce:err: History database is not writable: SQLite error on "/var/lib/dnf/history.sqlite": Executing an SQL statement failed: no such table: config
fedora-41-xfce:err: SQLite error on "/var/lib/dnf/history.sqlite": Executing an SQL statement failed: no such table: config

The history.sqlite with just headers has 4096 bytes. Properly
initialized one over 100k. To be on the conservative side, set the
threshold at 8k - if it's smaller - remove it (together with sqlite's
side files).

Fixes QubesOS/qubes-issues#9744
@andrewdavidwong andrewdavidwong added affects-4.2 This issue affects Qubes OS 4.2. affects-4.3 This issue affects Qubes OS 4.3. diagnosed Technical diagnosis has been performed (see issue comments). pr submitted A pull request has been submitted for this issue. C: Fedora labels Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-4.2 This issue affects Qubes OS 4.2. affects-4.3 This issue affects Qubes OS 4.3. C: Fedora C: updates diagnosed Technical diagnosis has been performed (see issue comments). P: major Priority: major. Between "default" and "critical" in severity. pr submitted A pull request has been submitted for this issue. updates testing Issue regarding an update that is currently in testing. Triage before migrating update to stable.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants