crash in indexer.py, AttributeError: 'NoneType' object has no attribute 'unlink'
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
apt-xapian-index (Ubuntu) |
Fix Released
|
Medium
|
Unassigned | ||
Xenial |
Fix Released
|
Medium
|
Brian Murray | ||
Zesty |
Fix Released
|
Medium
|
Unassigned |
Bug Description
[Impact]
When the apt-xapian-index is already up to date, and under certain conditions, update-
The index /var/lib/
Exception ignored in: <bound method ServerProgress.
<axi.indexer.
Traceback (most recent call last):
File "/usr/lib/
AttributeError: 'NoneType' object has no attribute 'unlink'
This happens more frequently when it is run with nice and ionice, which is the case in the cron.weekly/
This is not severe, since the exception is thrown on exit, and depends on the way python3 cleans up the environment. Anyway, this leaves a socket file behind, and creates noise in cron logs (see comment #2).
The patch uses a weakref finalizer in order to remove the socket file.
[Test Case]
* `sudo nice -n 19 ionice -c 3 update-
* may need to run 4 times or more
* no exception is thrown
[Regression Potential]
* If the os module is unloaded anyway and os.unlink becomes unreachable, we get the same exception again.
* We import the `weakref` module, which was not used before.
[Other Info]
* This description was updated to reflect the changes in the behavior of the patch that was released in Zesty. It still needs sponsoring for Xenial.
tags: | added: yakkety |
Changed in apt-xapian-index (Ubuntu): | |
importance: | Undecided → Medium |
tags: | added: zesty |
description: | updated |
Changed in apt-xapian-index (Ubuntu Xenial): | |
importance: | Undecided → Medium |
Changed in apt-xapian-index (Ubuntu Zesty): | |
importance: | Undecided → Medium |
description: | updated |
Changed in apt-xapian-index (Ubuntu Xenial): | |
status: | Triaged → In Progress |
assignee: | nobody → Brian Murray (brian-murray) |
tags: | removed: verification-needed yakkety |
tags: | added: yakkety |
(k)ubuntu version 17.04
kernel version: 4.9.0-11.12
apt-xapian-index version: 0.47ubuntu11