package samba 2:4.6.7+dfsg-1ubuntu3.1 failed to install/upgrade: subprocess installed post-installation script returned error exit status 1

Bug #1755383 reported by Jaco Bergh on 2018-03-13
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
samba (Ubuntu)
Undecided
Unassigned

Bug Description

error

ProblemType: Package
DistroRelease: Ubuntu 17.10
Package: samba 2:4.6.7+dfsg-1ubuntu3.1
ProcVersionSignature: Ubuntu 4.13.0-36.40-generic 4.13.13
Uname: Linux 4.13.0-36-generic x86_64
ApportVersion: 2.20.7-0ubuntu3.7
Architecture: amd64
Date: Tue Mar 13 09:12:45 2018
ErrorMessage: subprocess installed post-installation script returned error exit status 1
InstallationDate: Installed on 2018-02-20 (20 days ago)
InstallationMedia: Ubuntu 16.04.3 LTS "Xenial Xerus" - Release amd64 (20170801)
NmbdLog:

Python3Details: /usr/bin/python3.6, Python 3.6.3, python3-minimal, 3.6.3-0ubuntu2
PythonDetails: /usr/bin/python2.7, Python 2.7.14, python-minimal, 2.7.14-2ubuntu1
RelatedPackageVersions:
 dpkg 1.18.24ubuntu1
 apt 1.5.1
SambaServerRegression: Yes
SmbConfIncluded: Yes
SmbLog:

SourcePackage: samba
TestparmExitCode: 0
Title: package samba 2:4.6.7+dfsg-1ubuntu3.1 failed to install/upgrade: subprocess installed post-installation script returned error exit status 1
UpgradeStatus: Upgraded to artful on 2018-03-12 (0 days ago)
WindowsFailedConnect: Yes

Jaco Bergh (jaco-bergh23) wrote :
tags: removed: need-duplicate-check
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in samba (Ubuntu):
status: New → Confirmed
Andreas Hasenack (ahasenack) wrote :

Thanks for filing this bug in Ubuntu.

Unfortunately there is not enough information in the attached logs to determine why the service restart failed at the postinst stage.

Please attach the samba log files from /var/log/samba/log* as they may have more details.

Thanks

Changed in samba (Ubuntu):
status: Confirmed → Incomplete
Matthias Sommer (sunny0815) wrote :
Matthias Sommer (sunny0815) wrote :
Matthias Sommer (sunny0815) wrote :

The problem occurs not during normal use but on updating samba. So I assume the log files will not help much.

This is what appears in /var/log/apt/term.log:

samba (2:4.6.7+dfsg-1ubuntu3.2) wird eingerichtet ...
Failed to preset unit: Unit file /etc/systemd/system/samba-ad-dc.service is masked.
/usr/bin/deb-systemd-helper: error: systemctl preset failed on samba-ad-dc.service: No such file or directory
Job for nmbd.service failed because a timeout was exceeded.

systemctl status nmbd.service tells:

Mär 15 08:13:54 S205 systemd[1]: Starting Samba NMB Daemon...
Mär 15 08:13:59 S205 systemd[1]: nmbd.service: Supervising process 1035 which is not our child. We'l
Mär 15 08:14:15 S205 systemd[1]: nmbd.service: Start operation timed out. Terminating.
Mär 15 08:14:15 S205 systemd[1]: nmbd.service: Killing process 1035 (nmbd) with signal SIGKILL.
Mär 15 08:14:15 S205 systemd[1]: nmbd.service: Killing process 1035 (nmbd) with signal SIGKILL.
Mär 15 08:14:15 S205 systemd[1]: Failed to start Samba NMB Daemon.
Mär 15 08:14:15 S205 systemd[1]: nmbd.service: Unit entered failed state.
Mär 15 08:14:15 S205 systemd[1]: nmbd.service: Failed with result 'timeout'.

The logs really have no info about what happened on upgrade.

But if that is reproducible you should be able to run e.g.
  $ sudo apt install --reinstall samba

That should trigger the error again and after that the logs should hold some info why they failed to start.

TL;DR:
1. $ sudo apt install --reinstall samba
2. If above fails report the content of the two logs after that
3. sharing the full output of
   $ systemctl status smbd
   $ systemctl status nmbd

Matthias Sommer (sunny0815) wrote :

1. $ sudo apt install --reinstall samba

results in:

    E: Internal Error, No file name for samba:i386

so I did "sudo apt full-upgrade"

resulting in:

    samba (2:4.6.7+dfsg-1ubuntu3.2) wird eingerichtet ...
    Failed to preset unit: Unit file /etc/systemd/system/samba-ad-dc.service is masked.
    /usr/bin/deb-systemd-helper: error: systemctl preset failed on samba-ad-dc.service: No such file or directory

systemctl status smbd
● smbd.service - Samba SMB Daemon
   Loaded: loaded (/lib/systemd/system/smbd.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2018-03-16 11:04:00 CET; 46s ago
     Docs: man:smbd(8)
           man:samba(7)
           man:smb.conf(5)
 Main PID: 20015 (smbd)
   Status: "smbd: ready to serve connections..."
    Tasks: 4 (limit: 4915)
   CGroup: /system.slice/smbd.service
           ├─20015 /usr/sbin/smbd
           ├─20016 /usr/sbin/smbd
           ├─20017 /usr/sbin/smbd
           └─20020 /usr/sbin/smbd

Mär 16 11:04:00 S205 systemd[1]: Starting Samba SMB Daemon...
Mär 16 11:04:00 S205 systemd[1]: smbd.service: Supervising process 20015 which is not our child. We'
Mär 16 11:04:00 S205 systemd[1]: Started Samba SMB Daemon.

systemctl status nmbd
● nmbd.service - Samba NMB Daemon
   Loaded: loaded (/lib/systemd/system/nmbd.service; enabled; vendor preset: enabled)
   Active: failed (Result: timeout) since Fri 2018-03-16 11:04:22 CET; 53s ago
     Docs: man:nmbd(8)
           man:samba(7)
           man:smb.conf(5)
 Main PID: 20069
   Status: "nmbd: No local IPv4 non-loopback interfaces available, waiting for interface ..."
    Tasks: 0 (limit: 4915)
   CGroup: /system.slice/nmbd.service

Mär 16 11:04:01 S205 systemd[1]: Starting Samba NMB Daemon...
Mär 16 11:04:01 S205 systemd[1]: nmbd.service: Supervising process 20069 which is not our child. We'
Mär 16 11:04:22 S205 systemd[1]: nmbd.service: Start operation timed out. Terminating.
Mär 16 11:04:22 S205 systemd[1]: nmbd.service: Killing process 20069 (nmbd) with signal SIGKILL.
Mär 16 11:04:22 S205 systemd[1]: nmbd.service: Killing process 20069 (nmbd) with signal SIGKILL.
Mär 16 11:04:22 S205 systemd[1]: Failed to start Samba NMB Daemon.
Mär 16 11:04:22 S205 systemd[1]: nmbd.service: Unit entered failed state.
Mär 16 11:04:22 S205 systemd[1]: nmbd.service: Failed with result 'timeout'.

Andreas Hasenack (ahasenack) wrote :

[2018/03/15 08:13:59.704746, 0] ../lib/util/become_daemon.c:135(daemon_status)
  STATUS=daemon 'nmbd' : No local IPv4 non-loopback interfaces available, waiting for interface ...NOTE: NetBIOS name resolution is not supported for Internet Protocol Version 6 (IPv6).

That is a symptom of nmbd starting up when there is no network interface up yet. systemd will kill it after a timeout, which explains the "Killing process xxxxx" messages that follow. That is https://bugs.launchpad.net/ubuntu/+source/samba/+bug/1731502 also filed upstream.

It's odd to not have networking during an apt upgrade. Maybe it's using the cached packages in /var/cache?

Can you verify your networking situation when the updates are applied, and/or specifically when nmbd is restarted?

Matthias Sommer (sunny0815) wrote :

same as now:

ifconfig -a
eth0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
        ether f0:de:f1:cc:01:bd txqueuelen 1000 (Ethernet)
        RX packets 0 bytes 0 (0.0 B)
        RX errors 0 dropped 0 overruns 0 frame 0
        TX packets 0 bytes 0 (0.0 B)
        TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
        inet 127.0.0.1 netmask 255.0.0.0
        inet6 ::1 prefixlen 128 scopeid 0x10<host>
        loop txqueuelen 1000 (Lokale Schleife)
        RX packets 3281 bytes 298577 (298.5 KB)
        RX errors 0 dropped 0 overruns 0 frame 0
        TX packets 3281 bytes 298577 (298.5 KB)
        TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

ppp0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1500
        inet 100.104.94.141 netmask 255.255.255.255 destination 0.0.0.0
        ppp txqueuelen 3 (Punkt-zu-Punkt-Verbindung)
        RX packets 245957 bytes 255262205 (255.2 MB)
        RX errors 0 dropped 0 overruns 0 frame 0
        TX packets 194814 bytes 76531615 (76.5 MB)
        TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

wlan0: flags=4098<BROADCAST,MULTICAST> mtu 1500
        ether 64:27:37:7d:f6:80 txqueuelen 1000 (Ethernet)
        RX packets 0 bytes 0 (0.0 B)
        RX errors 0 dropped 0 overruns 0 frame 0
        TX packets 0 bytes 0 (0.0 B)
        TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

Andreas Hasenack (ahasenack) wrote :

Ok, what happens right now then when you do:

sudo systemctl restart nmbd.service smbd.service
sudo systemctl status nmbd.service smbd.service

And please attach /var/log/samba/log* after having run those commands.

Sometimes there is information in log files named like "log." or some other variant, the logging is a bit confusing.

Matthias Sommer (sunny0815) wrote :

first command:
Job for nmbd.service failed because a timeout was exceeded.

second:
sudo systemctl status nmbd.service smbd.service
● nmbd.service - Samba NMB Daemon
   Loaded: loaded (/lib/systemd/system/nmbd.service; enabled; vendor preset: enabled)
   Active: failed (Result: timeout) since Fri 2018-03-16 16:34:42 CET; 59s ago
     Docs: man:nmbd(8)
           man:samba(7)
           man:smb.conf(5)
 Main PID: 18697
   Status: "Starting process..."

Mär 16 16:34:22 S205 systemd[1]: Starting Samba NMB Daemon...
Mär 16 16:34:24 S205 systemd[1]: nmbd.service: Supervising process 18697 which is not our child. We'
Mär 16 16:34:42 S205 systemd[1]: nmbd.service: Start operation timed out. Terminating.
Mär 16 16:34:42 S205 systemd[1]: nmbd.service: Killing process 18697 (nmbd) with signal SIGKILL.
Mär 16 16:34:42 S205 systemd[1]: nmbd.service: Killing process 18697 (nmbd) with signal SIGKILL.
Mär 16 16:34:42 S205 systemd[1]: Failed to start Samba NMB Daemon.
Mär 16 16:34:42 S205 systemd[1]: nmbd.service: Unit entered failed state.
Mär 16 16:34:42 S205 systemd[1]: nmbd.service: Failed with result 'timeout'.

● smbd.service - Samba SMB Daemon
   Loaded: loaded (/lib/systemd/system/smbd.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2018-03-16 16:34:42 CET; 58s ago
     Docs: man:smbd(8)
           man:samba(7)
           man:smb.conf(5)
 Main PID: 18725 (smbd)
   Status: "smbd: ready to serve connections..."
    Tasks: 4 (limit: 4915)
   CGroup: /system.slice/smbd.service
           ├─18725 /usr/sbin/smbd
           ├─18726 /usr/sbin/smbd
           ├─18727 /usr/sbin/smbd
           └─18729 /usr/sbin/smbd

Mär 16 16:34:42 S205 systemd[1]: Starting Samba SMB Daemon...
Mär 16 16:34:42 S205 systemd[1]: smbd.service: Supervising process 18725 which is not our child. We'
Mär 16 16:34:42 S205 systemd[1]: Started Samba SMB Daemon.

Matthias Sommer (sunny0815) wrote :
Andreas Hasenack (ahasenack) wrote :

smbd is coming up just fine

nmbd is still complaining it found no non-loopback interfaces to attach itself to:
[2018/03/16 16:34:24.049430, 0] ../lib/util/become_daemon.c:135(daemon_status)
  STATUS=daemon 'nmbd' : No local IPv4 non-loopback interfaces available, waiting for interface ...NOTE: NetBIOS name resolution is not supported for Internet Protocol Version 6 (IPv6).

I think it doesn't like that you only have ppp0 with an IP. Is your intention to share samba files and do netbios name resolution via the ppp0 link?

Matthias Sommer (sunny0815) wrote :

I only use samba on rare occations and then usually via eth0.
That used to work. I only want to get rid of the error on doing updates.

Andreas Hasenack (ahasenack) wrote :

nmbd (the netbios name resolution daemon) will not work on a ppp0 link, because it doesn't have a broadcast address.

I suggest you disable the samba services if you are not going to use them very often, or at least disable the nmbd one. And only bring them up when you actually want to share something on your local network and have eth0 up and connected.

To disable nmbd:

sudo systemctl stop nmbd.service # might fail because it's not running, that's ok
sudo systemctl disable nmbd.service

To disable smbd, it's similar:
sudo systemctl stop smbd.service
sudo systemctl disable smbd.service

Then tell apt to try to fix the remaining installation issues:
sudo apt update
sudo apt -f install

The message below which you might still see is harmless:
/usr/bin/deb-systemd-helper: error: systemctl preset failed on samba-ad-dc.service: No such file or directory

Whenever you want to use samba again, run the systemctl commands again with "start" instead of "stop". Or remove the samba-common packages altogether.

Andreas Hasenack (ahasenack) wrote :

The remaining bug here I think is https://bugs.launchpad.net/ubuntu/+source/samba/+bug/1731502

nmbd does start up in such scenarios, and just waits for a usable interface to come up. It doesn't tell systemd that it started, though, and after a while systemd kills nmbd because of that.

I'll mark this bug as a duplicate of that one.

Matthias Sommer (sunny0815) wrote :

stopping and disabling both samba services worked.

Thank You!

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers