$ mkdir ~/pkg_tmp $ cd ~/pkg_tmp $ rmdir ~/pkg_tmp $ pwd pwd: .: No such file or directory $ pkg info pkg: sqlite error while executing sqlite open in file pkgdb.c:1126: unable to open database file $ pkg -v 1.10.1 I saw this message when I 'cd' into a directory which is owned by package "foo" (I don't remember which package but I think it's irrelevant) and some minutes later I wanted to remove "foo". I think the error message is deceptive (I could handle the package database with sqlite and didn't understand why pkg can't access it).
I often see this error updating ports with portmaster: # 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 (security/ca_root_nss/Makefile) 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).
I see this error message when running "portmaster -a" on 11.1-RELEASE, right at the end of the process.
I can confirm I've experienced this error too and agree the error message is misleading at best. The error seems unnecessary.
See this github issue: https://github.com/freebsd/pkg/issues/1552
See link in comment4. Is fixed.