Solved pkg error : pkg: sqlite error while executing grmbl in file update.c:154: NOT NULL constraint failed: packages.path

On a system with
freebsd-version -kru
14.3-RELEASE-p5
14.3-RELEASE
14.3-RELEASE-p6
pkg --version
2.4.2

I do not see the error.
On
freebsd-version -kru
15.0-RELEASE
15.0-RELEASE
15.0-RELEASE-p1
pkg --version
2.4.2

I see the error doing pkg upgrade -n. But I see a list of packages that would be upgraded. Trying to update one, like firefox fails, and looking at the messages, I'd guess that the metadata associated with FreeBSD-ports repo is the problem.

And yes, frustrating, but honestly just report the problem in the buglist don't get all bent out of shape.
 
I just installed fish, ksh93-devel, neovim and git-lite on a fresh system I installed last night (15.0-RELEASE-p1). So installing new software is still possible, assuming you have a working database. But updating the database with pkg update fails.
 
I just installed fish, ksh93-devel, neovim and git-lite on a fresh system I installed last night (15.0-RELEASE-p1). So installing new software is still possible, assuming you have a working database. But updating the database with pkg update fails.
Note : You cannot install when pkg update is required and you have a working database.
 
Ok...everybody make mistakes,but this is bad
When the problem appears from nothing,when the user dont change anything in the userland and want to install one package
and cannot because sqlite? why? who? when? any announce from fbsd headquarters??

A dejavu?
 
Looks like the schema for the update is incompatible with what's on disk. So the change happened in the repo generation, not on your local system. Should be fixable but propagation across mirrors may take a while.
 
Looks like the schema for the update is incompatible with what's on disk. So the change happened in the repo generation, not on your local system. Should be fixable but propagation across mirrors may take a while.
If you go look at the first post in this thread, OP deleted local sqlite databases and got the error. This supports your hypothesis of "the local version of the pkg command does not understand the metadata in the remote repo" (phrased differently than you but same meaning).
So agree that repo needs to be fixed and propagated.
 
I think the problem occurs because FreeBSD attempts to synchronize a live, complex SQLite database across a global mirror network without a 'staged-and-swapped' verification process.

Unlike Debian Linux or OpenBSD, which seem to ensure repository indices are only made public after the referenced binaries are verified and present, FreeBSD’s current routine seems to allow for a 'race condition'.

During major updates like 15.0, users can download a newly-built database that contains incomplete metadata (such as the NULL path error), simply because the server-side sync hasn't finalized.

If my reasoning is not wrong, in order to prevent this, FreeBSD would need to adopt an atomic deployment model—similar to Debian’s 'pool' logic or OpenBSD’s frozen release sets—where the public repository is never updated 'on-the-fly', but only swapped once a full integrity check is passed.
 
Impacted as well

Code:
doas pkg update
Password:
Updating FreeBSD-ports repository catalogue...
Fetching data.pkg: 100%   10 MiB  10.7MB/s    00:01
Processing entries:  99%
pkg: sqlite error while executing grmbl in file update.c:154: NOT NULL constraint failed: packages.path
pkg: sqlite error while executing grmbl in file update.c:154: NOT NULL constraint failed: packages.path
pkg: sqlite error while executing INSERT OR REPLACE INTO packages (origin, name, version, comment, desc, arch, maintainer, www, prefix, pkgsize, flatsize, licenselogic, cksum, path, manifestdigest, olddigest, vital)VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11, ?12, ?13, ?14, ?15, ?16, ?17) in file update.c:158: not an error
Processing entries:  99%
Unable to update repository FreeBSD-ports
Updating FreeBSD-ports-kmods repository catalogue...
FreeBSD-ports-kmods repository is up to date.
Updating FreeBSD-base repository catalogue...
FreeBSD-base repository is up to date.
Error updating repositories!
 
Yes. But this time it was unrelated. If I chsh to fish shell and log in on the virtual terminal without any graphical session, it prints some noise about waiting for some terminal functionality for 2 seconds or so. When it's run in e.g. foot, it just works. But yes, install -f is the way to go.

Btw, where's time for the next quarterly update? Are updates aligned with calendar quartals?
 
Btw, where's time for the next quarterly update? Are updates aligned with calendar quartals?

The Quarterly branch is cut from HEAD at the beginning of every (yearly) quarter in January, April, July, and October.Branches are named according to the year (YYYY) and quarter (Q1-4) they are created in.


So think it will be soon, but it seems to be a few days at least into the new quarter.
 
and how do I get it.
As far as I understood the problem it was with the package catalogue on the repository servers, nothing local (with the base OS, or your installed ports-mgmt/pkg). So there's nothing for you to do.

You might need to do a pkg update -f in order to refresh your locally cached copy of the catalogue though.
 
Back
Top