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

Well for one, one corrupting package , can bring the whole pkg infracture down, by corrupting the sqlite database, which is bad.
Second somehow it was pushed on the servers without verifying, which is bad.
Third people on quarterly could not upgrade their packages for one day, which is bad.

But hey, some Microsoft automatic upgrades, teared down thousands of servers , not booting anymore , which is more than bad.
And kernel & base of FreeBSD where not affected. Installed ports where not affected.

- 1) Maybe pkg should do more checks on it's incoming data
- 2) Checks on it's storage.
- 3) Pushing databases on the servers should be verified.

But this is only my wild gues :))
 
The cause of the issue is giving me lots of broken INDEX vibes. But I also think pkg(8) itself could perhaps do some sanity checks because apparently it'll happily import a corrupted catalogue and muck up the database.
 
The timeline is also interesting. At 12'o clock my bug report entered mailing lists. At 15 'o clock that's only 3 hours later a fix was already available. Then it took one day to be pushed to the servers.
I guess, only wild guess, dev will put in additional checks. Resulting is slow pkg become a bit slower, but we can't have it all in life :)
 
Sidenote, i stopped using gentoo/redcore linux because of too many cyclic redundancies and conflicting versions of packages being pulled in. It became one hell. Pkg works much better.
 
on 13.5-RELEASE-p8 / FreeBSD 13.5-RELEASE-p6 FreeBSD 13.5-RELEASE-p6 GENERIC arm64, `pkg update` still gives me the errors from OP. Are arm64 mirrors propagating more slowly or is the issue still unfixed?
 
Easy to find out do a pkg install PACKAGE_XXX.
Never mind what is written on screen .. cannot elaborate here.
If PACKAGE_XXX get installed everything is fine.
 
Easy to find out do a pkg install PACKAGE_XXX.
Never mind what is written on screen .. cannot elaborate here.
If PACKAGE_XXX get installed everything is fine.
If I understand you correctly, everything is not fine for me:

Code:
# pkg install tmux
Updating FreeBSD repository catalogue...
Fetching meta.conf: 100%    179 B   0.2kB/s    00:01   
Fetching data.pkg: 100%   10 MiB  10.3MB/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
Error updating repositories!
 
It looks like the issue is still there on ARM64 with FreeBSD-ports/quarterly, while FreeBSD-ports/latest seems to be fine.


I can confirm that is the case on my ARM64 systems.With latest

```
root@pigate:~ # pkg repos
FreeBSD-ports: {
url : "pkg+https://pkg.freebsd.org/FreeBSD:15:aarch64/latest",
enabled : yes,
priority : 0,
mirror_type : "SRV",
signature_type : "FINGERPRINTS",
fingerprints : "/usr/share/keys/pkg"
}
FreeBSD-ports-kmods: {
url : "pkg+https://pkg.freebsd.org/FreeBSD:15:aarch64/kmods_quarterly_0",
enabled : yes,
priority : 0,
mirror_type : "SRV",
signature_type : "FINGERPRINTS",
fingerprints : "/usr/share/keys/pkg"
}
FreeBSD-base: {
url : "pkg+https://pkg.freebsd.org/FreeBSD:15:aarch64/base_release_0",
enabled : no,
priority : 0,
mirror_type : "SRV",
signature_type : "FINGERPRINTS",
fingerprints : "/usr/share/keys/pkgbase-15"
}
root@pigate:~ #
```
```
root@pigate:~ # pkg update
Updating FreeBSD-ports repository catalogue...
FreeBSD-ports repository is up to date.
Updating FreeBSD-ports-kmods repository catalogue...
FreeBSD-ports-kmods repository is up to date.
All repositories are up to date.
root@pigate:~ #
```

With quarterly

```
root@wifigate:/var/db/pkg # pkg repos
FreeBSD-ports: {
url : "pkg+https://pkg.freebsd.org/FreeBSD:15:aarch64/quarterly",
enabled : yes,
priority : 0,
mirror_type : "SRV",
signature_type : "FINGERPRINTS",
fingerprints : "/usr/share/keys/pkg"
}
FreeBSD-ports-kmods: {
url : "pkg+https://pkg.freebsd.org/FreeBSD:15:aarch64/kmods_quarterly_0",
enabled : yes,
priority : 0,
mirror_type : "SRV",
signature_type : "FINGERPRINTS",
fingerprints : "/usr/share/keys/pkg"
}
FreeBSD-base: {
url : "pkg+https://pkg.freebsd.org/FreeBSD:15:aarch64/base_release_0",
enabled : no,
priority : 0,
mirror_type : "SRV",
signature_type : "FINGERPRINTS",
fingerprints : "/usr/share/keys/pkgbase-15"
}
root@wifigate:/var/db/pkg #
```

```
root@wifigate:/var/db/pkg # pkg update
Updating FreeBSD-ports repository catalogue...
Fetching meta.conf: 100% 179 B 0.2kB/s 00:01
Fetching data.pkg: 100% 10 MiB 10.4MB/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.
Error updating repositories!
root@wifigate:/var/db/pkg #
```
 
It looks like the issue is still there on ARM64 with FreeBSD-ports/quarterly, while FreeBSD-ports/latest seems to be fine.


I can confirm that is the case on my ARM64 systems.With latest

```
root@pigate:~ # pkg repos
FreeBSD-ports: {
url : "pkg+https://pkg.freebsd.org/FreeBSD:15:aarch64/latest",
enabled : yes,
priority : 0,
mirror_type : "SRV",
signature_type : "FINGERPRINTS",
fingerprints : "/usr/share/keys/pkg"
}
FreeBSD-ports-kmods: {
url : "pkg+https://pkg.freebsd.org/FreeBSD:15:aarch64/kmods_quarterly_0",
enabled : yes,
priority : 0,
mirror_type : "SRV",
signature_type : "FINGERPRINTS",
fingerprints : "/usr/share/keys/pkg"
}
FreeBSD-base: {
url : "pkg+https://pkg.freebsd.org/FreeBSD:15:aarch64/base_release_0",
enabled : no,
priority : 0,
mirror_type : "SRV",
signature_type : "FINGERPRINTS",
fingerprints : "/usr/share/keys/pkgbase-15"
}
root@pigate:~ #
```
```
root@pigate:~ # pkg update
Updating FreeBSD-ports repository catalogue...
FreeBSD-ports repository is up to date.
Updating FreeBSD-ports-kmods repository catalogue...
FreeBSD-ports-kmods repository is up to date.
All repositories are up to date.
root@pigate:~ #
```

With quarterly

```
root@wifigate:/var/db/pkg # pkg repos
FreeBSD-ports: {
url : "pkg+https://pkg.freebsd.org/FreeBSD:15:aarch64/quarterly",
enabled : yes,
priority : 0,
mirror_type : "SRV",
signature_type : "FINGERPRINTS",
fingerprints : "/usr/share/keys/pkg"
}
FreeBSD-ports-kmods: {
url : "pkg+https://pkg.freebsd.org/FreeBSD:15:aarch64/kmods_quarterly_0",
enabled : yes,
priority : 0,
mirror_type : "SRV",
signature_type : "FINGERPRINTS",
fingerprints : "/usr/share/keys/pkg"
}
FreeBSD-base: {
url : "pkg+https://pkg.freebsd.org/FreeBSD:15:aarch64/base_release_0",
enabled : no,
priority : 0,
mirror_type : "SRV",
signature_type : "FINGERPRINTS",
fingerprints : "/usr/share/keys/pkgbase-15"
}
root@wifigate:/var/db/pkg #
```

```
root@wifigate:/var/db/pkg # pkg update
Updating FreeBSD-ports repository catalogue...
Fetching meta.conf: 100% 179 B 0.2kB/s 00:01
Fetching data.pkg: 100% 10 MiB 10.4MB/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.
Error updating repositories!
root@wifigate:/var/db/pkg #
```
I can also confirm that this bug still persists on ARM64 if I try to fetch from ports quarterly:

Bash:
Updating FreeBSD-ports repository catalogue...
Fetching meta.conf: 100%    179 B   0.2kB/s    00:01
Fetching data.pkg: 100%   10 MiB  10.4MB/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.
Error updating repositories!

> uname -msr
FreeBSD 15.0-RELEASE arm64
 
Back
Top