package samba 2:4.5.8+dfsg-0ubuntu0.17.04.2 failed to install/upgrade: subprocess installed post-installation script returned error exit status 1

Bug #1693418 reported by NINSIIMA GERALD
82
This bug affects 15 people
Affects Status Importance Assigned to Milestone
samba (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

The system says it has internal error, and when I try to open some folders, it can't open.

ProblemType: Package
DistroRelease: Ubuntu 17.04
Package: samba 2:4.5.8+dfsg-0ubuntu0.17.04.2
ProcVersionSignature: Ubuntu 4.10.0-22.24-generic 4.10.15
Uname: Linux 4.10.0-22-generic x86_64
ApportVersion: 2.20.4-0ubuntu4.1
Architecture: amd64
Date: Thu May 25 05:05:39 2017
ErrorMessage: subprocess installed post-installation script returned error exit status 1
InstallationDate: Installed on 2017-05-09 (16 days ago)
InstallationMedia: Ubuntu 17.04 "Zesty Zapus" - Release amd64 (20170412)
NmbdLog:

RelatedPackageVersions:
 dpkg 1.18.10ubuntu2
 apt 1.4
SambaServerRegression: No
SmbConfIncluded: Yes
SmbLog:

SourcePackage: samba
Title: package samba 2:4.5.8+dfsg-0ubuntu0.17.04.2 failed to install/upgrade: subprocess installed post-installation script returned error exit status 1
UpgradeStatus: No upgrade log present (probably fresh install)
WindowsFailedConnect: Yes

Revision history for this message
NINSIIMA GERALD (ninsiimagerald) wrote :
Revision history for this message
Seth Arnold (seth-arnold) wrote : Bug is not a security issue

Thanks for taking the time to report this bug and helping to make Ubuntu better. We appreciate the difficulties you are facing, but this appears to be a "regular" (non-security) bug. I have unmarked it as a security issue since this bug does not show evidence of allowing attackers to cross privilege boundaries nor directly cause loss of data/privacy. Please feel free to report any other bugs you may find.

information type: Private Security → Public
tags: removed: need-duplicate-check
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Can you please attach the /var/log/samba/log* files to this bug?

Changed in samba (Ubuntu):
status: New → Incomplete
Revision history for this message
Hans-Dominik (hdm-mail) wrote :

dpkg --configure -a
Setting up winbind (2:4.5.8+dfsg-0ubuntu0.17.04.2) ...
Job for winbind.service failed because the control process exited with error code.
See "systemctl status winbind.service" and "journalctl -xe" for details.
invoke-rc.d: initscript winbind, action "start" failed.
● winbind.service - Samba Winbind Daemon
   Loaded: loaded (/lib/systemd/system/winbind.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Tue 2017-05-30 07:59:48 CEST; 4ms ago
     Docs: man:winbindd(8)
           man:samba(7)
           man:smb.conf(5)
  Process: 7658 ExecStart=/usr/sbin/winbindd $WINBINDOPTIONS (code=exited, status=1/FAILURE)
 Main PID: 7658 (code=exited, status=1/FAILURE)

Mai 30 07:59:48 pdc systemd[1]: Starting Samba Winbind Daemon...
Mai 30 07:59:48 pdc systemd[1]: winbind.service: Main process exited, code=exited, status=1/FAILURE
Mai 30 07:59:48 pdc systemd[1]: Failed to start Samba Winbind Daemon.
Mai 30 07:59:48 pdc systemd[1]: winbind.service: Unit entered failed state.
Mai 30 07:59:48 pdc systemd[1]: winbind.service: Failed with result 'exit-code'.
dpkg: error processing package winbind (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up samba (2:4.5.8+dfsg-0ubuntu0.17.04.2) ...
Job for smbd.service failed because the control process exited with error code.
See "systemctl status smbd.service" and "journalctl -xe" for details.
invoke-rc.d: initscript smbd, action "start" failed.
● smbd.service - Samba SMB Daemon
   Loaded: loaded (/lib/systemd/system/smbd.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Tue 2017-05-30 07:59:49 CEST; 4ms ago
     Docs: man:smbd(8)
           man:samba(7)
           man:smb.conf(5)
  Process: 7719 ExecStart=/usr/sbin/smbd $SMBDOPTIONS (code=exited, status=1/FAILURE)
 Main PID: 7719 (code=exited, status=1/FAILURE)

Mai 30 07:59:49 pdc systemd[1]: Starting Samba SMB Daemon...
Mai 30 07:59:49 pdc smbd[7719]: [2017/05/30 07:59:49.056486, 0] ../source3/smbd/server.c:1698(main)
Mai 30 07:59:49 pdc smbd[7719]: server role = 'active directory domain controller' not compatible with running smbd standalone.
Mai 30 07:59:49 pdc systemd[1]: smbd.service: Main process exited, code=exited, status=1/FAILURE
Mai 30 07:59:49 pdc systemd[1]: Failed to start Samba SMB Daemon.
Mai 30 07:59:49 pdc systemd[1]: smbd.service: Unit entered failed state.
Mai 30 07:59:49 pdc systemd[1]: smbd.service: Failed with result 'exit-code'.
dpkg: error processing package samba (--configure):
 subprocess installed post-installation script returned error exit status 1
Processing triggers for libc-bin (2.24-9ubuntu2) ...
Errors were encountered while processing:
 winbind
 samba

Revision history for this message
Hans-Dominik (hdm-mail) wrote :

root@pdc:~# journalctl -xe
....

Mai 30 07:59:49 pdc smbd[7719]: [2017/05/30 07:59:49.056486, 0] ../source3/smbd/server.c:1698(main)
Mai 30 07:59:49 pdc smbd[7719]: server role = 'active directory domain controller' not compatible with running smbd standalone.
Mai 30 07:59:49 pdc smbd[7719]: You should start 'samba' instead, and it will control starting smbd if required
Mai 30 07:59:49 pdc systemd[1]: smbd.service: Main process exited, code=exited, status=1/FAILURE
Mai 30 07:59:49 pdc systemd[1]: Failed to start Samba SMB Daemon.
-- Subject: Unit smbd.service has failed

Revision history for this message
Hans-Dominik (hdm-mail) wrote :

This hapens after unatended upgrade and leaves the pakages in a faild state.

Revision history for this message
Hans-Dominik (hdm-mail) wrote :

/etc/samba/smb.conf

# Global parameters
[global]
        workgroup = Domain
        realm = Domain.tld
        netbios name = PDC
        server role = active directory domain controller
        dns forwarder = 192.168.216.1
        allow dns updates = nonsecure and secure
        idmap_ldb:use rfc2307 = yes
        time server = yes
        ntp signd socket directory = /var/lib/samba/ntp_signd/
        ldap server require strong auth = no
        wins support = Yes
        preferred master = yes
        domain master = yes
        local master = yes
        os level = 100
        log level = 1 passdb:5 auth:5
[netlogon]
        path = /var/lib/samba/sysvol/Domain.tld/scripts
        read only = No

[sysvol]
        path = /var/lib/samba/sysvol
        read only = No

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

The smb.conf snippet from comment #7 is very different from the SMBConf.txt attachment to this bug. Comment #7's is an AD controller, whereas the attachment is for a standalone server. This changes things.

That being said, this seems to be the issue:
Mai 30 07:59:49 pdc smbd[7719]: You should start 'samba' instead, and it will control starting smbd if required

When using samba as an AD controller, you have to use a different systemd job. Run the following:

sudo systemctl mask smbd.service
sudo systemctl mask nmbd.service
sudo systemctl unmask samba-ad-dc.service

Then try "sudo apt -f install" or "sudo dpkg --configure -a".

You may have to start samba-ad-dc explicitly:

sudo systemctl start samba-ad-dc.service

The error log message is a bit misleading, talking about a "samba" service. It looks like samba-ad-dc replaces it.

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

If you want to use winbindd, you also have to mask winbind.service. In the AD DC scenario, the "samba-ad-dc.service" service manages all that and starts winbindd on its own.

This is what the process tree looks like in an AD DC scenario with winbindd: http://pastebin.ubuntu.com/24715447/

Revision history for this message
Hans-Dominik (hdm-mail) wrote :

This solved my problem, Thanks a lot!

But shouldn't this be done automatically by the post / pre install scripts ?

This happens at two of my servers after unattended upgrade. After the last Samba Security release.

so I think security updates shouldnt bring a server in a fault state ...

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Yeah, it's mentioned briefly (and generically) in the package TODO file:
"""
Other TODOs

- handle ad-dc stuff
  - have debconf question to configure ad dc
    - the packaging from the old samba4/samba-ad-dc packages can help there
"""

Better support for AD control, including this upgrade scenario you hit in particular, would definitely be welcome, but looks like we are not there yet. For now, if you configure samba to be an AD controller, you need to know which services to start and stop.

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

I'll mark this particular bug as invalid, since it was a local configuration error (even though it's a bit obscure). You are welcome to file a more generic bug about better Active Directory Controller support in the sense that the package could ask you that question and setup the services that need to be started/stopped on its own.

Changed in samba (Ubuntu):
status: Incomplete → Invalid
Revision history for this message
Dave Douglas (gpfdave) wrote :
Download full text (6.5 KiB)

Was having this issue initially on fresh install of 16.04LTS and reported that version. Last night I upgraded to 17.04 without Samba installed. After reboot I tried installing Samba and got the same stop error again.

udo apt-get install samba

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  linux-image-4.4.0-83-generic linux-image-extra-4.4.0-83-generic
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  attr libaio1 libboost-random1.62.0 libcephfs1 python-dnspython
  samba-dsdb-modules samba-vfs-modules tdb-tools
Suggested packages:
  bind9 bind9utils ctdb ldb-tools ntp | chrony smbldap-tools winbind
The following NEW packages will be installed:
  attr libaio1 libboost-random1.62.0 libcephfs1 python-dnspython samba
  samba-dsdb-modules samba-vfs-modules tdb-tools
0 upgraded, 9 newly installed, 0 to remove and 0 not upgraded.
Need to get 3,325 kB/3,351 kB of archives.
After this operation, 21.0 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://us.archive.ubuntu.com/ubuntu zesty/main amd64 python-dnspython all 1.15.0-1 [84.9 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu zesty/main amd64 tdb-tools amd64 1.3.11-2 [21.4 kB]
Get:3 http://us.archive.ubuntu.com/ubuntu zesty-updates/main amd64 samba amd64 2:4.5.8+dfsg-0ubuntu0.17.04.3 [836 kB]
Get:4 http://us.archive.ubuntu.com/ubuntu zesty/main amd64 libaio1 amd64 0.3.110-3 [6,382 B]
Get:5 http://us.archive.ubuntu.com/ubuntu zesty/main amd64 libboost-random1.62.0 amd64 1.62.0+dfsg-4 [11.1 kB]
Get:6 http://us.archive.ubuntu.com/ubuntu zesty-updates/main amd64 libcephfs1 amd64 10.2.7-0ubuntu0.17.04.1 [1,862 kB]
Get:7 http://us.archive.ubuntu.com/ubuntu zesty-updates/main amd64 samba-dsdb-modules amd64 2:4.5.8+dfsg-0ubuntu0.17.04.3 [232 kB]
Get:8 http://us.archive.ubuntu.com/ubuntu zesty-updates/main amd64 samba-vfs-modules amd64 2:4.5.8+dfsg-0ubuntu0.17.04.3 [272 kB]
Fetched 3,325 kB in 1s (2,707 kB/s)
Selecting previously unselected package python-dnspython.
(Reading database ... 258898 files and directories currently installed.)
Preparing to unpack .../0-python-dnspython_1.15.0-1_all.deb ...
Unpacking python-dnspython (1.15.0-1) ...
Selecting previously unselected package tdb-tools.
Preparing to unpack .../1-tdb-tools_1.3.11-2_amd64.deb ...
Unpacking tdb-tools (1.3.11-2) ...
Selecting previously unselected package samba.
Preparing to unpack .../2-samba_2%3a4.5.8+dfsg-0ubuntu0.17.04.3_amd64.deb ...
Unpacking samba (2:4.5.8+dfsg-0ubuntu0.17.04.3) ...
Selecting previously unselected package attr.
Preparing to unpack .../3-attr_1%3a2.4.47-2_amd64.deb ...
Unpacking attr (1:2.4.47-2) ...
Selecting previously unselected package libaio1:amd64.
Preparing to unpack .../4-libaio1_0.3.110-3_amd64.deb ...
Unpacking libaio1:amd64 (0.3.110-3) ...
Selecting previously unselected package libboost-random1.62.0:amd64.
Preparing to unpack .../5-libboost-random1.62.0_1.62.0+dfsg-4_amd64.deb ...
Unpacking libboost-random1.62.0:amd64 (1.62.0+dfsg-4) ...
Selecting previously unselected package libcephfs...

Read more...

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

@gpfdave, please open a new bug describing your problem and attaching /var/log/samba/log* and /etc/samba/smb.conf files please. From the bits you posted, it's a different issue.

You can do so by invoking "apport-bug samba"

Thanks

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

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.