package bacula-sd 9.4.2-2ubuntu3 failed to install/upgrade: installed bacula-sd package post-installation script subprocess returned error exit status 2

Bug #1861514 reported by benjamin langston
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
bacula (Ubuntu)
Fix Released
High
Lucas Kanashiro

Bug Description

sudo apt install bacula-sd
[sudo] password for bennylangston:
Reading package lists... Done
Building dependency tree
Reading state information... Done
bacula-sd is already the newest version (9.4.2-2ubuntu3).
The following packages were automatically installed and are no longer required:
  libffi6 libsbc1 linux-modules-4.15.0-1050-oem
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up bacula-sd (9.4.2-2ubuntu3) ...
/var/lib/dpkg/info/bacula-sd.postinst: 20: cannot create /tmp/bacula-sd.conf.ucftmp-FdWyL4UBja: Permission denied
dpkg: error processing package bacula-sd (--configure):
 installed bacula-sd package post-installation script subprocess returned error exit status 2
dpkg: dependency problems prevent configuration of bacula-bscan:
 bacula-bscan depends on bacula-sd (= 9.4.2-2ubuntu3); however:
  Package bacula-sd is not configured yet.

dpkg: error processing package bacula-bscan (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup erro
r from a previous failure.
                          Errors were encountered while processing:
 bacula-sd
 bacula-bscan
E: Sub-process /usr/bin/dpkg returned an error code (1)

ProblemType: Package
DistroRelease: Ubuntu 20.04
Package: bacula-sd 9.4.2-2ubuntu3
ProcVersionSignature: Ubuntu 5.4.0-12.15-generic 5.4.8
Uname: Linux 5.4.0-12-generic x86_64
ApportVersion: 2.20.11-0ubuntu16
Architecture: amd64
Date: Fri Jan 31 08:37:38 2020
ErrorMessage: installed bacula-sd package post-installation script subprocess returned error exit status 2
InstallationDate: Installed on 2020-01-30 (0 days ago)
InstallationMedia: Ubuntu 20.04 LTS "Focal Fossa" - Alpha amd64 (20191225)
Python3Details: /usr/bin/python3.7, Python 3.7.6, python3-minimal, 3.7.5-1ubuntu1
PythonDetails: N/A
RelatedPackageVersions:
 dpkg 1.19.7ubuntu2
 apt 1.9.8
SourcePackage: bacula
Title: package bacula-sd 9.4.2-2ubuntu3 failed to install/upgrade: installed bacula-sd package post-installation script subprocess returned error exit status 2
UpgradeStatus: No upgrade log present (probably fresh install)

Related branches

Revision history for this message
benjamin langston (graphyconweb) wrote :
Revision history for this message
benjamin langston (graphyconweb) wrote :

sudo apt autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  libffi6 libsbc1 linux-modules-4.15.0-1050-oem
0 upgraded, 0 newly installed, 3 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 237 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 191721 files and directories currently installed.)
Removing libffi6:amd64 (3.2.1-9) ...
Removing libsbc1:amd64 (1.4-1) ...
Removing linux-modules-4.15.0-1050-oem (4.15.0-1050.57) ...
Setting up bacula-sd (9.4.2-2ubuntu3) ...
/var/lib/dpkg/info/bacula-sd.postinst: 20: cannot create /tmp/bacula-sd.conf.ucf
tmp-mzPPNjKGZk: Permission denied
dpkg: error processing package bacula-sd (--configure):
 installed bacula-sd package post-installation script subprocess returned error
exit status 2
dpkg: dependency problems prevent configuration of bacula-bscan:
 bacula-bscan depends on bacula-sd (= 9.4.2-2ubuntu3); however:
  Package bacula-sd is not configured yet.

dpkg: error processing package bacula-bscan (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup erro
r from a previous failure.
                          Processing triggers for libc-bin (2.30-0ubuntu3) ...
Errors were encountered while processing:
 bacula-sd
 bacula-bscan
E: Sub-process /usr/bin/dpkg returned an error code (1)

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
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in bacula (Ubuntu):
status: New → Confirmed
Revision history for this message
Lucas Kanashiro (lucaskanashiro) wrote :

I tried to install bacula/9.4.2-2ubuntu4 in a clean Ubuntu Focal LXD container and got this exactly failure. As you can see this is the part of the log relevant for this issue:

Setting up bacula-sd (9.4.2-2ubuntu3) ...
/var/lib/dpkg/info/bacula-sd.postinst: 20: cannot create /tmp/bacula-sd.conf.ucftmp-FdWyL4UBja: Permission denied
dpkg: error processing package bacula-sd (--configure):
 installed bacula-sd package post-installation script subprocess returned error exit status 2

The bacula-sd postinst script creates a temporary file and tries to use it to handle the conffile template, replacing the passwords and so on. The problem is that before adding content to this temporary file it changes its permission and owner, and after that even root user is not able to modify it (sed command in line 20).

If you place lines 17 and 18 (chmod and chown) of the bacula-sd postinst script after the sed command (line 20), and run 'apt install -f' the installation is finished successfully.

Changed in bacula (Ubuntu):
importance: Undecided → High
assignee: nobody → Lucas Kanashiro (lucaskanashiro)
Revision history for this message
Lucas Kanashiro (lucaskanashiro) wrote :
Changed in bacula (Ubuntu):
status: Confirmed → In Progress
Changed in bacula (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package bacula - 9.4.2-2ubuntu5

---------------
bacula (9.4.2-2ubuntu5) focal; urgency=medium

  * d/bacula-sd.postinst: let root user modify $TMP_CONFIG file
    (LP: #1861514). Currently, the root user tries to modify the $TMP_CONFIG
    file and it gets a permission denied error because the persmission and owner
    is changed before any modification in this file is applied. Letting root
    user modify $TMP_CONFIG first and then set the permissions fix this
    installation issue.

 -- Lucas Kanashiro <email address hidden> Mon, 13 Apr 2020 19:05:09 -0300

Changed in bacula (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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