Bug 1924571

Summary: smb.service stops when samba rpms are updated
Product: Red Hat Enterprise Linux 8 Reporter: Sebastien Aime <saime>
Component: sambaAssignee: Andreas Schneider <asn>
Status: CLOSED ERRATA QA Contact: sssd-qe <sssd-qe>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.3CC: abokovoy, asn, dkarpele, gdeschner, jarrpa, mkosek
Target Milestone: rcKeywords: Triaged
Target Release: 8.0   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: samba-4.13.3-3.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-05-18 14:59:31 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
sosreport from reproducer VM none

Description Sebastien Aime 2021-02-03 08:42:58 UTC
Hello all,

If samba rpm packages are updated while smb.service is running, it stops.

systemctl status smb.service shows:

● smb.service - Samba SMB Daemon
   Loaded: loaded (/usr/lib/systemd/system/smb.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Thu 2021-01-28 16:08:20 CET; 12s ago
     Docs: man:smbd(8)
           man:samba(7)
           man:smb.conf(5)
 Main PID: 3581 (code=exited, status=1/FAILURE)

Jan 28 16:08:20 localhost.localdomain systemd[1]: Stopped Samba SMB Daemon.
Jan 28 16:08:20 localhost.localdomain systemd[1]: Starting Samba SMB Daemon...
Jan 28 16:08:20 localhost.localdomain smbd[3581]: /usr/sbin/smbd: /usr/lib64/samba/libreplace-samba4.so: version `SAMBA_4.9.1' not found (required by /lib64/libwbclient.so.0)
Jan 28 16:08:20 localhost.localdomain smbd[3581]: /usr/sbin/smbd: /usr/lib64/samba/libwinbind-client-samba4.so: version `SAMBA_4.9.1' not found (required by /lib64/libwbclient.so.0)
Jan 28 16:08:20 localhost.localdomain systemd[1]: smb.service: Main process exited, code=exited, status=1/FAILURE
Jan 28 16:08:20 localhost.localdomain systemd[1]: smb.service: Failed with result 'exit-code'.
Jan 28 16:08:20 localhost.localdomain systemd[1]: Failed to start Samba SMB Daemon.

Restarting smb.service fixes the issue.

Steps to reproduce:

1. I install a RHEL8.0 VM (any minor version will do as long as it's not the most recent one)
2. Set the system release version to 8.0

    # subscription-manager release --set=8.0

3. Install samba rpms packages
4. Enable and start smb.service

    # systemctl enable smb.service ; systemctl start smb.service

5. Set the system release version to 8.3 (any minor version will do as long as it's not the oldest one)

    # subscription-manager release --set=8.3

6. While smb.service is running, update samba packages

7. Check the status of smb.service (you will find it failed)

Comment 2 Alexander Bokovoy 2021-02-03 08:57:21 UTC
Could you please provide the whole log for the upgrade.

It looks like the issue is that a restart happens before all libraries were updated.

Comment 3 Sebastien Aime 2021-02-03 09:32:27 UTC
Created attachment 1754632 [details]
sosreport from reproducer VM

Comment 4 Sebastien Aime 2021-02-03 09:34:14 UTC
Hello Alexander,

I have installed a new VM, reproduced the issue and collected a sosreport. Please let me know if you need anything else.

Best regards,

Sebastien.

Comment 5 Alexander Bokovoy 2021-02-03 09:54:57 UTC
Thanks, it looks like this is indeed an order of updates that is broken here.

Final part of the upgrade where 

2021-02-03T09:22:47Z SUBDEBUG Upgraded: samba-4.9.1-8.el8.x86_64
2021-02-03T09:22:47Z SUBDEBUG Upgraded: samba-4.9.1-8.el8.x86_64
2021-02-03T09:22:47Z SUBDEBUG Upgraded: samba-common-tools-4.9.1-8.el8.x86_64
2021-02-03T09:22:47Z SUBDEBUG Upgraded: samba-common-tools-4.9.1-8.el8.x86_64
2021-02-03T09:22:47Z SUBDEBUG Upgraded: samba-libs-4.9.1-8.el8.x86_64
2021-02-03T09:22:47Z SUBDEBUG Upgraded: samba-libs-4.9.1-8.el8.x86_64
2021-02-03T09:22:47Z SUBDEBUG Upgraded: libwbclient-4.9.1-8.el8.x86_64
2021-02-03T09:22:47Z SUBDEBUG Upgraded: libwbclient-4.9.1-8.el8.x86_64
2021-02-03T09:22:47Z SUBDEBUG Upgraded: samba-client-libs-4.9.1-8.el8.x86_64
2021-02-03T09:22:47Z SUBDEBUG Upgraded: samba-client-libs-4.9.1-8.el8.x86_64
2021-02-03T09:22:47Z SUBDEBUG Upgraded: samba-common-libs-4.9.1-8.el8.x86_64
2021-02-03T09:22:47Z SUBDEBUG Upgraded: samba-common-libs-4.9.1-8.el8.x86_64
2021-02-03T09:22:47Z SUBDEBUG Upgraded: sssd-kcm-2.0.0-43.el8.x86_64
2021-02-03T09:22:47Z SUBDEBUG Upgraded: sssd-kcm-2.0.0-43.el8.x86_64
2021-02-03T09:22:47Z SUBDEBUG Upgraded: sssd-common-2.0.0-43.el8.x86_64
2021-02-03T09:22:47Z SUBDEBUG Upgraded: sssd-common-2.0.0-43.el8.x86_64
2021-02-03T09:22:47Z SUBDEBUG Upgraded: libldb-1.4.2-2.el8.x86_64
2021-02-03T09:22:47Z SUBDEBUG Upgraded: libldb-1.4.2-2.el8.x86_64
2021-02-03T09:22:47Z SUBDEBUG Upgraded: openssl-1:1.1.1-8.el8.x86_64
2021-02-03T09:22:47Z SUBDEBUG Upgraded: openssl-1:1.1.1-8.el8.x86_64
2021-02-03T09:22:47Z SUBDEBUG Upgraded: samba-common-4.9.1-8.el8.noarch
2021-02-03T09:22:47Z SUBDEBUG Upgraded: samba-common-4.9.1-8.el8.noarch
2021-02-03T09:22:47Z SUBDEBUG Upgraded: sssd-client-2.0.0-43.el8.x86_64
2021-02-03T09:22:47Z SUBDEBUG Upgraded: sssd-client-2.0.0-43.el8.x86_64
2021-02-03T09:22:48Z SUBDEBUG Upgraded: krb5-libs-1.16.1-22.el8.x86_64
2021-02-03T09:22:48Z SUBDEBUG Upgraded: krb5-libs-1.16.1-22.el8.x86_64
2021-02-03T09:22:48Z SUBDEBUG Upgraded: libtevent-0.9.37-2.el8.x86_64
2021-02-03T09:22:48Z SUBDEBUG Upgraded: libtevent-0.9.37-2.el8.x86_64
2021-02-03T09:22:48Z SUBDEBUG Upgraded: libtalloc-2.1.14-3.el8.x86_64
2021-02-03T09:22:48Z SUBDEBUG Upgraded: libtalloc-2.1.14-3.el8.x86_64
2021-02-03T09:22:48Z SUBDEBUG Upgraded: openssl-libs-1:1.1.1-8.el8.x86_64
2021-02-03T09:22:48Z SUBDEBUG Upgraded: openssl-libs-1:1.1.1-8.el8.x86_64
2021-02-03T09:22:48Z SUBDEBUG Upgraded: libsss_idmap-2.0.0-43.el8.x86_64
2021-02-03T09:22:48Z SUBDEBUG Upgraded: libsss_idmap-2.0.0-43.el8.x86_64
2021-02-03T09:22:48Z SUBDEBUG Upgraded: libtdb-1.3.16-3.el8.x86_64
2021-02-03T09:22:48Z SUBDEBUG Upgraded: libtdb-1.3.16-3.el8.x86_64
2021-02-03T09:22:48Z SUBDEBUG Upgraded: gnutls-3.6.5-2.el8.x86_64
2021-02-03T09:22:48Z SUBDEBUG Upgraded: gnutls-3.6.5-2.el8.x86_64


e.g. post scripts for samba package run before  upgrade of libwbclient package is completed.

%post
%systemd_post smb.service
%systemd_post nmb.service

and in samba package definition we have

%if %{with libwbclient}
Requires: libwbclient = %{samba_depver}
%endif

but we also need to have 

Requires(post): libwbclient = %{samba_depver}

to ensure that libwbclient of the correct version is available at the time of post-install scriptlet's run.

Comment 11 errata-xmlrpc 2021-05-18 14:59:31 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: samba security, bug fix, and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2021:1647