Question

Problems after upgrading to freebsd 13.0

Posted November 11, 2021 135 views
FreeBSD

Hey

I upgraded to freeBSD 13.0 and it seem to have broken the DO network configurations, I am forced to go to the console and run /usr/local/rc.d/digitalocean restart and then I have network again..

When the server boots up I get the following:

DigitalOcean: expected hostID xxxx(edited out)
DigitalOcean: resizing the disk…
vtbd0 recovering is not needed
vtbd0p3 resized
DigitalOcean: expanding the ZFS pool
DigitalOcean: mount configdrive
could not determine starting sector, using very first session
DigitalOcean: applying droplet configuration
DigitalOcean: reading meta-data
ld-elf.so.1: Shared object “libonig.so.5” not found, required by “jq”
DigitalOcean: hostname is set in /etc/rc.conf, skipping setting hostname
ld-elf.so.1: Shared object “libonig.so.5” not found, required by “jq”
ld-elf.so.1: Shared object “libonig.so.5” not found, required by “jq”
ld-elf.so.1: Shared object “libonig.so.5” not found, required by “jq”
DigitalOcean: adding public IPv4 configuration
ld-elf.so.1: Shared object “libonig.so.5” not found, required by “jq”
ld-elf.so.1: Shared object “libonig.so.5” not found, required by “jq”
DigitalOcean: adding anchor ipv4 configuration
ld-elf.so.1: Shared object “libonig.so.5” not found, required by “jq”
ld-elf.so.1: Shared object “libonig.so.5” not found, required by “jq”
DigitalOcean: adding private IPv4 configration
ld-elf.so.1: Shared object “libonig.so.5” not found, required by “jq”
ld-elf.so.1: Shared object “libonig.so.5” not found, required by “jq”
ld-elf.so.1: Shared object “libonig.so.5” not found, required by “jq”
DigitalOcean: adding IPv6 configuration
DigitalOcean: finished droplet configuration
DigitalOcean: re-starting networking
Created clone interfaces: lo1.
lo0: link state changed to UP
ifconfig: ‘netmask’ requires argument
ifconfig: 'prefixlen’ requires argument
vtnet0: link state changed to UP
ifconfig: alias: bad value
ifconfig: 'netmask’ requires argument
vtnet1: link state changed to UP

anyone else had the same problem and now how to fix it?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
Submit an Answer
2 answers

Looks like the jq package is using the older ABI. Hardcode the network config, and make sure all packages are updated to the 13* ABI. Then jq should work and you can remove the hardcoded network config.

see:
https://docs.freebsd.org/en/books/handbook/cutting-edge/#updating-upgrading-freebsdupdate
24.2.3.2. Upgrading Packages After a Major Version Upgrade

  • Hey and thanks for the reply,

    I actually did the pkg-static upgrade -f so it reinstalled all the packages, but I still have the problem.

    It’s really weird

    • That makes more sense. What version of libonig.so do you have in /usr/local/lib/? Maybe the world didn’t install fully. Did you use freebsd-update or did you build from src and did a make installworld?

      • I have these:

        lrwxr-xr-x   1 root  wheel       16 Nov  6 06:17 libonig.so -> libonig.so.5.2.0
        lrwxr-xr-x   1 root  wheel       16 Nov  6 06:17 libonig.so.5 -> libonig.so.5.2.0
        

        I used the freebsd-update, on a fairly fresh install of 12.2 from digitalocean

        • I recently spawned and did an update of a 12.2 droplet as well using freebsd-update without issue. Can you confirm the architecture of jq is FreeBSD:13?

          # pkg info jq-1.6 | grep Archi
          Architecture : FreeBSD:13:amd64

          • I get the same:

            #pkg info jq-1.6 | grep Archi
            Architecture   : FreeBSD:13:amd64
            
            

            Okay, that’s even weirder if you made the upgrade without issues.. I did this yesterday.. got these errors.. destroyed the droplet to start over and got the same error today.

I had the same issue. Upgraded from 12 to 13, and IP was non-existent. Opened a ticket, no fix.

I hacked around it and let it simmer for a couple of weeks, hoping DO would fix their automation. Nope.

So tonight I dug into it, and worked out the problem. At the time that “digitalocean” script is run, ldconfig has not been initialized. So no dynamically-linked binaries can run. At least, the “jq” tool they rely on doesn’t run. (Had to add code to that script to write things to /tmp so I could reboot and get the debug results.)

What I did to fix it was to add this line at the top of the script (global scope):

export LDLIBRARYPATH=“/usr/local/lib/”

Now when ‘jq’ runs, it can find that pesky libonig shared object file.

This also explains why you were able to get it working by running the digitalocean script after the VM had booted.

I have no idea why the upgrade would not have this problem for everyone. A bug in FreeBSD’s upgrade instructions? Or something odd about DO?

Oh, and if one of you could explain how you managed to capture the boot messages that were output on the Recovery Console, I’d be happy to learn. I could see the errors as the flew by, but not read them. And grepping for 'jq’ in the logs gave no hits.

Be aware that DO will “refresh” that script without warning, so this fix may not stay fixed. It may be better to just add your own initscript to hard-code your droplet’s info directly.

Cheers!

  • Hey!

    I have this exact same issue with two droplets, have a ticket open with DO support now, but managed to find that “ld-elf.so.1: Shared object “libonig.so.5” not found, required by “jq” error in the process of troubleshooting.

    I’ve tried to add the line "export LDLIBRARYPATH=“/usr/local/lib/”” as you recommended to the script but Im still getting the issue.

    Can you clarify where I should be adding this?

    Thank you!

    • Sure. The file is at: /usr/local/etc/rc.d/digitalocean (You can run “locate digitalocean” to find things.) At the start of the file:

      #!/bin/sh
      
      # PROVIDE: digitalocean
      # REQUIRE: FILESYSTEMS cloudinit digitaloceanpre
      
      . /etc/rc.subr
      
      name="digitalocean"
      start_cmd="${name}_start"
      stop_cmd=":"
      
      # JLR - FreeBSD13 doesn't have ldconfig set up at this point in the boot
      export LD_LIBRARY_PATH="/usr/local/lib/"
      
      digitalocean_start()
      {
              check_startmsgs && echo "DigitalOcean: applying droplet configuration"