# Broken jail after upgrade to 11.2



## quamenzullo (Oct 23, 2018)

Hello,

I performed the following steps to upgrade host from 10.4 to 11.2:


```
# pkg upgrade
# freebsd-update fetch
# freebsd-update install
# freebsd-update upgrade -r 11.2-RELEASE
# freebsd-update install
# shutdown -r now

# freebsd-update install
# pkg upgrade
# freebsd-update install
```

No package comes from the ports tree, so I didn't do the ports update part.

And then, to update the jails:


```
# ezjail-admin update -s 10.4-RELEASE -U
# ezjail-admin console myjail
root@myjail:~ # pkg-static bootstrap -f
root@myjail:~ # pkg upgrade
```

I didn't do the mergemaster  part since I do not use /usr/src (empty).

I checked that:


```
# file /srv/basejail/bin/sh
/srv/basejail/bin/sh: ELF 64-bit LSB executable, x86-64, version 1 (FreeBSD), dynamically linked, interpreter /libexec/ld-elf.so.1, for FreeBSD 11.2, FreeBSD-style, stripped
```

But when I want to start uwsgid inside the jail, I get this:

```
root@myjail:~ # service uwsgid start
/usr/local/etc/rc.d/uwsgid: DEBUG: checkyesno: uwsgid_enable is set to YES.
/usr/local/etc/rc.d/uwsgid: DEBUG: run_rc_command: doit: uwsgid_start
/usr/local/etc/rc.d/uwsgid: DEBUG: checkyesno: uwsgid_enable is set to YES.
Starting uwsgid...
Shared object "libkvm.so.6" not found, required by "uwsgi"
```

I uninstalled uwsgi (it is actually installed in a venv using pip3.6) and when I try to reinstall it, it ends up with:


```
/usr/bin/ld: undefined reference to symbol `elf_begin@@R1.0' (try adding -lelf)
    //lib/libelf.so.2: could not read symbols: Bad value
```

NB: I cannot try this -lelf because this is being installed by pip3.6, so I have no control over the options passed...

So there is something wrong but I cannot find out what exactly. Is there a step I've missed? Or must I rebuild the jail "from scratch"?


----------



## SirDice (Oct 23, 2018)

quamenzullo said:


> No package comes from the ports tree, so I didn't do the ports update part.


Because you did a major version upgrade you _must_ run these:

```
pkg-static install -f pkg
pkg upgrade -f
```
Only doing a `pkg upgrade` is not sufficient.



quamenzullo said:


> I didn't do the mergemaster part since I do not use /usr/src (empty).


That's actually irrelevant. You _must_ run mergemaster(8) in order to update the files in /etc/ in your jails, `ezjail-admin upgrade` is not sufficient and does not update the files in /etc/.

Handbook: 14.6.4. Updating Jails


----------



## quamenzullo (Oct 23, 2018)

Many thanks! I overlooked the forced upgrades.

As to mergemaster(8), it actually failed on a

```
FATAL ERROR: Cannot 'cd' to /usr/src and install files to
      the temproot environment
```

I will let the forced upgrades finish and try again after.


----------



## SirDice (Oct 23, 2018)

mergemaster(8) requires a full source tree unfortunately. But you can extract the one from the installation media and freebsd-update(8) will keep it in sync with the rest of the OS.


----------



## quamenzullo (Oct 23, 2018)

Many thanks, again!

So, I added the source tree running `fetch ftp://ftp.freebsd.org/pub/FreeBSD/releases/amd64/11.2-RELEASE/src.txz` and `tar -C / -xzvf src.txz` and then ran the `mergemaster` part for one jail, to start with:


```
# rm /usr/jails/myjail/usr/src
# mkdir /usr/jails/myjail/usr/src
# mount -t nullfs -o ro /usr/src /usr/jails/myjail/usr/src
# ezjail-admin console myjail
[root@web0]~ # cd /usr/src
[root@web0]~ # mergemaster -U
[root@web0]~ # exit
# umount /usr/jails/myjail/usr/src
```

But unfortunately, when I try to install `uwsgi` it breaks at exactly the same point.

I noticed, when I run again `ezjail-admin update -s 10.4-RELEASE -U` after having installed the source tree, that I get this:


```
The following components of FreeBSD seem to be installed:
kernel/generic world/base world/games world/lib32

The following components of FreeBSD do not seem to be installed:
src/src world/doc
```

and I'm not sure it's reasonable, because `src/src` should be here now, shouldn't it?
``


----------



## SirDice (Oct 23, 2018)

quamenzullo said:


> I'm not sure it's reasonable, because `src/src` should be here now, shouldn't it?


On your host, yes. Your jails, probably not. It's not needed inside the jails. I typically run mergemaster(8) from the host (see example 14.2). I'm the only user that logs in on my jails, and I trust myself


----------



## quamenzullo (Oct 23, 2018)

OK!
Well, so, after all that, it's still impossible to install `uwsgi` so I guess I'll have to rebuild the jail from scratch. Hopefully this will be enough.


----------



## quamenzullo (Oct 23, 2018)

No, something is really broken: if I setup a brand new jail, then I get the same error.


----------



## quamenzullo (Oct 23, 2018)

I wonder if the installation of `uwsgi` via `pip3.6` is not simply broken, because the rest seems to work fine, so far.

Could someone try on a FreeBSD 11.2 such an installation works?

It requires to have python3.6 installed, should be in a test jail (no problem on the host) and commands should be, in a test directory of your choice:

```
python3.6 -m venv py36
source py36/bin/activate.csh
pip3.6 install uwsgi
```
=> does this finish well?

(Once finished, `deactivate` to get out of the venv and `rm -rf py36` to remove it).


----------

