Bug 15560

Summary: Corrupt sqlite database in CVE updates
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Ross Burton <ross.burton>
Component: coreAssignee: Yoann Congal <yoann.congal>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: Medium+ CC: meta.mr.watcher, meta.watcher, randy.macleod, richard.purdie, rybczynska, steve, tim.orling, yoann.congal
Version: 5.0.18   
Target Milestone: 5.0.22   
Hardware: x86   
OS: Multiple   
See Also: https://bugzilla.yoctoproject.org/show_bug.cgi?id=15660
Whiteboard: AB-INT
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Ross Burton 2024-07-24 12:54:23 UTC
We're seeing occasional failures when updating the CVE database due to sqlite corruption:

File: '/home/pokybuild/yocto-worker/oe-selftest-ubuntu/build/meta/classes/cve-check.bbclass', lineno: 344, function: check_cves
     0340:            vendor = "%"
     0341:
     0342:        # Find all relevant CVE IDs.
     0343:        cve_cursor = conn.execute("SELECT DISTINCT ID FROM PRODUCTS WHERE PRODUCT IS ? AND VENDOR LIKE ?", (product, vendor))
 *** 0344:        for cverow in cve_cursor:
     0345:            cve = cverow[0]
     0346:
     0347:            if cve in cve_ignore:
     0348:                bb.note("%s-%s ignores %s" % (product, pv, cve))
Exception: sqlite3.DatabaseError: database disk image is malformed

https://autobuilder.yoctoproject.org/typhoon/#/builders/87/builds/6974
Comment 1 Steve Sakoman 2024-08-01 14:54:13 UTC
kirkstone:

https://autobuilder.yoctoproject.org/typhoon/#/builders/87/builds/7019/steps/14/logs/stdio
oe-selftest-ubuntu ubuntu2204-ty-1
Comment 2 Randy MacLeod 2024-08-08 14:39:00 UTC
There's a patch to copy the sqlite file from NFS to a local FS.
Waiting to see if that fixes the problem...
Comment 3 Richard Purdie 2024-08-22 14:56:42 UTC
We're going to assume this fixes it: https://git.yoctoproject.org/poky/commit/?id=0731d49014cae5615c434534554f670090a519f9
Comment 4 Yoann Congal 2026-06-23 09:40:15 UTC
oe-selftest-armhost ubuntu2404-vk-arm1 scarthgap completed at 2026-06-23 09:31:22+00:00
https://autobuilder.yoctoproject.org/valkyrie/#/builders/23/builds/4183

Reopening and attributing to me to track the backporting of the alleged fix:
cve_check: Use a local copy of the database during builds
https://git.yoctoproject.org/poky/commit/?id=0731d49014cae5615c434534554f670090a519f9
Comment 5 Randy MacLeod 2026-07-30 15:08:52 UTC
Need to backport commit in to EOL releases that are still being used to generate metrics

https://bugzilla.yoctoproject.org/show_bug.cgi?id=15560#c3

and one other commit...
Comment 6 Yoann Congal 2026-07-30 23:26:05 UTC
I've sent patches:
* [OE-core][dunfell 0/2] Pull request
  https://lore.kernel.org/openembedded-core/cover.1785450470.git.yoann.congal@smile.fr/T/#t
* [OE-core][kirkstone 0/1] Pull request
  https://lore.kernel.org/openembedded-core/cover.1785453214.git.yoann.congal@smile.fr/T/#t
* scarthgap, whinlatter & wrynose already have the patches.

Per https://git.yoctoproject.org/yocto-autobuilder2/tree/schedulers.py#n677 those are the only stable that run metrics.