samba423 broken after upgrade?

Hi,

I've did a package upgrade on my system (FreeBSD example.com 15.1-RELEASE-p1 FreeBSD 15.1-RELEASE-p1 releng/15.1-n283582-0f691888dc56 GENERIC amd64) and afterwards samba423 was broken:

Code:
# testparm /usr/local/etc/smb4.conf
ld-elf.so.1: /usr/local/lib/samba4/private/libsamba-cluster-support-private-samba.so: version SAMBA_4.23.6_PRIVATE_SAMBA required by /usr/local/lib/compat/pkg/libsmbconf.so.0 not found

I've reverted to my BE before upgrade, did pkg lock samba423 and then the upgrade. System seems to be up to date now and Samba still working.

Any hints? Problem on my side or broken package?
 
I've tested samba423 in a fresh jail: no issue.

So, I've unlocked the samba423 and tried the upgrade again. Now I've noticed the errors during the upgrade:
Code:
[26/35] Deinstalling samba423-4.23.6_1...
[26/35] Deleting files for samba423-4.23.6_1: .....
pkg: fstat() failed for(//root/update-scripts/usr/local/lib/compat/pkg/libdcerpc-binding.so.0): No such file or directory
[26/35] Deleting files for samba423-4.23.6_1...
pkg: fstat() failed for(//root/update-scripts/usr/local/lib/compat/pkg/libdcerpc-samr.so.0): No such file or directory
[26/35] Deleting files for samba423-4.23.6_1...
pkg: fstat() failed for(//root/update-scripts/usr/local/lib/compat/pkg/libdcerpc-server-core.so.0): No such file or directory
[26/35] Deleting files for samba423-4.23.6_1...
pkg: fstat() failed for(//root/update-scripts/usr/local/lib/compat/pkg/libdcerpc-server.so.0): No such file or directory
[26/35] Deleting files for samba423-4.23.6_1...
pkg: fstat() failed for(//root/update-scripts/usr/local/lib/compat/pkg/libdcerpc.so.0): No such file or directory
[26/35] Deleting files for samba423-4.23.6_1...
pkg: fstat() failed for(//root/update-scripts/usr/local/lib/compat/pkg/libldb.so.2): No such file or directory
[26/35] Deleting files for samba423-4.23.6_1...
pkg: fstat() failed for(//root/update-scripts/usr/local/lib/compat/pkg/libndr-krb5pac.so.0): No such file or directory
[26/35] Deleting files for samba423-4.23.6_1...
pkg: fstat() failed for(//root/update-scripts/usr/local/lib/compat/pkg/libndr-nbt.so.0): No such file or directory
[26/35] Deleting files for samba423-4.23.6_1...
pkg: fstat() failed for(//root/update-scripts/usr/local/lib/compat/pkg/libndr-standard.so.0): No such file or directory
[26/35] Deleting files for samba423-4.23.6_1...
pkg: fstat() failed for(//root/update-scripts/usr/local/lib/compat/pkg/libndr.so.6): No such file or directory
[26/35] Deleting files for samba423-4.23.6_1...
pkg: fstat() failed for(//root/update-scripts/usr/local/lib/compat/pkg/libnetapi.so.1): No such file or directory
[26/35] Deleting files for samba423-4.23.6_1...
pkg: fstat() failed for(//root/update-scripts/usr/local/lib/compat/pkg/libsamba-credentials.so.1): No such file or directory
[26/35] Deleting files for samba423-4.23.6_1...
pkg: fstat() failed for(//root/update-scripts/usr/local/lib/compat/pkg/libsamba-errors.so.1): No such file or directory
[26/35] Deleting files for samba423-4.23.6_1...
pkg: fstat() failed for(//root/update-scripts/usr/local/lib/compat/pkg/libsamba-hostconfig.so.0): No such file or directory
[26/35] Deleting files for samba423-4.23.6_1...
pkg: fstat() failed for(//root/update-scripts/usr/local/lib/compat/pkg/libsamba-passdb.so.0): No such file or directory
[26/35] Deleting files for samba423-4.23.6_1...
pkg: fstat() failed for(//root/update-scripts/usr/local/lib/compat/pkg/libsamba-policy.so.0): No such file or directory
[26/35] Deleting files for samba423-4.23.6_1...
pkg: fstat() failed for(//root/update-scripts/usr/local/lib/compat/pkg/libsamba-util.so.0): No such file or directory
[26/35] Deleting files for samba423-4.23.6_1...
pkg: fstat() failed for(//root/update-scripts/usr/local/lib/compat/pkg/libsamdb.so.0): No such file or directory
[26/35] Deleting files for samba423-4.23.6_1...
pkg: fstat() failed for(//root/update-scripts/usr/local/lib/compat/pkg/libsmbclient.so.0): No such file or directory
[26/35] Deleting files for samba423-4.23.6_1...
pkg: fstat() failed for(//root/update-scripts/usr/local/lib/compat/pkg/libsmbconf.so.0): No such file or directory
[26/35] Deleting files for samba423-4.23.6_1....
pkg: fstat() failed for(//root/update-scripts/usr/local/lib/compat/pkg/libsmbldap.so.2): No such file or directory
[26/35] Deleting files for samba423-4.23.6_1...
pkg: fstat() failed for(//root/update-scripts/usr/local/lib/compat/pkg/libtevent-util.so.0): No such file or directory
[26/35] Deleting files for samba423-4.23.6_1...
pkg: fstat() failed for(//root/update-scripts/usr/local/lib/compat/pkg/libwbclient.so.0): No such file or directory
[26/35] Deleting files for samba423-4.23.6_1....... done
pkg: unlinkat(var/log/samba4): No such file or directory
[27/35] Deinstalling lmdb-1.0.0,1...
[27/35] Deleting files for lmdb-1.0.0,1: .......... done

Notice the beginning of the non existant pathes: //root/update-scripts/
This is the current directory when running pkg. So the /usr/local/lib/compat/pkg/libsmbconf.so.0 is not deleted...
 
Well, another thing:
periodic security now complaints about missing files. Again note the wrong path:

Code:
samba423-backup-libdcerpc-binding.so.0-20260722130908: missing file /root/update-scripts/usr/local/lib/compat/pkg/libdcerpc-binding.so.0
samba423-backup-libdcerpc-samr.so.0-20260722130908: missing file /root/update-scripts/usr/local/lib/compat/pkg/libdcerpc-samr.so.0
samba423-backup-libdcerpc-server-core.so.0-20260722130908: missing file /root/update-scripts/usr/local/lib/compat/pkg/libdcerpc-server-core.so.0
samba423-backup-libdcerpc-server.so.0-20260722130908: missing file /root/update-scripts/usr/local/lib/compat/pkg/libdcerpc-server.so.0
samba423-backup-libdcerpc.so.0-20260722130908: missing file /root/update-scripts/usr/local/lib/compat/pkg/libdcerpc.so.0
samba423-backup-libldb.so.2-20260722130908: missing file /root/update-scripts/usr/local/lib/compat/pkg/libldb.so.2
samba423-backup-libndr-krb5pac.so.0-20260722130908: missing file /root/update-scripts/usr/local/lib/compat/pkg/libndr-krb5pac.so.0
samba423-backup-libndr-nbt.so.0-20260722130908: missing file /root/update-scripts/usr/local/lib/compat/pkg/libndr-nbt.so.0
samba423-backup-libndr-standard.so.0-20260722130908: missing file /root/update-scripts/usr/local/lib/compat/pkg/libndr-standard.so.0
samba423-backup-libndr.so.6-20260722130908: missing file /root/update-scripts/usr/local/lib/compat/pkg/libndr.so.6
samba423-backup-libnetapi.so.1-20260722130908: missing file /root/update-scripts/usr/local/lib/compat/pkg/libnetapi.so.1
samba423-backup-libsamba-credentials.so.1-20260722130908: missing file /root/update-scripts/usr/local/lib/compat/pkg/libsamba-credentials.so.1
samba423-backup-libsamba-errors.so.1-20260722130908: missing file /root/update-scripts/usr/local/lib/compat/pkg/libsamba-errors.so.1
samba423-backup-libsamba-hostconfig.so.0-20260722130908: missing file /root/update-scripts/usr/local/lib/compat/pkg/libsamba-hostconfig.so.0
samba423-backup-libsamba-passdb.so.0-20260722130908: missing file /root/update-scripts/usr/local/lib/compat/pkg/libsamba-passdb.so.0
samba423-backup-libsamba-policy.so.0-20260722130908: missing file /root/update-scripts/usr/local/lib/compat/pkg/libsamba-policy.so.0
samba423-backup-libsamba-util.so.0-20260722130908: missing file /root/update-scripts/usr/local/lib/compat/pkg/libsamba-util.so.0
samba423-backup-libsamdb.so.0-20260722130908: missing file /root/update-scripts/usr/local/lib/compat/pkg/libsamdb.so.0
samba423-backup-libsmbclient.so.0-20260722130908: missing file /root/update-scripts/usr/local/lib/compat/pkg/libsmbclient.so.0
samba423-backup-libsmbconf.so.0-20260722130908: missing file /root/update-scripts/usr/local/lib/compat/pkg/libsmbconf.so.0
samba423-backup-libsmbldap.so.2-20260722130908: missing file /root/update-scripts/usr/local/lib/compat/pkg/libsmbldap.so.2
samba423-backup-libtevent-util.so.0-20260722130908: missing file /root/update-scripts/usr/local/lib/compat/pkg/libtevent-util.so.0
samba423-backup-libwbclient.so.0-20260722130908: missing file /root/update-scripts/usr/local/lib/compat/pkg/libwbclient.so.0
 
Well, another thing:
periodic security now complaints about missing files. Again note the wrong path:

Code:
samba423-backup-libdcerpc-binding.so.0-20260722130908: missing file /root/update-scripts/usr/local/lib/compat/pkg/libdcerpc-binding.so.0
samba423-backup-libdcerpc-samr.so.0-20260722130908: missing file /root/update-scripts/usr/local/lib/compat/pkg/libdcerpc-samr.so.0
samba423-backup-libdcerpc-server-core.so.0-20260722130908: missing file /root/update-scripts/usr/local/lib/compat/pkg/libdcerpc-server-core.so.0
samba423-backup-libdcerpc-server.so.0-20260722130908: missing file /root/update-scripts/usr/local/lib/compat/pkg/libdcerpc-server.so.0
samba423-backup-libdcerpc.so.0-20260722130908: missing file /root/update-scripts/usr/local/lib/compat/pkg/libdcerpc.so.0
samba423-backup-libldb.so.2-20260722130908: missing file /root/update-scripts/usr/local/lib/compat/pkg/libldb.so.2
samba423-backup-libndr-krb5pac.so.0-20260722130908: missing file /root/update-scripts/usr/local/lib/compat/pkg/libndr-krb5pac.so.0
samba423-backup-libndr-nbt.so.0-20260722130908: missing file /root/update-scripts/usr/local/lib/compat/pkg/libndr-nbt.so.0
samba423-backup-libndr-standard.so.0-20260722130908: missing file /root/update-scripts/usr/local/lib/compat/pkg/libndr-standard.so.0
samba423-backup-libndr.so.6-20260722130908: missing file /root/update-scripts/usr/local/lib/compat/pkg/libndr.so.6
samba423-backup-libnetapi.so.1-20260722130908: missing file /root/update-scripts/usr/local/lib/compat/pkg/libnetapi.so.1
samba423-backup-libsamba-credentials.so.1-20260722130908: missing file /root/update-scripts/usr/local/lib/compat/pkg/libsamba-credentials.so.1
samba423-backup-libsamba-errors.so.1-20260722130908: missing file /root/update-scripts/usr/local/lib/compat/pkg/libsamba-errors.so.1
samba423-backup-libsamba-hostconfig.so.0-20260722130908: missing file /root/update-scripts/usr/local/lib/compat/pkg/libsamba-hostconfig.so.0
samba423-backup-libsamba-passdb.so.0-20260722130908: missing file /root/update-scripts/usr/local/lib/compat/pkg/libsamba-passdb.so.0
samba423-backup-libsamba-policy.so.0-20260722130908: missing file /root/update-scripts/usr/local/lib/compat/pkg/libsamba-policy.so.0
samba423-backup-libsamba-util.so.0-20260722130908: missing file /root/update-scripts/usr/local/lib/compat/pkg/libsamba-util.so.0
samba423-backup-libsamdb.so.0-20260722130908: missing file /root/update-scripts/usr/local/lib/compat/pkg/libsamdb.so.0
samba423-backup-libsmbclient.so.0-20260722130908: missing file /root/update-scripts/usr/local/lib/compat/pkg/libsmbclient.so.0
samba423-backup-libsmbconf.so.0-20260722130908: missing file /root/update-scripts/usr/local/lib/compat/pkg/libsmbconf.so.0
samba423-backup-libsmbldap.so.2-20260722130908: missing file /root/update-scripts/usr/local/lib/compat/pkg/libsmbldap.so.2
samba423-backup-libtevent-util.so.0-20260722130908: missing file /root/update-scripts/usr/local/lib/compat/pkg/libtevent-util.so.0
samba423-backup-libwbclient.so.0-20260722130908: missing file /root/update-scripts/usr/local/lib/compat/pkg/libwbclient.so.0
I don't have that either.
 
This apparantly is not a samba problem, but a problem with pkg:

On another machine, that runs a postfix mail server:
Code:
[13/31] Extracting lmdb-1.0.0,1: .......... done
pkg: fstat() failed for(//root/update-scripts/usr/local/lib/compat/pkg/liblmdb.so.0): No such file or directory

Code:
# pkg which /usr/local/lib/compat/pkg/liblmdb.so.0
/usr/local/lib/compat/pkg/liblmdb.so.0 was not found in the database

Code:
Checking for packages with mismatched checksums:
lmdb-backup-liblmdb.so.0-20260723150946: missing file /root/update-scripts/usr/local/lib/compat/pkg/liblmdb.so.0

Fixing it with pkg remove lmdb-backup-liblmdb.so.0 && rm /usr/local/lib/compat/pkg/liblmdb.so.0
 
And another VM that runs a unifi controller:
Code:
[28/65] Extracting llhttp-9.4.2: 100%
pkg: fstat() failed for(//root/usr/local/lib/compat/pkg/libllhttp.so.9.3): No such file or directory
...
[46/65] Extracting simdjson-4.6.4: 100%
pkg: fstat() failed for(//root/usr/local/lib/compat/pkg/libsimdjson.so.32): No such file or directory
...
[47/65] Extracting simdutf-9.0.0: 100%
pkg: fstat() failed for(//root/usr/local/lib/compat/pkg/libsimdutf.so.33): No such file or directory
 
And finally: the issue happen with pkg 2.7.5, but not with pkg 2.6.2:
I've used the BE from before the upgrade again, locked pkg ( pkg lock pkg) and then did the upgrade. Everything went fine.
 
i am having this problem on freebsd 15.1p6, upgraded today. i am not doing anything special. running
service samba_server start issues the following errors:

Code:
Performing sanity check on Samba configuration: FAILED
Starting nmbd.
ld-elf.so.1: /usr/local/lib/samba4/private/libsamba-cluster-support-private-samba.so: version SAMBA_4.23.8_PRIVATE_SAMBA required by /usr/local/lib/compat/pkg/libsmbconf.so.0 not found
/usr/local/etc/rc.d/samba_server: WARNING: failed to start nmbd
Starting smbd.
ld-elf.so.1: /usr/local/lib/samba4/private/libauthkrb5-private-samba.so: version SAMBA_4.23.8_PRIVATE_SAMBA required by /usr/local/lib/compat/pkg/libsamba-credentials.so.1 not found
/usr/local/etc/rc.d/samba_server: WARNING: failed to start smbd

but those files are there in /usr/local/lib/compat/pkg:

Code:
snorlax:~% ls -l /usr/local/lib/compat/pkg/libsmbconf.so.0
-rw-r--r--  1 root wheel  573K Oct 19 06:41 /usr/local/lib/compat/pkg/libsmbconf.so.0

and on top of that, ldd shows it as found:

Code:
snorlax:~% ldd /usr/local/sbin/nmbd | grep libsmbconf
        libsmbconf.so.0 => /usr/local/lib/compat/pkg/libsmbconf.so.0 (0x1ed3f3778000)

and file looks good:
Code:
snorlax:~% file /usr/local/lib/compat/pkg/libsmbconf.so.0
/usr/local/lib/compat/pkg/libsmbconf.so.0: ELF 64-bit LSB shared object, x86-64, version 1 (FreeBSD), dynamically linked, for FreeBSD 15.0 (1500068), stripped

i am at a loss as to what's going wrong here, let alone remediation steps. this was fine until the samba upgrade today. is it possible pkg upgrade missed something? the versioned PRIVATE_SAMBA symbol would hint that way.

EDIT: i've since done a pkg remove samba423; pkg autoremove; pkg install samba423 and the offending library complaining about the missing symbol is libtevent.

Code:
Starting nmbd.
ld-elf.so.1: /usr/local/lib/samba4/private/libtime-basic-private-samba.so: version SAMBA_4.23.8_PRIVATE_SAMBA required by /usr/local/lib/compat/pkg/libtevent-util.so.0 not found
/usr/local/etc/rc.d/samba_server: WARNING: failed to start nmbd
Starting smbd.
ld-elf.so.1: /usr/local/lib/samba4/private/libtime-basic-private-samba.so: version SAMBA_4.23.8_PRIVATE_SAMBA required by /usr/local/lib/compat/pkg/libtevent-util.so.0 not found
/usr/local/etc/rc.d/samba_server: WARNING: failed to start smbd

more interesting: i get the same error with samba424 despite the version bump. is there some state being left around somewhere?

it seems like pkg upgrade stashed some shared libs from the old version which are what's getting referenced, though i don't know why it would do this or how to make it do the right thing:

Code:
snorlax:/usr/local/etc% pkg info | grep samba
samba423-backup-libdcerpc-samr.so.0-20261019064149 Compatibility libraries saved during package upgrade
samba423-backup-libldb.so.2-20261019064149 Compatibility libraries saved during package upgrade
samba423-backup-libsamba-errors.so.1-20261019064149 Compatibility libraries saved during package upgrade
samba423-backup-libtevent-util.so.0-20261019064149 Compatibility libraries saved during package upgrade
samba423-backup-libwbclient.so.0-20261019064149 Compatibility libraries saved during package upgrade
samba424-4.24.8                Free SMB/CIFS and AD/DC server and client for Unix

note the version differences. and these are the same libraries being referenced by smbd/nmbd which throw the errors:
Code:
snorlax:/usr/local/etc% ldd /usr/local/sbin/smbd | grep compat
        libtevent-util.so.0 => /usr/local/lib/compat/pkg/libtevent-util.so.0 (0xeb27064c000)
        libsamba-errors.so.1 => /usr/local/lib/compat/pkg/libsamba-errors.so.1 (0xeb27600a000)
        libldb.so.2 => /usr/local/lib/compat/pkg/libldb.so.2 (0xeb293f9a000)
        libwbclient.so.0 => /usr/local/lib/compat/pkg/libwbclient.so.0 (0xeb29a900000)
 
look like leftovers from a an upgrade
im pretty sure pkg which wont know who installed them
you can probably nuke them
you may have an unfinished/not done freebsd-update install
 
thanks, that was enough to get me looking in the right place. one of the issues was that tevent wasn't upgraded for some reason. upgrading that, and manually removing the backup packages that were left behind was enough to clear out the /usr/local/lib/compat/pkg directory, then reinstalling samba worked smoothly.

all of my system upgrades have been completed fully, to my recollection. however, with 15.1 i did convert to pkgbase using pkgbaseify and have been upgrading with pkg since then. it turns out that i do, indeed, have BACKUP_LIBRARIES=yes, which i don't remember specifying, so i assume pkgbaseify did it.

the problem, ultimately, is that /usr/local/libdata/ldconfig/pkg introduces the compat directory to the runtime ld.so resolver, and it took precedence over the proper versions that were correctly installed. removing the backup packages removed the wrong libraries, allowing ld-elf.so to use the correct libraries. this seems like a bug with how BACKUP_LIBRARIES works: ideally it would only use the backup shared library location when necessary, not in preference. using outdated shared libraries, when not explicitly gated like samba is here, would mean that after a system upgrade you're still using old libraries, including any security holes, and potentially introducing weird incompatibilities that could break in any number of ways.
 
Back
Top