Hi! I have been trying to upgrade to the latest version 25.1 from 24.7.12_4 but I get the following error output:
Fetching packages-25.1-amd64.tar: ... done
Fetching base-25.1-amd64.txz: ................................ done
Fetching kernel-25.1-amd64.txz: ............ done
Extracting packages-25.1-amd64.tar... done
Extracting base-25.1-amd64.txz... done
Extracting kernel-25.1-amd64.txz... done
Please reboot.
>>> Invoking upgrade script 'sanity.sh'
Passed all upgrade tests.
>>> Invoking upgrade script 'cleanup.sh'
find: fts_read: No such file or directory
>>> Error in upgrade script '90-cleanup.sh'
During troubleshooting, I booted into single-user mode and ran fsck (fsck -y, fsck -y -f, also tried with mount -o -u / ) to check for errors before attempting the upgrade again.
Health audit doesn't have any errors.
Additional info:
@OPNsense:~ # grep "/boot" /etc/fstab
/dev/gpt/efiboot0 /boot/efi msdosfs rw 2 2
root@OPNsense:~ # gpart show -l
=> 40 1000215136 nda0 GPT (477G)
40 532480 1 efiboot0 (260M)
532520 2008 - free - (1.0M)
534528 999680000 2 zfs0 (477G)
1000214528 648 - free - (324K)
fts_read() is a function for traversing the file system... to some degree there appears to be glitch on it.
I'm not sufficient in ZFS with regard to error correction so someone else can help shed light on it (zfs clear/scrub maybe).
Technically, I think the script is correct not to proceed not knowing what the underlying problem could be.
Cheers,
Franco
zpool status -v zroot
please. fsck does not work with ZFS.
Yes, of course, I forgot to attach it:
root@OPNsense:~ # zpool status -v zroot
pool: zroot
state: ONLINE
status: Some supported and requested features are not enabled on the pool.
The pool can still be used, but some features are unavailable.
action: Enable all features using 'zpool upgrade'. Once this is done,
the pool may no longer be accessible by software that does not support
the features. See zpool-features(7) for details.
config:
NAME STATE READ WRITE CKSUM
zroot ONLINE 0 0 0
nda0p2 ONLINE 0 0 0
errors: No known data errors
root@OPNsense:~ #
also ran scrub:
root@OPNsense:~ # zpool status -v zroot
pool: zroot
state: ONLINE
status: Some supported and requested features are not enabled on the pool.
The pool can still be used, but some features are unavailable.
action: Enable all features using 'zpool upgrade'. Once this is done,
the pool may no longer be accessible by software that does not support
the features. See zpool-features(7) for details.
scan: scrub repaired 0B in 00:00:57 with 0 errors on Thu Jul 17 10:30:59 2025
config:
NAME STATE READ WRITE CKSUM
zroot ONLINE 0 0 0
nda0p2 ONLINE 0 0 0
errors: No known data errors
root@OPNsense:~ #
I even made a 'find *' :), no errors
Few details:
run
truss -f -d -a -p <PID of /bin/sh /usr/local/sbin/opnsense-shell (OPNsense command menu)> -o /root/upgrade_trace.log
and got too much errors after start update from command menu in another session like:
60731: 5.464751513 open("/usr/local/etc/libmap.d",O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC,0165) ERR#2 'No such file or directory'
60731: 5.467072157 readlink("/etc/malloc.conf",0x30cfd008c9e0,1024) ERR#2 'No such file or directory'
60731: 5.468693765 fstatat(AT_FDCWD,"/sbin/opnsense-update",0x30cfd008d610,0x0) ERR#2 'No such file or directory'
60731: 5.468735611 fstatat(AT_FDCWD,"/bin/opnsense-update",0x30cfd008d610,0x0) ERR#2 'No such file or directory'
60731: 5.468771042 fstatat(AT_FDCWD,"/usr/sbin/opnsense-update",0x30cfd008d610,0x0) ERR#2 'No such file or directory'
60731: 5.468806410 fstatat(AT_FDCWD,"/usr/bin/opnsense-update",0x30cfd008d610,0x0) ERR#2 'No such file or directory'
61279: 5.469671042 open("/usr/local/etc/libmap.d",O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC,0165) ERR#2 'No such file or directory'
61279: 5.472075607 readlink("/etc/malloc.conf",0x125f6213a750,1024) ERR#2 'No such file or directory'
61279: 5.473656127 fstatat(AT_FDCWD,"/sbin/id",0x125f6213b2f0,0x0) ERR#2 'No such file or directory'
...
Full error grep upgrade_trace.err.zip attached.
Early I update this installation without any problems, didn't do anything to the current install.. Why am I seeing so many errors? How critical are these errors really for the update itself, or are they possibly just remnants of old validation steps?
Run opnsense-update -pA 25.1 without any errors then update (12) from launcher, reboot and get 25.1.12.
I have a strange feeling something went wrong (because it is not standard update). I guess we'll see.
https://github.com/opnsense/core/blob/master/src/etc/rc.syshook.d/upgrade/90-cleanup.sh run opnsense-update -Fs command
'opnsense-update -Fs' command run the code:
flush_temporary()
{
# remove our stale pyc files not handled by pkg
find /usr/local/opnsense -type f -name "*.pyc" -delete
for DIR in /boot /usr/libexec/bsdinstall /usr/local; do
# remove spurious files from pkg
find ${DIR} ! \( -type d \) -a \
\( -name "*.pkgsave" -o -name ".pkgtemp.*" \) -delete
# processs spurious directories from pkg
# (may not be empty so -delete does not work)
find ${DIR} -type d -name ".pkgtemp.*" -print0 | \
xargs -0 -n1 rm -r
done
}
I check manually:
root@OPNsense:/usr/local/etc # opnsense-update -Fs
find: fts_read: No such file or directory
Check manually all commands in this script and no ERRORS:
root@OPNsense:/usr/local/etc # find /usr/local/opnsense -type f -name "*.pyc"
root@OPNsense:/usr/local/etc #
root@OPNsense:/usr/local/etc # find /boot ! \( -type d \) -a \( -name "*.pkgsave" -o -name ".pkgtemp.*" \)
root@OPNsense:/usr/local/etc # find /usr/libexec/bsdinstall ! \( -type d \) -a \( -name "*.pkgsave" -o -name ".pkgtemp.*" \)
root@OPNsense:/usr/local/etc # find /usr/local ! \( -type d \) -a \( -name "*.pkgsave" -o -name ".pkgtemp.*" \)
root@OPNsense:/usr/local/etc #
root@OPNsense:/usr/local/etc # find /boot -type d -name ".pkgtemp.*" -print0 | xargs -0 -n1 rm -r
root@OPNsense:/usr/local/etc # find /usr/libexec/bsdinstall -type d -name ".pkgtemp.*" -print0 | xargs -0 -n1 rm -r
root@OPNsense:/usr/local/etc # find /usr/local -type d -name ".pkgtemp.*" -print0 | xargs -0 -n1 rm -r
root@OPNsense:/usr/local/etc #
Ran the function in a separate script:
#!/bin/sh
# Flush temporary system files
# Script version (originally a function)
echo "Cleaning stale .pyc files..."
find /usr/local/opnsense -type f -name "*.pyc" -delete
for DIR in /boot /usr/libexec/bsdinstall /usr/local; do
echo "Processing $DIR..."
# Remove package-related temporary files
find "${DIR}" ! \( -type d \) -a \
\( -name "*.pkgsave" -o -name ".pkgtemp.*" \) -delete
# Remove package-related temporary directories
find "${DIR}" -type d -name ".pkgtemp.*" -print0 | \
xargs -0 -n1 rm -rf
done
echo "Cleanup completed successfully."
exit 0
Identified that the problem is in the path /usr/local and -delete option in this section:
# Remove package-related temporary files
find "${DIR}" ! \( -type d \) -a \
\( -name "*.pkgsave" -o -name ".pkgtemp.*" \) -delete
If I remove -delete from this section, everything completes without errors.
Fix script to debug problem place:
#!/bin/sh
# Flush temporary system files
# Script version (originally a function)
echo "Cleaning stale .pyc files..."
find /usr/local/opnsense -type f -name "*.pyc" -delete
for DIR in /usr/local ; do
echo "Processing $DIR..."
# Remove package-related temporary files
# find "${DIR}" ! \( -type d \) -a \
# \( -name "*.pkgsave" -o -name ".pkgtemp.*" \) -print -delete
find "${DIR}" \
\( -type d -exec sh -c 'printf "ENTER: %s\n" "$1" >&2' sh {} \; \) -o \
\( ! -type d -a \( -name "*.pkgsave" -o -name ".pkgtemp.*" \) -print 1>&2 -delete \)
# Remove package-related temporary directories
find "${DIR}" -type d -name ".pkgtemp.*" -print0 | \
xargs -0 -n1 rm -rf
done
echo "Cleanup completed successfully."
exit 0
Identified that the problem was in iocage jail with samba, and fdescfs(/usr/local/bastille/jails/nas/root/var/run/samba4/fd/3/: Bad file descriptor)
Stopped samba in a jail and umount fdescfs. From 4.16 Samba On FreeBSD 4.16+ inside jails, Samba expects /dev/fd (fdescfs) to be mounted.
Upgrade from the WEB with no problems.
SOLVED!