[Bug 1652641] Re: crash in indexer.py, AttributeError: 'NoneType' object has no attribute 'unlink'

Carlo Vanini silhusk at gmail.com
Thu Apr 13 21:33:09 UTC 2017


It looks like the same bug reappearing
https://bugs.launchpad.net/ubuntu/+source/apt-xapian-
index/+bug/1530518/comments/2

Running a-x-i directly doesn't trigger this bug, but the combination of
nice and ionice makes it show up much more often. (When the index is
already up to date)

Steps to reproduce:
 * `sudo update-apt-xapian-index`
 * Now that the index is updated we trigger the bug by running the following command (which is the same used in the cron job)
 * `sudo nice -n 19 ionice -c 3 update-apt-xapian-index --quiet`
 * may need to run 4 times or more

The intention of the proposed patch is to work around the problem by keeping a reference to the os.unlink function in the ServerProgress instance.
See http://stackoverflow.com/questions/17084260/imported-modules-become-none-when-running-a-function for an explanation of the issue in python.
Also see http://pydev.blogspot.ch/2015/01/creating-safe-cyclic-reference.html for a possible implementation using weakrefs.

** Patch added: "keep a reference to os.unlink"
   https://bugs.launchpad.net/ubuntu/+source/apt-xapian-index/+bug/1652641/+attachment/4861539/+files/apt-xapian-index_0.47ubuntu12.debdiff

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to apt-xapian-index in Ubuntu.
https://bugs.launchpad.net/bugs/1652641

Title:
  crash in indexer.py, AttributeError: 'NoneType' object has no
  attribute 'unlink'

Status in apt-xapian-index package in Ubuntu:
  Confirmed

Bug description:
  While installing Muon the following exception was raised.

  Ophalen:1 http://nl.archive.ubuntu.com/ubuntu zesty/universe amd64 muon amd64
  4:5.6.0-0ubuntu2 [332 kB]
  Ophalen:2 http://nl.archive.ubuntu.com/ubuntu zesty/universe amd64 muon-updater
  all 4:5.8.4-0ubuntu1 [3268 B]
  335 kB opgehaald in 0s (861 kB/s)
  Voorheen niet geselecteerd pakket muon wordt geselecteerd.
  (Database wordt ingelezen ... 238429 bestanden en mappen momenteel
  geïnstalleerd.)
  Uitpakken van .../0-muon_4%3a5.6.0-0ubuntu2_amd64.deb wordt voorbereid...
  Bezig met uitpakken van muon (4:5.6.0-0ubuntu2) ...
  Voorheen niet geselecteerd pakket muon-updater wordt geselecteerd.
  Uitpakken van .../1-muon-updater_4%3a5.8.4-0ubuntu1_all.deb wordt voorbereid...
  Bezig met uitpakken van muon-updater (4:5.8.4-0ubuntu1) ...
  Bezig met afhandelen van triggers voor mime-support (3.60ubuntu1) ...
  Instellen van muon-updater (4:5.8.4-0ubuntu1) ...
  Instellen van muon (4:5.6.0-0ubuntu2) ...

  The index /var/lib/apt-xapian-index is up to date
  Exception ignored in: <bound method ServerProgress.__del__ of
  <axi.indexer.ServerProgress object at 0x7f04a5ae4c18>>
  Traceback (most recent call last):
    File "/usr/lib/python3/dist-packages/axi/indexer.py", line 306, in __del__
  AttributeError: 'NoneType' object has no attribute 'unlink'

  
  Bezig met afhandelen van triggers voor hicolor-icon-theme (0.15-1) ...
  done..

  
  This bug was originally reported against Muon as https://bugs.kde.org/show_bug.cgi?id=374084 but the crash actually happens in a-x-i.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/apt-xapian-index/+bug/1652641/+subscriptions



More information about the foundations-bugs mailing list