After update pkg. FreeBSD 10.3

VRx

New Member


Messages: 1

reinstall mysql. that fixed it for me.

It said it couldn't open a file. It would have been good to know which file.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 7,540
Messages: 30,244

pkg(8) uses SQLite databases, so reinstalling MySQL does absolutely nothing to fix the issue.
 

zapata

New Member

Reaction score: 3
Messages: 17

I often get this error (on different machines) updating ports, e.g. portmaster nginx on FreeBSD 10.3 and 11.1-PRERELEASE. :-(
 

aaronbaugher

New Member


Messages: 8

Code:
pkg: sqlite error while executing sqlite open in file pkgdb.c:1126: unable to open database file
The code that triggers this error is:

Code:
if (sqlite3_open("local.sqlite", &db->sqlite) != SQLITE_OK) {
That file, "local.sqlite", is in /var/db/pkg. Yet I still get the error if I cd into that directory before running portmaster. So my guess at this point is that somewhere earlier in the code it's getting itself into the wrong current directory, or something like that which keeps it from being able to open that file.

It doesn't seem to hurt anything. /var/db/pkg/local.sqlite is still getting updated. pkg still works, and I can open that file with sqlite3.
 

zapata

New Member

Reaction score: 3
Messages: 17

I have seen this PR and the issue at Github , but I am not running pkg from a non-existent directory!
# pwd
/root
# portmaster security/ca_root_nss
[...]
pkg: sqlite error while executing sqlite open in file pkgdb.c:1126: unable to open database file

If I remove pkg-message from SUB_FILES the error is gone.

After more testing I think the error does not appear on 12.0-current (pkg) and 11-RELEASE/STABLE (pkg-devel).
 

ironudjin

Member

Reaction score: 3
Messages: 34

pkg: sqlite error while executing sqlite open in file pkgdb.c:1126: unable to open database file
I've got exactly the same error on 11-STABLE r324545 when I upgrade software use portmaster.
pkg audit or pkg info don't report any problems.

P.S: pkg-1.10.1
 
Top