Solved pkg: sqlite error while executing INSERT INTO files (path, sha256, package_id) VALUES (…) in file pkgdb.c:1825: database disk image is malformed

FreeBSD 13.0-RELEASE-p2. Malformation arose whilst testing UFS file system resilience.

pkg: sqlite error while executing INSERT INTO files (path, sha256, package_id) VALUES (?1, ?2, ?3) in file pkgdb.c:1825: database disk image is malformed

Re: <https://github.com/freebsd/pkg/issues/633> (2013) I removed /var/db/pkg/repo-FreeBSD.sqlite, this does not resolve the issue. I see three other files:
  1. FreeBSD.meta
  2. local.sqlite
  3. local.sqlite-journal
Is it save to (also) remove local.sqlite and its journal?

With reference to a 2021-03-12 commit:

<https://github.com/freebsd/pkg/blob/cd8f896d23d55516737f5886a7f69a6e1cc3c77d/libpkg/pkgdb.c#L1825>
 

Attachments

  • 2021-06-17 17-27 typescript.txt
    4.4 KB · Views: 83
build it from source or jus fetch the package manually with fetch and extract it to tmp and run from there
if you build from ports do not make install and run it from work/stage/...
 
… fetch the package manually with fetch and extract it to tmp and run from there …

… "libedit.so.0" not found …

I did previously also extract libedit to /tmp

… if you build from ports do not make install …

make build succeeded then I ran /usr/ports/databases/sqlite3/work/stage/usr/local/bin/sqlite3 but commands such as .help and .quit don't work, so I shouldn't trust it to fix a database. on the database. .selftest following .recover found the database still malformed.

Solution
I decided to remove the database and not worry about it. I plan to push this machine to breaking point, it's all disposable.
 
Back
Top