Bug 505686 - IPA WebUI imports python-cherrypy instead of python-cherrypy2 when both are installed
Summary: IPA WebUI imports python-cherrypy instead of python-cherrypy2 when both are i...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: ipa
Version: 10
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Rob Crittenden
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-06-12 22:08 UTC by Jason Gerard DeRose
Modified: 2009-09-19 00:10 UTC (History)
5 users (show)

Fixed In Version: 1.2.1-5.fc11
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-06-24 19:16:40 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Tell pkg_requires to select the TurboGears stack (315 bytes, patch)
2009-06-16 04:17 UTC, Toshio Ernie Kuratomi
no flags Details | Diff
Tell pkg_requires to select the TurboGears stack and shutdown logging properly (721 bytes, patch)
2009-06-16 15:15 UTC, Rob Crittenden
no flags Details | Diff

Description Jason Gerard DeRose 2009-06-12 22:08:21 UTC
Description of problem:

cherrpy v2 and cherrypy v3 are not parallel installable, yet the `python-cherrypy2` and `python-cherrypy` packages can be installed simultaneously.  If you're using a cherrypy v2 based app (in my case `ipa-server`, which requires `python-cherrypy2`) and install `python-cherrypy`, the cherrypy v2 based app will break (in my case, the IPA webUI wont start).

To fix this:

 * The `python-cherrypy2` package needs a "Conflicts: python-cherrypy" added in its spec.

 * The `python-cherrypy` package needs a "Conflicts: python-cherrypy2" added in its spec.


How reproducible:

Always.


Steps to Reproduce:
1. yum install python-cherrypy2
2. yum install python-cherrypy

  
Actual results:

You can install both packages, breaking anything that uses cherrypy v2.


Expected results:

Installing `python-cherrpy` should remove `python-cherrypy2` and any packages that require it.

Comment 1 Toshio Ernie Kuratomi 2009-06-13 01:06:40 UTC
python-cherrypy and python-cherrypy2 are parallel installable.  IPA WebUI needs to be fixed.

If you point me at the script that starts the process, I can help create a patch for you.

Comment 2 Rob Crittenden 2009-06-16 03:34:37 UTC
The tree is at git://git.fedorahosted.org/git/freeipa.git

The branch release-1-2-1

The file ipa-server/ipa-gui/ipa_webgui

http://git.fedorahosted.org/git/freeipa.git/?p=freeipa.git;a=blob;f=ipa-server/ipa-gui/ipa_webgui;h=677fc9a5bce4cb92e34ecae5e6548373bbaa0f1c;hb=b6ac995b350cbfb248ea5cdd5d60b816f0925dab

Comment 3 Toshio Ernie Kuratomi 2009-06-16 04:17:35 UTC
Created attachment 348046 [details]
Tell pkg_requires to select the TurboGears stack

Try this.  It's untested but with similar scripts it's all that's needed to make this work.

The upstream pkg_resources/setuptools author insists on making pkg_resources determine some of the version information for importing modules at the time that pkg_resources is loaded.  So we need to have a method of telling pkg_resources to import cherrypy 2 instead of the default cherrypy 3.  Setting __resources__ does this.  We can require TurboGears in that variable instead of CherryPy >= 2.0, < 3.0 because TurboGears has the dependency on CherryPy in its egg info.

Comment 4 Rob Crittenden 2009-06-16 14:22:50 UTC
Ok, that fixes the import error, thanks!

It exposes another problem though, some sort of logging issue. ipa_webgui fails to start in daemon mode. Investigating now.

Comment 5 Rob Crittenden 2009-06-16 14:38:48 UTC
The problem is related to a hack we added to ipa_webgui. It opens the log when the script is starting up and importing TurboGears and then calls logger.shutdown() before TG is started.

This must be confusing the python logger. Removing this lets the server start up normally.

Comment 6 Rob Crittenden 2009-06-16 15:15:02 UTC
Created attachment 348126 [details]
Tell pkg_requires to select the TurboGears stack and shutdown logging properly

This patch adds a loop that removes all the root logging handlers instead of calling logging.shutdown()

If this handler is left in the all logging in the server is duplicated once TurboGears starts.

If we don't initialize logging in ipa_webgui then any import errors, etc when loading TurboGears are not logged anywhere.

So the hack is to initialize logging while bootstrapping things, delete those log handlers, then fire up TurboGears which opens its own logs (which happen to point to the same files).

Comment 7 Rob Crittenden 2009-06-18 20:31:05 UTC
Patch committed upstream to ipa-1-2 branch, d658e88f635fa84341e71d2de9151a37e1c69914

Committed to ipa package as 2 patches, one to fix the import and one to fix the logging.

Comment 8 Fedora Update System 2009-06-18 21:06:23 UTC
ipa-1.2.1-5.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/ipa-1.2.1-5.fc11

Comment 9 Fedora Update System 2009-06-18 21:06:28 UTC
ipa-1.2.1-2.fc10 has been submitted as an update for Fedora 10.
http://admin.fedoraproject.org/updates/ipa-1.2.1-2.fc10

Comment 10 Fedora Update System 2009-06-24 19:16:35 UTC
ipa-1.2.1-2.fc10 has been pushed to the Fedora 10 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 11 Fedora Update System 2009-06-24 19:40:33 UTC
ipa-1.2.1-5.fc11 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 12 Fedora Update System 2009-09-10 21:19:58 UTC
ipa-1.2.2-1.fc10 has been submitted as an update for Fedora 10.
http://admin.fedoraproject.org/updates/ipa-1.2.2-1.fc10

Comment 13 Fedora Update System 2009-09-10 21:20:21 UTC
ipa-1.2.2-1.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/ipa-1.2.2-1.fc11

Comment 14 Fedora Update System 2009-09-19 00:05:49 UTC
ipa-1.2.2-1.fc11 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 15 Fedora Update System 2009-09-19 00:10:32 UTC
ipa-1.2.2-1.fc10 has been pushed to the Fedora 10 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.