[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Strange failure of python-apt to when trying to update apt cache (Was: Accepted blends 0.6.101 (source) into experimental)



Hi Julian,

after a rewrite of blends-dev which is working on apt cache to find out
what packages are available in a specified release I'm facing a problem
on a specific computer[1].  I tried to cut down the code to a minimum
that shows the problem:


#!/usr/bin/python3

import tempfile
import os
import shutil
import apt

d = tempfile.mkdtemp()
print(d)
os.makedirs(os.path.join(d, 'etc', 'apt'))
shutil.copytree('/etc/apt/trusted.gpg.d',
                os.path.join(d, 'etc', 'apt', 'trusted.gpg.d'))
# for simple reproduction copy system sources.list
shutil.copy('/etc/apt/sources.list',
                os.path.join(d, 'etc', 'apt', 'sources.list'))
c = apt.Cache(rootdir=d, memonly=True)
c.update()


On the computer in question this fails with:


/tmp/tmpdzr_ldvz
Can't open file /var/lib/apt/lists/_tmp_autopkgtest.qDlH8X_binaries_Packages: No such file or directory
I do not have permission to write to /var/lib/debtags/
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apt/cache.py", line 503, in update
    pulse_interval)
apt_pkg.Error: E:Problem executing scripts APT::Update::Post-Invoke-Success 'test -x /usr/bin/apt-show-versions || exit 0 ; apt-show-versions -i', E:Sub-process returned an error code

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./test_apt_cache.py", line 17, in <module>
    c.update()
  File "/usr/lib/python3/dist-packages/apt/cache.py", line 505, in update
    raise FetchFailedException(e)
apt.cache.FetchFailedException: E:Problem executing scripts APT::Update::Post-Invoke-Success 'test -x /usr/bin/apt-show-versions || exit 0 ; apt-show-versions -i', E:Sub-process returned an error code


This happens for python3-apt version 1.4.0~beta3+b1 and 1.6.0~rc2.  The
system is running testing with some selected packages from unstable.  I
do not remember that I did some specific apt configuration.  When I'm
running the code above on a different system running stable everything
works as expected.

Can you imagine any setting that might lead to the attempt to write to
/var/lib/apt/lists/ which is not writable for a normal user (the script
is not run with root permissions).

What other information do you possibly need to answer this question?

Kind regards

      Andreas.

[1] https://lists.debian.org/debian-blends/2018/03/msg00035.html

-- 
http://fam-tille.de


Reply to: