Bug 750428

Summary: 404 from CherryPy when fetching MochiKit js files after starting Apache
Product: [Retired] Beaker Reporter: Dan Callaghan <dcallagh>
Component: web UIAssignee: Dan Callaghan <dcallagh>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: high Docs Contact:
Priority: unspecified    
Version: 0.8CC: bpeck, dcallagh, mcsontos, rmancy, stl
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-01-04 01:43:41 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

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.