Totally broken system

I have 2 issues:

1)
freebsd-update install
Update manifest is corrupt -- this should never happen.
Re-run '/usr/sbin/freebsd-update fetch'.

I had tried to remove /var/db/freebsd-update with no luck

# freebsd-version -ku
13.2-RELEASE-p4
13.2-RELEASE-p6

2)
Code:
/usr/ports/devel/git # make
make: "/usr/ports/Mk/bsd.port.mk" line 1211: UNAME_r (13.2-RELEASE-p4) and OSVERSION () do not agree on major version number.

make: stopped in /usr/ports/devel/git
I had tried to reboot couple of times - the same result
I had tried to set OSVERSION=1302001 in /etc/make.conf:
Code:
/usr/ports/devel/git # make
/usr/ports/Mk/Scripts/dialog4ports.sh: cannot create : No such file or directory

===> Options unchanged
===>  License GPLv2 accepted by the user
===>   git-2.43.0 depends on file: /usr/local/sbin/pkg - found
=> git-2.43.0.tar.xz is not in /usr/ports/devel/git/distinfo.
=> Either /usr/ports/devel/git/distinfo is out of date, or
=> git-2.43.0.tar.xz is spelled incorrectly.
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/devel/git
*** Error code 1

Stop.
make: stopped in /usr/ports/devel/git
But file is there:
# ls -la /usr/ports/Mk/Scripts/dialog4ports.sh
-rwxr-xr-x 1 root wheel 1870 11 окт. 10:54 /usr/ports/Mk/Scripts/dialog4ports.sh

make makesum also doesn't help:
Code:
/usr/ports/devel/git # make makesum
===>  License GPLv2 accepted by the user
===>  License GPLv2 accepted by the user
===>   git-2.43.0 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by git-2.43.0 for building
/usr/ports/Mk/Scripts/makesum.sh: cannot create : No such file or directory
/usr/ports/Mk/Scripts/makesum.sh: cannot create : No such file or directory
*** Error code 2

Stop.
make: stopped in /usr/ports/devel/git
File is there:
Code:
# ls -la /usr/ports/Mk/Scripts/makesum.sh
-rwxr-xr-x  1 root  wheel  1589 21 нояб.  2022 /usr/ports/Mk/Scripts/makesum.sh

I had tried to remove /usr/ports and run portsnap fetch extract - same results.
I had tried to remove /usr/ports and download ports.txz, then these errors disappear and it starts complaining about vulnerabilities.

I don't want to use pkg install because it proposes to remove most of my packages because of conflicts, and I am not sure I be able to install anything after.

Any suggestions?
 
Code:
# freebsd-version -urk
13.2-RELEASE-p4
13.2-RELEASE-p4
13.2-RELEASE-p6

# freebsd-update fetch
Looking up update.freebsd.org mirrors... 3 mirrors found.
Fetching metadata signature for 13.2-RELEASE from update1.freebsd.org... done.
Fetching metadata index... done.
Inspecting system... done.
Preparing to download files... done.
rm: f465c3739385890c221dff1a05e578c6cae0d0430e46996d319db7439f884336-install/: Too many levels of symbolic links
The following files will be added as part of updating to
13.2-RELEASE-p6:
/bin/freebsd-version
/boot/kernel/cbb.ko
/boot/kernel/kernel
/boot/kernel/mpr.ko
/boot/kernel/msdosfs.ko
/boot/kernel/pf.ko
/boot/kernel/vmd.ko
/boot/kernel/wlan.ko
/boot/kernel/zfs.ko
/boot/loader
/boot/loader.efi
/boot/loader_4th
/boot/loader_4th.efi
/boot/loader_lua
/boot/loader_lua.efi
/boot/loader_simp
/boot/loader_simp.efi
/boot/pxeboot
/boot/zfsloader
/etc/ssh/sshd_config
/etc/ssl/certs/0179095f.0
/etc/ssl/certs/08063a00.0
/etc/ssl/certs/0b9bc432.0
/etc/ssl/certs/3e359ba6.0
/etc/ssl/certs/5860aaa6.0
/etc/ssl/certs/5931b5bc.0
/etc/ssl/certs/5a7722fb.0
/etc/ssl/certs/66445960.0
/etc/ssl/certs/7a3adc42.0
/etc/ssl/certs/7a780d93.0
/etc/ssl/certs/8508e720.0
/etc/ssl/certs/8f103249.0
/etc/ssl/certs/90c5a3c8.0
/etc/ssl/certs/9846683b.0

# freebsd-update install
Update manifest is corrupt -- this should never happen.
Re-run '/usr/sbin/freebsd-update fetch'.
 
rm -rf /var/db/freebsd-update/*

Seems something in that directory is horribly corrupt. Is this UFS or ZFS? If it's UFS you might want to boot to single user mode and run fsck(8).
 
I don't know why freebsd-update creates a cycling link
f465c3739385890c221dff1a05e578c6cae0d0430e46996d319db7439f884336-install@ -> f465c3739385890c221dff1a05e578c6ca
e0d0430e46996d319db7439f884336-install
in
/var/db/freebsd-update
 
rm -rf /var/db/freebsd-update/*

Seems something in that directory is horribly corrupt. Is this UFS or ZFS? If it's UFS you might want to boot to single user mode and run fsck(8).
It is UFS, yes I did run fsck. If I remove the directory why the error still persist? Tried try fsck again - no changes. How to find out what exactly is corrupted?
 
I think the output of freebsd-version is correct. This is the output from a system I updated to latest available patches yesterday.
Code:
 freebsd-version -urk
13.2-RELEASE-p4
13.2-RELEASE-p4
13.2-RELEASE-p6
root@FBSDNUC:~ # freebsd-update fetch
src component not installed, skipped
Looking up update.FreeBSD.org mirrors... 3 mirrors found.
Fetching metadata signature for 13.2-RELEASE from update2.freebsd.org... done.
Fetching metadata index... done.
Inspecting system... done.
Preparing to download files... done.

No updates needed to update system to 13.2-RELEASE-p6.
 
rm: f465c3739385890c221dff1a05e578c6cae0d0430e46996d319db7439f884336-install/: Too many levels of symbolic links
Can you remove that file manually and check that /var/db/freebsd-update is absolutely empty before you refetch?
 
I think the output of freebsd-version is correct. This is the output from a system I updated to latest available patches yesterday.
Code:
 freebsd-version -urk
13.2-RELEASE-p4
13.2-RELEASE-p4
13.2-RELEASE-p6
root@FBSDNUC:~ # freebsd-update fetch
src component not installed, skipped
Looking up update.FreeBSD.org mirrors... 3 mirrors found.
Fetching metadata signature for 13.2-RELEASE from update2.freebsd.org... done.
Fetching metadata index... done.
Inspecting system... done.
Preparing to download files... done.

No updates needed to update system to 13.2-RELEASE-p6.
Yes, but should boot with the new kernel, and output change accordingly after reboot. I have tried 5 reboots, it's still the same.
And in my case, I can't install any updates.
 
If you look at the things updated for 13.2-p6, it was primarily modules, zfs.ko specifically. Modules can be changed outside of the kernel proper so what I think happened is the "-p6" represents the updates to zfs.ko while the main kernel did not change.
So
"-u" for userland is at -p4
"-r" for running kernel is at p4 because that is the currently running main kernel
"-k" for the next kernel is at -p6 because of the zfs.ko update

So it looks wrong, feels wrong but I think is consistent.
I know I updated correctly/fine and have rebooted a couple times and have the same result.
 
So
"-u" for userland is at -p4
"-r" for running kernel is at p4 because that is the currently running main kernel
"-k" for the next kernel is at -p6 because of the zfs.ko update
Rich (BB code):
# freebsd-version -urk
13.2-RELEASE-p4   <-- installed kernel version
13.2-RELEASE-p4   <-- running kernel version
13.2-RELEASE-p6   <-- userland version
To avoid confusion about what is what, freebsd-version(1):
Code:
       If  several  of	the  above options are specified, freebsd-version will
       print the installed kernel version first, then the running kernel  ver-
       sion,  next  the	 userland version, and finally the userland version of
       the specified jails, on separate	lines.
 
Regardless, the versions of the kernel and userland are good. Still doesn't explain why freebsd-update fetch fetches updates, it supposedly already has. The output mer posted in #7 is what I expect to see.

kerya When you run fsck(8) in single user, does it actually find issues? And did you repair those? I would also recommend installing sysutils/smartmontools and check the disk; smartctl -a /dev/ada0 (replace with the correct disk). You could have some bad sectors in the wrong places causing these issues.
 
Regardless, the versions of the kernel and userland are good. Still doesn't explain why freebsd-update fetch fetches updates, it supposedly already has. The output mer posted in #7 is what I expect to see.

kerya When you run fsck(8) in single user, does it actually find issues? And did you repair those? I would also recommend installing sysutils/smartmontools and check the disk; smartctl -a /dev/ada0 (replace with the correct disk). You could have some bad sectors in the wrong places causing these issues.
Yes, really strange situation, that's why I am here.
fsck finds nothing. filesystem reported as clear.
smart is good:
SMART overall-health self-assessment test result: PASSED
Reallocated_Sector_Ct 0x0033 200 200 140 Pre-fail Always - 0
197 Current_Pending_Sector 0x0012 200 200 000 Old_age Always - 0
198 Offline_Uncorrectable 0x0010 200 200 000 Old_age Offline - 0
199 UDMA_CRC_Error_Count 0x003e 200 200 000 Old_age Always - 0
 
To avoid confusion about what is what, freebsd-version(1):
Code:
       If  several  of    the  above options are specified, freebsd-version will
       print the installed kernel version first, then the running kernel  ver-
       sion,  next  the     userland version, and finally the userland version of
       the specified jails, on separate    lines.
Thanks, but it doesn't explain why freebsd-update says "Update manifest is corrupt -- this should never happen." and I still don't know how to fix it.
 
kerya I'm assuming the "update manifest" lives in /var/db/freebsd-update, which you tried to rm -rf but ran into a circular symlink. Did you try manually removing that and then rm -rf the directory? If not, then an alternative to try is "mv /var/db/freebsd-update /var/db/freebsd-update.BAD" and then run freebsd-update fetch. If that works correctly then you can have time to work through removing the bad update directory.
 
Code:
[...] # freebsd-update fetch
[...]
rm: f465c3739385890c221dff1a05e578c6cae0d0430e46996d319db7439f884336-install/: Too many levels of symbolic links
The last line of the quote doesn't look normal. The path-part -install/ resembles the source surrounding the message later on:
Code:
# freebsd-update install
Update manifest is corrupt -- this should never happen.
Re-run '/usr/sbin/freebsd-update fetch'.
This seems to originate from the source of freebsd-update.sh [line 873-878]:
Code:
	if ! [ -f ${BDHASH}-install/INDEX-OLD ] ||
	    ! [ -f ${BDHASH}-install/INDEX-NEW ]; then
		echo "Update manifest is corrupt -- this should never happen."
		echo "Re-run '$0 fetch'."
		exit 1
	fi
Based on this, it seems there is something wrong with ${BDHASH}-install/INDEX-OLD or ${BDHASH}-install/INDEX-NEW.

I don't have detailed knowledge about the freebsd-update process or its sh script; perhaps others can comment.
 
Erichans that's what I was referring to. Looking at a correct system, that f465c3739385890c221dff1a05e578c6cae0d0430e46996d319db7439f884336-install should be a symlink to a directory "install-something" (or maybe initially a directory) but back up in post #5 it looks like it's a symlink back to itself which tracks to the "too many levels of symbolic links" and I think also to the "manifest is corrupt".
 
I don't know why freebsd-update creates a cycling link
f465c3739385890c221dff1a05e578c6cae0d0430e46996d319db7439f884336-install@ -> f465c3739385890c221dff1a05e578c6ca
e0d0430e46996d319db7439f884336-install
in
/var/db/freebsd-update
Try rm -f /var/db/freebsd-update/f465c3739385890c221dff1a05e578c6cae0d0430e46996d319db7439f884336-install No slash at the end. No -r either, we want to remove the symlink and only the symlink itself. If that worked remove all the other content too; rm -rf /var/db/freebsd-update/*

Make sure the above rm(1) both succeed without error. The entire /var/db/freebsd-update/ directory should be empty. Then run freebsd-update fetch again.
 
I don't know why freebsd-update creates a cycling link
f465c3739385890c221dff1a05e578c6cae0d0430e46996d319db7439f884336-install@ -> f465c3739385890c221dff1a05e578c6ca
e0d0430e46996d319db7439f884336-install
in
/var/db/freebsd-update
mer, in that case it looks like the downloaded manifest gets put in either in the wrong place or in a place that the test in the sh script (as quoted) cannot use for its tests and fails; the manifest might have gotten downloaded ok. Getting rid of that circular link seems paramount; that should get rid of the message in the output of freebsd-update fetch
 
  • Like
Reactions: mer
Back
Top