[SOLVED] pkg database version error after upgrading jail from 12.3 to 13.1

bozho

Dabbler
Joined
Jan 2, 2019
Messages
19
Hi all,

I'm having problems upgrading a jail.

I've upgraded TrueNAS Core to 13 with no issues, as well as 6 jails from 12.2 to 13.1-RELEASE-p4.

I'm having problems upgrading one jail from 12.3-RELEASE-p7 to 13.1-RELEASE-p4. iocage upgrade claims to have worked, I get the "<jail> successfully upgraded from 12.3-RELEASE-p7 to 13.1-RELEASE-p4!" message.

After that, I restart the jail and run pkg -j <JID> update, which works fine. However, running pkg -j <JID> upgrade errors out with:

pkg error: - pkg-static: warning: database version 36 is newer than libpkg(3) version 35, but still compatible pkg-static: sqlite error while executing INSERT OR IGNORE INTO mtree(content) VALUES(?1) in file pkgdb.c:115: no such table: mtree

I tried upgrading packages using iocage update <jail> --pkgs and I get the same error.

This worked fine for all other jails, the only difference was they were all 12.2.
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977
Run pkg bootstrap -f followed by pkg upgrade.
 

bozho

Dabbler
Joined
Jan 2, 2019
Messages
19
Nope, still get the same error after running
pkg -j <JID> bootstrap -f pkg -j <JID> upgrade
 

bozho

Dabbler
Joined
Jan 2, 2019
Messages
19
I did notice I get this when running pkg update:
Updating FreeBSD repository catalogue... pkg: Repository FreeBSD has a wrong packagesite, need to re-create database
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977
Nope, still get the same error after running
pkg -j <JID> bootstrap -f pkg -j <JID> upgrade
That's not the commands I posted. Run the commands I posted in the jail in question.
 

bozho

Dabbler
Joined
Jan 2, 2019
Messages
19
I cannot get into the jail, since ABIs changed and bash won't start. I've done jail pkg upgrades from the host for all other jails.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
iocage console <jailname> does not work?
 

bozho

Dabbler
Joined
Jan 2, 2019
Messages
19
I'll try later tonight, thank you for the suggestion.

Edit: I don't expect it to work, since opening Shell from the Jails page was giving me the same Shared object "libncursesw.so.8" not found, required by "bash" error I'd get when trying to SSH into that jail.

Edit 2: I was getting the same error for other jails after I upgraded them, but running pkg -j <JID> update/upgrade from the host resolved that issue.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Why does root have bash as a login shell in your jail? Don't do that. Reason: exactly what you experience now.

To fix - from NAS host:
Code:
cd /mnt/<pool>/iocage/jails/<jailname>/root/etc
vi master.passwd
# change shell to /bin/csh
# save and exit
pwd_mkdb -d . master.passwd
iocage console <jailname>

Don't ever change root's shell. Create a user with whatever you feel comfortable with and use sudo.
 

bozho

Dabbler
Joined
Jan 2, 2019
Messages
19
Heh, funnily enough, the jail I was having problems with did not have root's shell changed, I didn't even try connecting to it and was simply using pkg -j <JID> update/upgrade as I did with other jails (the first jail I upgraded had root's shell changed to bash).

iocage console <jail> worked, pkg update warned me I should run pkg bootstrap -f, I did and finally pkg upgrade from inside the jail worked!

Thank you both!
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977
You should be using a SSH client not the shell in the web UI.
 
Top