Bug 433306 - supervisord has python import errors
supervisord has python import errors
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: python-meld3 (Show other bugs)
8
i386 Linux
low Severity low
: ---
: ---
Assigned To: Toshio Ernie Kuratomi
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-02-18 10:27 EST by John Hein
Modified: 2008-03-13 03:48 EDT (History)
1 user (show)

See Also:
Fixed In Version: 0.6.4-1.fc8
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-03-13 03:47:09 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
New meld3.py potentially fixing import errors (47.95 KB, text/plain)
2008-02-26 19:57 EST, Toshio Ernie Kuratomi
no flags Details

  None (edit)
Description John Hein 2008-02-18 10:27:01 EST
Description of problem:

In Fedora 8, supervisord won't start due to import errors

Version-Release number of selected component (if applicable):

supervisor-2.1-3.fc7

python-meld3-0.6-2.fc7.1

python-2.5.1-15.fc8


How reproducible:

every time


Steps to Reproduce:
1. install supervisor rpm
2. run /etc/init.d/supervisord start (default supervisord.conf)

  
Actual results:

Starting supervisord: Unlinking stale socket /var/tmp/supervisor.sock
Traceback (most recent call last):
  File "/usr/bin/supervisord", line 6, in <module>
    main()
  File "/usr/lib/python2.5/site-packages/supervisor/supervisord.py", line 724,
in main
    d.main(None, test, first)
  File "/usr/lib/python2.5/site-packages/supervisor/supervisord.py", line 463,
in main
    self.run(test)
  File "/usr/lib/python2.5/site-packages/supervisor/supervisord.py", line 472,
in run
    self.options.openhttpserver(self)
  File "/usr/lib/python2.5/site-packages/supervisor/options.py", line 833, in
openhttpserver
    self.httpserver = make_http_server(self, supervisord)
  File "/usr/lib/python2.5/site-packages/supervisor/http.py", line 751, in
make_http_server
    from web import supervisor_ui_handler
  File "/usr/lib/python2.5/site-packages/supervisor/web.py", line 4, in <module>
    import meld3
  File "/usr/lib/python2.5/site-packages/meld3/__init__.py", line 2, in <module>
    from meld3 import parse_xml
  File "/usr/lib/python2.5/site-packages/meld3/meld3.py", line 8, in <module>
    from elementtree.ElementTree import TreeBuilder
ImportError: No module named elementtree.ElementTree


Expected results:


Additional info:

The python-elementtree package has not been in fedora since Fedora Core 6.  It
looks like the ElementTree package is now part of base python (in xml/etree).
Comment 1 John Hein 2008-02-26 11:27:30 EST
This failed in the same way on Fedora 7 as well.  From what I can see, this has
not worked since Fedora Core 6.
Comment 2 Mike McGrath 2008-02-26 11:45:38 EST
There's a new version of this out as well.  I've not been the most attentive
packager for this :-/  I'll try to get it fixed today.  Its a pretty useful package.
Comment 3 Mike McGrath 2008-02-26 12:49:20 EST
Sell shoot, this is a python 2.5 issue, I've got some of the imports fixed but
others, like those in:

http://pastebin.ca/919155

Don't seem to have a clean import in python2.5.  If anyone happens upon this bug
and knows their equiv's in python2.5 please let me know, I've been bugging the
guys in #python on irc.freenode.net
Comment 4 John Hein 2008-02-26 14:53:46 EST
Yeah... I started to replace imports with xml.etree that is the 2.5 place for
it, but, as you found out, it wasn't quite that simple.

I was hoping you would have the magic answer.  Otherwise, I would have included
a patch ;)

I googled a bit, but didn't find a workaround.

One alternative solution would be to bring in the old python-elementtree, but I
don't know how well that can co-exist with python 2.5.

Maybe the next step is to ask the plope.com folks what they do to support python 2.5
Comment 5 John Hein 2008-02-26 14:59:39 EST
p.s. I did look through the archives at
http://supervisord.org/mailman/listinfo/supervisor-users

There was one thread regarding ElementTree dependency issues, but it was not a
2.5 problem - it was a problem with the user's local environment (using 2.4)...

http://supervisord.org/pipermail/supervisor-users/2007-October/000102.html

We should probably open up a dialog on that mailing list and see if anyone there
has an idea.  I'll do that in a bit unless you beat me to it.
Comment 6 John Hein 2008-02-26 18:36:18 EST
See http://supervisord.org/pipermail/supervisor-users/2008-February/000182.html

It seems to be as I suspected.  The 2.5 ElementTree doesn't have everything that
the old python-elementtree package had.  And supervisor/meld3 is dependent on
some of that.

See the response in the link above about partial overlap between the ElementTree
in python-2.5 and the old python-elementtree.
Comment 7 Toshio Ernie Kuratomi 2008-02-26 19:55:16 EST
Hi John,

Do you use the web interface to supervisor?  I looked at the last version of
python-elementtree in Fedora and think that I have something that will work but
I don't use the web interface at all (and really only use this on RHEL5).  I'll
attach a new version of:

/usr/lib/python2.5/site-packages/meld3/meld3.py

If you are able to copy that into your version and test it out I think we might
be close to a solution that can be sent upstream.

If this works we'll want to pretty this up so that it can try both what works
for python-2.5 and python-elementtree.  Also, Mike, this is against meld3-0.6.3.
 If there's a newer update we might have to update the imports and maybe change
the setup.py (judging from the mailing list posts.)
Comment 8 Toshio Ernie Kuratomi 2008-02-26 19:57:30 EST
Created attachment 296010 [details]
New meld3.py potentially fixing import errors

Note that this will fix the ImportError regardless.  The real question is
whether this breaks HTML rendering (as used by supervisor's web interface.)
Comment 9 John Hein 2008-02-26 20:44:08 EST
a.badger@gmail.com wrote 2008-02-26 19:55 EST:
 > Hi John,
 > 
 > Do you use the web interface to supervisor?

I haven't used it at all yet.  It won't run - that's what prompted this bug ;)

So the answer is no.  But I doubt I'd use it much.  inetd doesn't have a web
interface, but I doubt I'd use it either.

That said, I don't know what the web interface does.  If supervisor keeps
statistics on when it has to restart a child, that might be interesting
information.  But using a command line program is fine with me.

 > If you are able to copy that into your version and test it out I think we
 > might be close to a solution that can be sent upstream.

I'll give it a try.  As far as sending a version upstream, my guess is that they
are likely not going to accept something that removes the http stuff.

It seems that their position is that Fedora should fix its package building to
use python's easy_install.  See this message in the thread I started on the
supervisor mailing list...

http://supervisord.org/pipermail/supervisor-users/2008-February/000185.html
Comment 10 Toshio Ernie Kuratomi 2008-02-26 21:30:00 EST
I think you misunderstood :-).

The patch will almost definitely get the commandline portion working as that's
just an import error (which this patch fixes).  But it touches the web interface
portion so testing that the web interface works with this applied means that I
can send it upstream.

As far as easy_install goes, that is the wrong solution to any problem related
to building a package.  easy_install goes onto the network and installs things
on the system that is building the package.  This breaks in our builders because
downloading things would be prevented for security and it doesn't solve the
problem as it downloads to the builder rather than your machine where it's
installed.

It would probably fix this issue for you if you ran easy_install locally (since
that would download the packages to your machine) but we're lucky you didn't as,
with any luck, this report will get the problem fixed in Fedora and a patch sent
upstream to do the right thing on python-2.5 for future upstream versions :-)

Let us know if it works!
Comment 11 Toshio Ernie Kuratomi 2008-02-28 12:38:11 EST
Patch submitted upstream[1]_.  I'll be updating the python-meld3 package for
Fedora with this patch which should resolve the problem for supervisor.

.. _[1]: http://www.plope.com/software/collector/261
Comment 12 Fedora Update System 2008-02-28 15:41:42 EST
python-meld3-0.6.4-1.fc7 has been submitted as an update for Fedora 7
Comment 13 Fedora Update System 2008-02-28 15:43:02 EST
python-meld3-0.6.4-1.fc8 has been submitted as an update for Fedora 8
Comment 14 John Hein 2008-02-28 15:50:58 EST
Sorry for the delayed feedback, but it did work.  That is to say, it allowed me
to start supervisord.

I don't _think_ I misunderstood your question about the web interface, by the
way.  I realized you were only talking about the web interface.  And I
understand that the patch was intended to get the command line version working.
 What I don't know is how the web interface is affected.  And since, as I was
trying to say, I haven't used the web interface (and probably won't), I can't
say whether it has been broken now - it obviously was broken before the patch
since the damn thing wouldn't even start ;).

So, while the patch gets me what I wanted, I don't know if it breaks some
feature of supervisor that I don't use.  I'll let the upstream folks talk to that...

As far as the easy_install part, I think the supervisor maintainer was
suggesting emulating what easy_install does for purposes of building the Fedora
package.  He was not suggesting that the Fedora package itself run easy_install
upon installation (i.e., having yum/rpm run easy_install or some such radically
non-rpm concept).  So, it might be helpful if the Fedora package maintainer used
easy_install or emulated what easy_install does in order to _build_ the rpm(s),
since (as he intimated) easy_install is the canonical way to get python packages
up and running.  I was just passing along his comment, but I think you
misinterpreted it.  In any case, I'll let you Fedora package maintainers work
that all out - i.e, whether it's worth investigating using easy_install to help
you build rpms.
Comment 15 Fedora Update System 2008-03-01 04:27:29 EST
python-meld3-0.6.4-1.fc8 has been pushed to the Fedora 8 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update python-meld3'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F8/FEDORA-2008-2155
Comment 16 Fedora Update System 2008-03-13 03:47:07 EDT
python-meld3-0.6.4-1.fc8 has been pushed to the Fedora 8 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 17 Fedora Update System 2008-03-13 03:48:30 EDT
python-meld3-0.6.4-1.fc7 has been pushed to the Fedora 7 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.