Skip to content

Instantly share code, notes, and snippets.

@yoyosan
Last active August 28, 2022 10:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yoyosan/5d4d2d7ecfb7952a0a33642bd4d2cdbb to your computer and use it in GitHub Desktop.
Save yoyosan/5d4d2d7ecfb7952a0a33642bd4d2cdbb to your computer and use it in GitHub Desktop.
TrueNAS upgrade

Upgrade TrueNAS

Use the web interface to upgrade the os

If upgrade fails with a message similar to Host: 12.2-RELEASE is not greater than target: 12.3-RELEASE run

iocage fetch

and choose the latest minor version for your host kernel(12.3 in the case above).

Upgrade jails

SSH into the NAS server and run the following commands:

iocage upgrade MyBox
iocage restart MyBox
iocage upgrade emby
iocage restart emby
# -r might not be needed on future runs
iocage upgrade minidlna -r 12.3-RELEASE
iocage upgrade qbittorrent
iocage restart qbittorrent
# might be needed
reboot

Fixing nextcloud after upgrade

Nextcloud needs some repairing after doing the upgrade

iocage console nextcloud
pkg upgrade
# might no longer be needed: php74-pecl-imagick
# pkg install sudo nano
cd /usr/local/www/nextcloud
# make sure this exists `apc.enable_cli=1` in
nano /usr/local/etc/php/ext-20-apcu.ini
chmod +x occ
# run upgrade. re-run if it fails
sudo -u www ./occ upgrade
# corectează permisiuni pentru apps-pkg
chown -R www:www apps-pkg
# editare conf php-fpm
nano /usr/local/etc/php-fpm.d/nextcloud.conf
# add this line if doesn't exist: clear_env = no

# restart fpm
service php-fpm restart

# fix permissions
chown -R www apps-pkg/

Fixing MyBox

Check the syncthing log in /var/log/syncthing... There was a file that syncthing couldn't access and that's why it stopped working.

Restore failing qbittorrent

zfs rollback -r media1/iocage/jails/qbittorrent/root@ioc_plugin_upgrade_2021-01-08

Fix emby no playback

iocage console emby
# might also need ffprobe
pkg install ffmpeg
service emby-server restart

Various locations:

Data dir: /var/db/emby-server Emby app: /usr/local/lib/emby-server

Starting manually:

/usr/local/lib/emby-server/system/EmbyServer -f -p /var/run/emby-server.pid /usr/local/lib/emby-server/system/EmbyServer \
  -os freebsd \
  -ffdetect /usr/local/lib/emby-server/bin/ffdetect \
  -ffmpeg /usr/local/lib/emby-server/bin/ffmpeg \
  -ffprobe /usr/local/lib/emby-server/bin/ffprobe \
  -programdata /var/db/emby-server

If starting manually fails with this error Failed to create CoreCLR, HRESULT: 0x8007FF02, install the latest package.

Debug nextcloud mysql service

Use this command to see why mysql server fails:

/usr/local/libexec/mysqld -c -f /usr/local/bin/mysqld_safe --basedir=/usr/local --datadir=/var/db/mysql --pid-file=bla.pid --user=mysql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment