Hi,
After the update to 25.7 we face sqlite error on the package database "database disk image is malformed".
Attached please find logs from the update and pkg bootsrap commands.
After backup of /var/db/pkg/local.sqlite its recovery has not succeeded.
Any suggestion would be appreciated.
*************************************************
Updating OPNsense repository catalogue...
OPNsense repository is up to date.
All repositories are up to date.
Updating OPNsense repository catalogue...
OPNsense repository is up to date.
All repositories are up to date.
pkg-static: sqlite error while executing iterator in file pkgdb_iterator.c:1110: database disk image is malformed
Checking for upgrades (0 candidates): . done
Processing candidates (0 candidates): . done
pkg-static: sqlite error while executing END TRANSACTION; in file pkgdb.c:2333: database disk image is malformed
Checking integrity... done (0 conflicting)
Your packages are up to date.
pkg-static: sqlite error while executing iterator in file pkgdb_iterator.c:1110: database disk image is malformed
pkg-static: sqlite error while executing END TRANSACTION; in file pkgdb.c:2333: database disk image is malformed
Checking integrity... done (0 conflicting)
Nothing to do.
pkg-static: sqlite error while executing iterator in file pkgdb_iterator.c:1183: database disk image is malformed
Checking all packages:
pkg-static: sqlite error while executing iterator in file pkgdb_iterator.c:1183: database disk image is malformed
Checking all packages... done
pkg-static: sqlite error while executing iterator in file pkgdb_iterator.c:1110: database disk image is malformed
Nothing to do.
Nothing to do.
Starting web GUI...done.
pkg: sqlite error while executing iterator in file pkgdb_iterator.c:1110: database disk image is malformed
Installation out of date. The update to opnsense-25.7.1_1 is required.
*******************************************
root@OPNsense:~ # pkg bootstrap -f
The package management tool is not yet installed on your system.
Do you want to fetch and install it now? [y/N]: y
Bootstrapping pkg from https://pkg.opnsense.org/FreeBSD:14:amd64/25.7/latest, please wait...
Verifying signature with trusted certificate pkg.opnsense.org.20250710... done
Installing pkg-1.19.2_5...
package pkg is already installed, forced install
pkg-static: sqlite error while executing INSERT OR REPLACE INTO packages( origin, name, version, comment, desc, message, arch, maintainer, www, prefix, flatsize, automatic, licenselogic, time, manifestdigest, dep_formula, vital)VALUES( 'ports-mgmt/pkg', 'pkg', '1.19.2_5', 'Package manager', 'Package management tool', NULL, 'FreeBSD:14:amd64', 'pkg@FreeBSD.org', 'https://github.com/freebsd/pkg';, '/usr/local', 16880765, 0, 1, NOW(), NULL, NULL, 0 ) in file pkgdb.c:1633: database disk image is malformed
Failed to install the following 1 package(s): /tmp//pkg.pkg.8kdK0k
After the update to 25.7 we face sqlite error on the package database "database disk image is malformed".
Attached please find logs from the update and pkg bootsrap commands.
After backup of /var/db/pkg/local.sqlite its recovery has not succeeded.
Any suggestion would be appreciated.
*************************************************
Updating OPNsense repository catalogue...
OPNsense repository is up to date.
All repositories are up to date.
Updating OPNsense repository catalogue...
OPNsense repository is up to date.
All repositories are up to date.
pkg-static: sqlite error while executing iterator in file pkgdb_iterator.c:1110: database disk image is malformed
Checking for upgrades (0 candidates): . done
Processing candidates (0 candidates): . done
pkg-static: sqlite error while executing END TRANSACTION; in file pkgdb.c:2333: database disk image is malformed
Checking integrity... done (0 conflicting)
Your packages are up to date.
pkg-static: sqlite error while executing iterator in file pkgdb_iterator.c:1110: database disk image is malformed
pkg-static: sqlite error while executing END TRANSACTION; in file pkgdb.c:2333: database disk image is malformed
Checking integrity... done (0 conflicting)
Nothing to do.
pkg-static: sqlite error while executing iterator in file pkgdb_iterator.c:1183: database disk image is malformed
Checking all packages:
pkg-static: sqlite error while executing iterator in file pkgdb_iterator.c:1183: database disk image is malformed
Checking all packages... done
pkg-static: sqlite error while executing iterator in file pkgdb_iterator.c:1110: database disk image is malformed
Nothing to do.
Nothing to do.
Starting web GUI...done.
pkg: sqlite error while executing iterator in file pkgdb_iterator.c:1110: database disk image is malformed
Installation out of date. The update to opnsense-25.7.1_1 is required.
*******************************************
root@OPNsense:~ # pkg bootstrap -f
The package management tool is not yet installed on your system.
Do you want to fetch and install it now? [y/N]: y
Bootstrapping pkg from https://pkg.opnsense.org/FreeBSD:14:amd64/25.7/latest, please wait...
Verifying signature with trusted certificate pkg.opnsense.org.20250710... done
Installing pkg-1.19.2_5...
package pkg is already installed, forced install
pkg-static: sqlite error while executing INSERT OR REPLACE INTO packages( origin, name, version, comment, desc, message, arch, maintainer, www, prefix, flatsize, automatic, licenselogic, time, manifestdigest, dep_formula, vital)VALUES( 'ports-mgmt/pkg', 'pkg', '1.19.2_5', 'Package manager', 'Package management tool', NULL, 'FreeBSD:14:amd64', 'pkg@FreeBSD.org', 'https://github.com/freebsd/pkg';, '/usr/local', 16880765, 0, 1, NOW(), NULL, NULL, 0 ) in file pkgdb.c:1633: database disk image is malformed
Failed to install the following 1 package(s): /tmp//pkg.pkg.8kdK0k
"