[Bug 1851675] Re: python-augeas may fail to load libaugeas0 in postinst script
Alexander Thomas
doctor.lex at gmail.com
Thu Dec 5 16:56:02 UTC 2019
Renamed the issue to “python-augeas may fail to load libaugeas0 in
postinst script” because that proves to be the actual issue as shown in
the Debian bug report: https://bugs.debian.org/cgi-
bin/bugreport.cgi?bug=944364
** Summary changed:
- dpkg fails to properly invoke ldconfig
+ python-augeas may fail to load libaugeas0 in postinst script
** Package changed: dpkg (Ubuntu) => python-augeas (Ubuntu)
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to dpkg in Ubuntu.
https://bugs.launchpad.net/bugs/1851675
Title:
python-augeas may fail to load libaugeas0 in postinst script
Status in python-augeas package in Ubuntu:
New
Bug description:
Seen on: Ubuntu 18.04.3 LTS
dpkg version: 1.19.0.5ubuntu2.3 (also in 1.19.0.5ubuntu2.2)
Regression compared to dpkg 1.19.0.5ubuntu2.1
To reproduce this:
1. You need a package that depends on a library for running a script in its postinst hook. For instance, the attached minimal package has `Depends: python-augeas`, and tries to do “from augeas import Augeas” in a script invoked from the postinst hook. (It does nothing else.)
2. Make sure the dependent library is not yet installed. In this example: libaugeas0, which is a dependency of python-augeas.
3. apt-get install the package. For the attached exmple, you can use `dpkg -i`, followed by `apt-get -f install`.
Result:
Setting up the-package (1.2.3ubuntu1-2-1) ...
Traceback (most recent call last):
File "/usr/lib/the-package/setup-package.py", line 3, in <module>
from augeas import Augeas
File "/usr/lib/python2.7/dist-packages/augeas.py", line 78, in <module>
class Augeas(object):
File "/usr/lib/python2.7/dist-packages/augeas.py", line 82, in Augeas
_libaugeas = _dlopen("augeas")
File "/usr/lib/python2.7/dist-packages/augeas.py", line 75, in _dlopen
raise ImportError("Unable to import lib%s!" % args[0])
ImportError: Unable to import libaugeas!
dpkg: error processing package the-package (--configure):
installed the-package package post-installation script subprocess returned error exit status 1
Simply running apt-get -f install afterwards will succeed and run the
postinst script.
The cause of this problem seems to be either that any invocations of
`ldconfig` during the installation of the dependent libraries, do
nothing at all, or rather that `ldconfig` is not invoked when it
should be.
When adding `ldconfig -p >/tmp/ldconfig-output` to the postinst hook,
one can see that neither libaugeas0 nor any other libraries that were
just installed, are in the ldconfig cache at the moment the script is
invoked.
Even when trying to perform an ugly workaround by adding an explicit `ldconfig` invocation in the postinst script before running the python script, it still fails.
Very curiously, calling `ldconfig -v >/dev/null` instead, somehow makes ldconfig work. This is probably because ldconfig calls are actively blocked in maintainer scripts, but adding the argument and redirect circumvents this block...
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/python-augeas/+bug/1851675/+subscriptions
More information about the foundations-bugs
mailing list