twisted does not update its plugin cache properly in jaunty

Bug #361865 reported by Glyph Lefkowitz
68
This bug affects 11 people
Affects Status Importance Assigned to Milestone
nevow (Ubuntu)
Fix Released
Undecided
Unassigned
Jaunty
Won't Fix
Undecided
Unassigned
python-axiom (Ubuntu)
Fix Released
Undecided
Unassigned
Jaunty
Won't Fix
Undecided
Unassigned
twisted (Debian)
Fix Released
Unknown
twisted (Ubuntu)
Fix Released
High
Unassigned
Jaunty
Fix Released
High
Unassigned
twisted-calendarserver (Ubuntu)
New
Undecided
Unassigned
Jaunty
Won't Fix
Undecided
Unassigned
twisted-conch (Ubuntu)
Fix Released
Undecided
Unassigned
Jaunty
Won't Fix
Undecided
Unassigned
twisted-mail (Ubuntu)
Fix Released
Undecided
Unassigned
Jaunty
Won't Fix
Undecided
Unassigned
twisted-names (Ubuntu)
Fix Released
Undecided
Unassigned
Jaunty
Won't Fix
Undecided
Unassigned
twisted-web (Ubuntu)
Fix Released
Undecided
Unassigned
Jaunty
Won't Fix
Undecided
Unassigned
twisted-web2 (Ubuntu)
Fix Released
Undecided
Unassigned
Jaunty
Won't Fix
Undecided
Unassigned
twisted-words (Ubuntu)
Fix Released
Undecided
Unassigned
Jaunty
Won't Fix
Undecided
Unassigned

Bug Description

Immediately after "apt-get install python-twisted-core":

glyph@jackalopian:~$ twistd --help 2>error > /dev/null; cat error
/usr/lib/python2.6/dist-packages/twisted/persisted/sob.py:12: DeprecationWarning: the md5 module is deprecated; use hashlib instead
  import os, md5, sys
/usr/lib/python2.6/dist-packages/twisted/python/filepath.py:12: DeprecationWarning: the sha module is deprecated; use the hashlib module instead
  import sha
Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/twisted/python/usage.py", line 413, in __str__
    return self.getSynopsis() + '\n' + self.getUsage(width=None)
  File "/usr/lib/python2.6/dist-packages/twisted/python/usage.py", line 449, in getUsage
    for (cmd, short, parser, desc) in self.subCommands:
  File "/usr/lib/python2.6/dist-packages/twisted/application/app.py", line 679, in subCommands
    for plug in plugins:
  File "/usr/lib/python2.6/dist-packages/twisted/plugin.py", line 200, in getPlugins
    allDropins = getCache(package)
--- <exception caught here> ---
  File "/usr/lib/python2.6/dist-packages/twisted/plugin.py", line 179, in getCache
    dropinPath.setContent(pickle.dumps(dropinDotCache))
  File "/usr/lib/python2.6/dist-packages/twisted/python/filepath.py", line 623, in setContent
    f = sib.open('w')
  File "/usr/lib/python2.6/dist-packages/twisted/python/filepath.py", line 433, in open
    return open(self.path, mode+'b')
exceptions.IOError: [Errno 13] Permission denied: '/usr/lib/python2.6/dist-packages/twisted/plugins/dropin.cache.new'

I think we've seen this bug before.

Revision history for this message
Glyph Lefkowitz (glyph) wrote :

In case the origin of this bug isn't clear to someone who might be able to fix it, Twisted packages need a post-installation hook to generate the "dropin.cache" file. The hook is extremely simple, and it's documented here:

http://twistedmatrix.com/projects/core/documentation/howto/plugin.html#auto3

In fact, there is already a debian/python-twisted-core.postinst present in the source package in jaunty which appears to do the right thing. If I run this command as root, the error goes away. I can't figure out why it's not being run after installation.

Revision history for this message
Thomas Herve (therve) wrote :

So I've built a custom package and removed the error redirection in postinst, and it fails with this:

ImportError: No module named twisted.plugin

So presumably the package is not correctly installed when postinst occurs...

Revision history for this message
Thomas Herve (therve) wrote :

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=521663 shows the same problem for python-nevow, and it seems that the problem is located in pycentral.

Revision history for this message
Matthias Klose (doko) wrote :

upgrade error, should be fixed for jaunty. fix available in unstable. please sync discarding the ubuntu changes.
twisted (8.2.0-2) unstable; urgency=low

  * python-twisted-core: Regenerate the plugin cache as the last action
    in the postinst. Closes: #521663. LP: #361865.
  * Avoid md5/sha1 deprecation warnings. LP: #344782.

Changed in twisted (Ubuntu):
importance: Undecided → High
status: New → Triaged
Changed in twisted (Debian):
status: Unknown → Fix Released
Revision history for this message
Martin Pitt (pitti) wrote :

[Updating] twisted (8.2.0-1ubuntu1 [Ubuntu] < 8.2.0-2 [Debian])
 * Trying to add twisted...
  - <twisted_8.2.0-2.dsc: downloading from http://ftp.debian.org/debian/>
  - <twisted_8.2.0-2.diff.gz: downloading from http://ftp.debian.org/debian/>
  - <twisted_8.2.0.orig.tar.gz: already in distro - downloading from librarian>
I: twisted [main] -> python-twisted-core_8.2.0-1ubuntu1 [main].
I: twisted [main] -> python-twisted-bin_8.2.0-1ubuntu1 [main].
I: twisted [main] -> python-twisted-bin-dbg_8.2.0-1ubuntu1 [main].
I: twisted [main] -> twisted-doc_8.2.0-1ubuntu1 [main].
I: twisted [main] -> python-twisted_8.2.0-1ubuntu1 [main].

Changed in twisted (Ubuntu Jaunty):
status: Triaged → Fix Released
Revision history for this message
Glyph Lefkowitz (glyph) wrote :

I've just added "also affects" reports for every other package which should be updating the plugin cache but isn't.

Nevow and Axiom each have a special twist: each one provides plugins for Twisted (in twisted.plugins) but also have their own plugin repositories which *other* packages can contribute to (in axiom.plugins and nevow.plugins respectively). They're not generating any of the required caches; not their own and not Twisted's. Should I file separate bugs for those?

Revision history for this message
Glyph Lefkowitz (glyph) wrote :

Calendarserver can't be installed at all due to https://bugs.launchpad.net/ubuntu/+source/twisted-calendarserver/+bug/349837 - but, when that's fixed, I believe it will also be affected by this bug.

Revision history for this message
Matthias Klose (doko) wrote :

> Should I file separate bugs for those?

if it's a different cache, maybe a separate report is appropriate.

I think we should use a trigger for the cache rebuilds. not appropriate for jaunty, but maybe jaunty-updates.

Revision history for this message
tdflanders (thomasdelbeke) wrote :

Hi there,

I got something very similar:

Bug #372435

/usr/lib/python2.6/dist-packages/twisted/web/microdom.py:181: SyntaxWarning: assertion is always true, perhaps remove parentheses?
  assert (oldChild.parentNode is self,

Is it a duplicate?

Revision history for this message
Glyph Lefkowitz (glyph) wrote :

tdflanders: no, that's an unrelated bug.

Revision history for this message
Thomas Herve (therve) wrote :
Revision history for this message
Jean-Paul Calderone (exarkun) wrote :

It looks like Thomas Herve attached a patch which resolves this. Can it be applied?

Revision history for this message
Glyph Lefkowitz (glyph) wrote :

Is there anything those of us waiting in the wings can do to facilitate Thomas's patch being applied?

Revision history for this message
Myk Melez (myk-melez) wrote :

After experiencing this problem on my Jaunty system and reading through this bug, I ran the following command to make it go away:

sudo /var/lib/dpkg/info/python-twisted-core.postinst configure

Revision history for this message
Esteve Fernandez (esteve) wrote :

+1 on applying Thomas' patch. I applied it and rebuilt python-twisted-web and the bug is gone.

Revision history for this message
Jean-Paul Calderone (exarkun) wrote :

It doesn't sound like there's a reason not to apply Thomas' patch. Can someone please apply it?

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package twisted-web - 8.2.0-2ubuntu1

---------------
twisted-web (8.2.0-2ubuntu1) karmic; urgency=low

  * Regenerate the plugin cache in the postinst. LP: #361865.

 -- Thomas Herve <email address hidden> Mon, 25 May 2009 16:34:48 +0200

Changed in twisted-web (Ubuntu):
status: New → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package twisted-mail - 8.2.0-2ubuntu1

---------------
twisted-mail (8.2.0-2ubuntu1) karmic; urgency=low

  * Regenerate the plugin cache in the postinst. LP: #361865.

 -- Matthias Klose <email address hidden> Mon, 05 Oct 2009 23:26:43 +0200

Changed in twisted-mail (Ubuntu):
status: New → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package twisted-names - 8.2.0-1ubuntu1

---------------
twisted-names (8.2.0-1ubuntu1) karmic; urgency=low

  * Regenerate the plugin cache in the postinst. LP: #361865.

 -- Matthias Klose <email address hidden> Mon, 05 Oct 2009 23:29:53 +0200

Changed in twisted-names (Ubuntu):
status: New → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package twisted-conch - 1:8.2.0-2ubuntu1

---------------
twisted-conch (1:8.2.0-2ubuntu1) karmic; urgency=low

  * Regenerate the plugin cache in the postinst. LP: #361865.

 -- Matthias Klose <email address hidden> Mon, 05 Oct 2009 23:40:33 +0200

Changed in twisted-conch (Ubuntu):
status: New → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package twisted-web2 - 8.1.0-2ubuntu1

---------------
twisted-web2 (8.1.0-2ubuntu1) karmic; urgency=low

  * Regenerate the plugin cache in the postinst. LP: #361865.

 -- Matthias Klose <email address hidden> Mon, 05 Oct 2009 23:42:38 +0200

Changed in twisted-web2 (Ubuntu):
status: New → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package twisted-words - 8.2.0-2ubuntu1

---------------
twisted-words (8.2.0-2ubuntu1) karmic; urgency=low

  * Regenerate the plugin cache in the postinst. LP: #361865.

 -- Matthias Klose <email address hidden> Mon, 05 Oct 2009 23:44:17 +0200

Changed in twisted-words (Ubuntu):
status: New → Fix Released
Revision history for this message
Tristan Matthews (le-businessman) wrote :

I think I resolved this on my machine (on karmic) with:
wajig reinstall python-twisted-words

Revision history for this message
Scott Kitterman (kitterman) wrote :

Fixed in nevow (0.10.0-1) unstable; urgency=low.

Changed in nevow (Ubuntu):
status: New → Fix Released
Revision history for this message
Clint Byrum (clint-fewbar) wrote :

Closing jaunty tasks as jaunty is past EOL

Changed in nevow (Ubuntu Jaunty):
status: New → Won't Fix
Changed in python-axiom (Ubuntu Jaunty):
status: New → Won't Fix
Changed in twisted-calendarserver (Ubuntu Jaunty):
status: New → Won't Fix
Changed in twisted-conch (Ubuntu Jaunty):
status: New → Won't Fix
Changed in twisted-mail (Ubuntu Jaunty):
status: New → Won't Fix
Changed in twisted-names (Ubuntu Jaunty):
status: New → Won't Fix
Changed in twisted-web2 (Ubuntu Jaunty):
status: New → Won't Fix
Changed in twisted-web (Ubuntu Jaunty):
status: New → Won't Fix
Changed in twisted-words (Ubuntu Jaunty):
status: New → Won't Fix
Revision history for this message
Tristan Seligmann (mithrandi) wrote :

This is fixed upstream (in Debian) as of python-axiom 0.5.31-1, and I believe all of the versions of the package currently in Ubuntu include the fix.

Changed in python-axiom (Ubuntu):
status: New → 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.