Bug 750428 - 404 from CherryPy when fetching MochiKit js files after starting Apache
Summary: 404 from CherryPy when fetching MochiKit js files after starting Apache
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Beaker
Classification: Retired
Component: web UI
Version: 0.8
Hardware: Unspecified
OS: Unspecified
unspecified
high vote
Target Milestone: ---
Assignee: Dan Callaghan
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-11-01 04:51 UTC by Dan Callaghan
Modified: 2019-05-22 13:41 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-01-04 01:43:41 UTC


Attachments (Terms of Use)

Description Dan Callaghan 2011-11-01 04:51:57 UTC
When Apache is first started, each worker does not have a static filter configured for /tg_widgets/tgmochikit until it handles a request which renders widgets. As a result when the server is first started it will appear to randomly return 404 errors for MochiKit js files, depending on whether you hit a worker that has been initialised yet.

Upstream bug filed here: https://sourceforge.net/p/turbogears1/tickets/34/

Comment 1 Dan Callaghan 2011-11-01 04:52:51 UTC
As a workaround we can explicitly initialise TGMochiKit when our application is started in /usr/share/bkr/beaker-server.wsgi.

Comment 2 Bill Peck 2011-11-01 14:52:41 UTC
Could this be causing the spinner on "Show all results" to spin forever?  I'm guessing we might have the required javascript loaded to actually do the call correctly?

Comment 3 Bill Peck 2011-11-01 14:53:47 UTC
Also, we kill and respawn apache workers every 200 requests so we will be experiencing this over and over.

Comment 4 Bill Peck 2011-11-01 14:54:38 UTC
Dan,

Can you paste the workaround here?

Thanks

Comment 5 Dan Callaghan 2011-11-01 21:03:46 UTC
The workaround is to put this near the bottom of beaker-server.wsgi:

import tgmochikit
from turbogears.widgets.base import register_static_directory
tgmochikit.init(register_static_directory, config)

I've pushed a patch to Gerrit.

Comment 6 Dan Callaghan 2012-01-04 01:43:41 UTC
Beaker 0.8 has been released.


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