Re: [Repoze-dev] repoze.bfg random intermittent server errors fetching static resources
Thanks Tres, you are of course correct, I had two different problems that behaved similarly. However, the static issue still remained when I got rid of the concurrency problem. I will dig into that later and report more on it, in the meantime I just ditched serving static files through bfg and have them served by Apache. thanks iain On Thu, Aug 19, 2010 at 5:16 AM, Tres Seaver wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Iain Duncan wrote: > > On Wed, Aug 18, 2010 at 4:28 PM, Chris Withers >wrote: > > > >> Iain Duncan wrote: > >> > >>> FWIW, I can sit there and hit reload, and get totally different > responses > >>> randomly, sometimes my bfg methods return what they are supposed to, > and > >>> others I get the 500s. > >>> Could there be a connection with using resource directory overloads in > the > >>> zcml? > >>> > >> It would be good to see the exceptions that are logged on the server > side > >> that match those 500s... > >> > >> Chris > >> > >> > > Here is the traceback from one of the times it screwed up. gah, I expect > > this is not good for homestar runner, maybe something deeply wrong in my > > model code? > > The weird thing is now I just had no problem like 10 times in a row, and > > other times the js app fails when it makes the same request ( > > /bookings/by_date/2010-08-18 ). But when I hit the same thing in the > browser > > or manually trigger the ajax code from the firebug console, it never > fails. > > > > Any clues to the meaning of this traceback are most appreciated. > > > > 16:37:01,938 INFO [irmacs.views.bookings] BookingView.by_date() date: > > 2009-12-18 > > > > Exception happened during processing of request from ('127.0.0.1', 38238) > > Traceback (most recent call last): > > File > > > "/home/irmacs/irmacs_trunk/eggs/Paste-1.7.4-py2.6.egg/paste/httpserver.py", > > line 1068, in process_request_in_thread > > self.finish_request(request, client_address) > > File "/usr/lib/python2.6/SocketServer.py", line 320, in finish_request > > self.RequestHandlerClass(request, client_address, self) > > File "/usr/lib/python2.6/SocketServer.py", line 615, in __init__ > > self.handle() > > File > > > "/home/irmacs/irmacs_trunk/eggs/Paste-1.7.4-py2.6.egg/paste/httpserver.py", > > line 442, in handle > > BaseHTTPRequestHandler.handle(self) > > File "/usr/lib/python2.6/BaseHTTPServer.py", line 329, in handle > > self.handle_one_request() > > File > > > "/home/irmacs/irmacs_trunk/eggs/Paste-1.7.4-py2.6.egg/paste/httpserver.py", > > line 437, in handle_one_request > > self.wsgi_execute() > > File > > > "/home/irmacs/irmacs_trunk/eggs/Paste-1.7.4-py2.6.egg/paste/httpserver.py", > > line 287, in wsgi_execute > > self.wsgi_start_response) > > File > > > "/home/irmacs/irmacs_trunk/eggs/repoze.who-1.0.18-py2.6.egg/repoze/who/middleware.py", > > line 107, in __call__ > > app_iter = app(environ, wrapper.wrap_start_response) > > File > > > "/home/irmacs/irmacs_trunk/eggs/repoze.bfg-1.2.1-py2.6.egg/repoze/bfg/router.py", > > line 130, in __call__ > > response = view_callable(context, request) > > File > > > "/home/irmacs/irmacs_trunk/eggs/repoze.bfg-1.2.1-py2.6.egg/repoze/bfg/configuration.py", > > line 1665, in _bfg_class_view > > response = getattr(inst, attr)() > > File "/home/irmacs/irmacs_trunk/Irmacs/irmacs/views/bookings.py", line > 47, > > in by_date > > bookings = self.model.list( Booking, {'date':isodate} ) > > File > > > "/home/irmacs/irmacs_trunk/framework_src/xornot.model/xornot/model/__init__.py", > > line 208, in list > > items = query.all() > > File > > > "/home/irmacs/irmacs_trunk/eggs/SQLAlchemy-0.5.8-py2.6.egg/sqlalchemy/orm/query.py", > > line 1267, in all > > return list(self) > > File > > > "/home/irmacs/irmacs_trunk/eggs/SQLAlchemy-0.5.8-py2.6.egg/sqlalchemy/orm/query.py", > > line 1422, in instances > > rows = [process[0](context, row) for row in fetch] > > File > > > "/home/irmacs/irmacs_trunk/eggs/SQLAlchemy-0.5.8-py2.6.egg/sqlalchemy/orm/query.py", > > line 2032, in main > > return _instance(row, None) > > File > > > "/home/irmacs/irmacs_trunk/eggs/SQLAlchemy-0.5.8-py2.6.egg/sqlalchemy/orm/mapper.py", > > line 1751, in _instance > > state._run_on_load(instance) > > File > > > "/home/irmacs/irmacs_trunk/eggs/SQLAlchemy-0.5.8-py2.6.egg/sqlalchemy/orm/state.py", > > line 119, in _run_on_load > > self.manager.events.run('on_load', instance) > > AttributeError: 'NoneType' object has no attribute 'run' > > > > This traceback is clearly not from a request serving a static resource: > you are seeing a bug (maybe a race condition due to use of globals?) in > your application. > > > Tres. > > - -- > === > Tres Seaver +1 540-429-0999 tsea...@palladion.com > Palladion Software "Excellence by Design"ht
Re: [Repoze-dev] repoze.bfg random intermittent server errors fetching static resources
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Iain Duncan wrote: > On Wed, Aug 18, 2010 at 4:28 PM, Chris Withers wrote: > >> Iain Duncan wrote: >> >>> FWIW, I can sit there and hit reload, and get totally different responses >>> randomly, sometimes my bfg methods return what they are supposed to, and >>> others I get the 500s. >>> Could there be a connection with using resource directory overloads in the >>> zcml? >>> >> It would be good to see the exceptions that are logged on the server side >> that match those 500s... >> >> Chris >> >> > Here is the traceback from one of the times it screwed up. gah, I expect > this is not good for homestar runner, maybe something deeply wrong in my > model code? > The weird thing is now I just had no problem like 10 times in a row, and > other times the js app fails when it makes the same request ( > /bookings/by_date/2010-08-18 ). But when I hit the same thing in the browser > or manually trigger the ajax code from the firebug console, it never fails. > > Any clues to the meaning of this traceback are most appreciated. > > 16:37:01,938 INFO [irmacs.views.bookings] BookingView.by_date() date: > 2009-12-18 > > Exception happened during processing of request from ('127.0.0.1', 38238) > Traceback (most recent call last): > File > "/home/irmacs/irmacs_trunk/eggs/Paste-1.7.4-py2.6.egg/paste/httpserver.py", > line 1068, in process_request_in_thread > self.finish_request(request, client_address) > File "/usr/lib/python2.6/SocketServer.py", line 320, in finish_request > self.RequestHandlerClass(request, client_address, self) > File "/usr/lib/python2.6/SocketServer.py", line 615, in __init__ > self.handle() > File > "/home/irmacs/irmacs_trunk/eggs/Paste-1.7.4-py2.6.egg/paste/httpserver.py", > line 442, in handle > BaseHTTPRequestHandler.handle(self) > File "/usr/lib/python2.6/BaseHTTPServer.py", line 329, in handle > self.handle_one_request() > File > "/home/irmacs/irmacs_trunk/eggs/Paste-1.7.4-py2.6.egg/paste/httpserver.py", > line 437, in handle_one_request > self.wsgi_execute() > File > "/home/irmacs/irmacs_trunk/eggs/Paste-1.7.4-py2.6.egg/paste/httpserver.py", > line 287, in wsgi_execute > self.wsgi_start_response) > File > "/home/irmacs/irmacs_trunk/eggs/repoze.who-1.0.18-py2.6.egg/repoze/who/middleware.py", > line 107, in __call__ > app_iter = app(environ, wrapper.wrap_start_response) > File > "/home/irmacs/irmacs_trunk/eggs/repoze.bfg-1.2.1-py2.6.egg/repoze/bfg/router.py", > line 130, in __call__ > response = view_callable(context, request) > File > "/home/irmacs/irmacs_trunk/eggs/repoze.bfg-1.2.1-py2.6.egg/repoze/bfg/configuration.py", > line 1665, in _bfg_class_view > response = getattr(inst, attr)() > File "/home/irmacs/irmacs_trunk/Irmacs/irmacs/views/bookings.py", line 47, > in by_date > bookings = self.model.list( Booking, {'date':isodate} ) > File > "/home/irmacs/irmacs_trunk/framework_src/xornot.model/xornot/model/__init__.py", > line 208, in list > items = query.all() > File > "/home/irmacs/irmacs_trunk/eggs/SQLAlchemy-0.5.8-py2.6.egg/sqlalchemy/orm/query.py", > line 1267, in all > return list(self) > File > "/home/irmacs/irmacs_trunk/eggs/SQLAlchemy-0.5.8-py2.6.egg/sqlalchemy/orm/query.py", > line 1422, in instances > rows = [process[0](context, row) for row in fetch] > File > "/home/irmacs/irmacs_trunk/eggs/SQLAlchemy-0.5.8-py2.6.egg/sqlalchemy/orm/query.py", > line 2032, in main > return _instance(row, None) > File > "/home/irmacs/irmacs_trunk/eggs/SQLAlchemy-0.5.8-py2.6.egg/sqlalchemy/orm/mapper.py", > line 1751, in _instance > state._run_on_load(instance) > File > "/home/irmacs/irmacs_trunk/eggs/SQLAlchemy-0.5.8-py2.6.egg/sqlalchemy/orm/state.py", > line 119, in _run_on_load > self.manager.events.run('on_load', instance) > AttributeError: 'NoneType' object has no attribute 'run' > This traceback is clearly not from a request serving a static resource: you are seeing a bug (maybe a race condition due to use of globals?) in your application. Tres. - -- === Tres Seaver +1 540-429-0999 tsea...@palladion.com Palladion Software "Excellence by Design"http://palladion.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkxtIJwACgkQ+gerLs4ltQ6JewCfbc9vS/ILlZ7miiDpcXvlOh2m MzUAn3TPQpeYRsQMHJyU05G3ES6wmjuv =mPcE -END PGP SIGNATURE- ___ Repoze-dev mailing list Repoze-dev@lists.repoze.org http://lists.repoze.org/listinfo/repoze-dev
Re: [Repoze-dev] repoze.bfg random intermittent server errors fetching static resources
On Wed, Aug 18, 2010 at 4:28 PM, Chris Withers wrote: > Iain Duncan wrote: > >> FWIW, I can sit there and hit reload, and get totally different responses >> randomly, sometimes my bfg methods return what they are supposed to, and >> others I get the 500s. >> Could there be a connection with using resource directory overloads in the >> zcml? >> > > It would be good to see the exceptions that are logged on the server side > that match those 500s... > > Chris > > Here is the traceback from one of the times it screwed up. gah, I expect this is not good for homestar runner, maybe something deeply wrong in my model code? The weird thing is now I just had no problem like 10 times in a row, and other times the js app fails when it makes the same request ( /bookings/by_date/2010-08-18 ). But when I hit the same thing in the browser or manually trigger the ajax code from the firebug console, it never fails. Any clues to the meaning of this traceback are most appreciated. 16:37:01,938 INFO [irmacs.views.bookings] BookingView.by_date() date: 2009-12-18 Exception happened during processing of request from ('127.0.0.1', 38238) Traceback (most recent call last): File "/home/irmacs/irmacs_trunk/eggs/Paste-1.7.4-py2.6.egg/paste/httpserver.py", line 1068, in process_request_in_thread self.finish_request(request, client_address) File "/usr/lib/python2.6/SocketServer.py", line 320, in finish_request self.RequestHandlerClass(request, client_address, self) File "/usr/lib/python2.6/SocketServer.py", line 615, in __init__ self.handle() File "/home/irmacs/irmacs_trunk/eggs/Paste-1.7.4-py2.6.egg/paste/httpserver.py", line 442, in handle BaseHTTPRequestHandler.handle(self) File "/usr/lib/python2.6/BaseHTTPServer.py", line 329, in handle self.handle_one_request() File "/home/irmacs/irmacs_trunk/eggs/Paste-1.7.4-py2.6.egg/paste/httpserver.py", line 437, in handle_one_request self.wsgi_execute() File "/home/irmacs/irmacs_trunk/eggs/Paste-1.7.4-py2.6.egg/paste/httpserver.py", line 287, in wsgi_execute self.wsgi_start_response) File "/home/irmacs/irmacs_trunk/eggs/repoze.who-1.0.18-py2.6.egg/repoze/who/middleware.py", line 107, in __call__ app_iter = app(environ, wrapper.wrap_start_response) File "/home/irmacs/irmacs_trunk/eggs/repoze.bfg-1.2.1-py2.6.egg/repoze/bfg/router.py", line 130, in __call__ response = view_callable(context, request) File "/home/irmacs/irmacs_trunk/eggs/repoze.bfg-1.2.1-py2.6.egg/repoze/bfg/configuration.py", line 1665, in _bfg_class_view response = getattr(inst, attr)() File "/home/irmacs/irmacs_trunk/Irmacs/irmacs/views/bookings.py", line 47, in by_date bookings = self.model.list( Booking, {'date':isodate} ) File "/home/irmacs/irmacs_trunk/framework_src/xornot.model/xornot/model/__init__.py", line 208, in list items = query.all() File "/home/irmacs/irmacs_trunk/eggs/SQLAlchemy-0.5.8-py2.6.egg/sqlalchemy/orm/query.py", line 1267, in all return list(self) File "/home/irmacs/irmacs_trunk/eggs/SQLAlchemy-0.5.8-py2.6.egg/sqlalchemy/orm/query.py", line 1422, in instances rows = [process[0](context, row) for row in fetch] File "/home/irmacs/irmacs_trunk/eggs/SQLAlchemy-0.5.8-py2.6.egg/sqlalchemy/orm/query.py", line 2032, in main return _instance(row, None) File "/home/irmacs/irmacs_trunk/eggs/SQLAlchemy-0.5.8-py2.6.egg/sqlalchemy/orm/mapper.py", line 1751, in _instance state._run_on_load(instance) File "/home/irmacs/irmacs_trunk/eggs/SQLAlchemy-0.5.8-py2.6.egg/sqlalchemy/orm/state.py", line 119, in _run_on_load self.manager.events.run('on_load', instance) AttributeError: 'NoneType' object has no attribute 'run' ___ Repoze-dev mailing list Repoze-dev@lists.repoze.org http://lists.repoze.org/listinfo/repoze-dev
Re: [Repoze-dev] repoze.bfg random intermittent server errors fetching static resources
Iain Duncan wrote: > FWIW, I can sit there and hit reload, and get totally different > responses randomly, sometimes my bfg methods return what they are > supposed to, and others I get the 500s. > > Could there be a connection with using resource directory overloads in > the zcml? It would be good to see the exceptions that are logged on the server side that match those 500s... Chris -- Simplistix - Content Management, Batch Processing & Python Consulting - http://www.simplistix.co.uk ___ Repoze-dev mailing list Repoze-dev@lists.repoze.org http://lists.repoze.org/listinfo/repoze-dev
Re: [Repoze-dev] repoze.bfg random intermittent server errors fetching static resources
On Wed, Aug 18, 2010 at 4:26 PM, Iain Duncan wrote: > Maybe some of this well help, I'm serving with paster serve --reload ( > though removing reload doesn't seem to help ). > > It definitely seems like paster and/or bfg are not keeping up for some > reason ( could be me! ). In my calendar app, a ton of static requests are > made very quickly to get all the bits of dojo. After that, the first request > to my regular bfg app always gets a server 500, even though the exact same > code triggered from the console after time has passed *always* works. > Further, putting in a really long timeout before the app initializes seems > to fix this, but it needs to be like 5 seconds. The request in question does > *not* depend on any thing that should be happening in that amount of time > though, it's just a simple json hit. > > Has anyone had experience with paster/bfg issues like this? Do I maybe need > to serve up all my js and css separately? > > FWIW, I can sit there and hit reload, and get totally different responses randomly, sometimes my bfg methods return what they are supposed to, and others I get the 500s. Could there be a connection with using resource directory overloads in the zcml? thanks Iain ___ Repoze-dev mailing list Repoze-dev@lists.repoze.org http://lists.repoze.org/listinfo/repoze-dev
Re: [Repoze-dev] repoze.bfg random intermittent server errors fetching static resources
Maybe some of this well help, I'm serving with paster serve --reload ( though removing reload doesn't seem to help ). It definitely seems like paster and/or bfg are not keeping up for some reason ( could be me! ). In my calendar app, a ton of static requests are made very quickly to get all the bits of dojo. After that, the first request to my regular bfg app always gets a server 500, even though the exact same code triggered from the console after time has passed *always* works. Further, putting in a really long timeout before the app initializes seems to fix this, but it needs to be like 5 seconds. The request in question does *not* depend on any thing that should be happening in that amount of time though, it's just a simple json hit. Has anyone had experience with paster/bfg issues like this? Do I maybe need to serve up all my js and css separately? thanks Iain ___ Repoze-dev mailing list Repoze-dev@lists.repoze.org http://lists.repoze.org/listinfo/repoze-dev
Re: [Repoze-dev] repoze.bfg random intermittent server errors fetching static resources
Am 19.08.2010, 00:34 Uhr, schrieb Iain Duncan : > However, a lot of the time, seemingly random static request just get > served > up an internal server error 500 by bfg. I can't see why, sometimes I hit > reload and it works. If I copy the url into another browser window, it > *always* works. But very frequently a bunch of these static files get > returned a 500. Do you get any traceback on the BFG side? Charlie -- Charlie Clark Managing Director Clark Consulting & Research German Office Helmholtzstr. 20 Düsseldorf D- 40215 Tel: +49-211-600-3657 Mobile: +49-178-782-6226 ___ Repoze-dev mailing list Repoze-dev@lists.repoze.org http://lists.repoze.org/listinfo/repoze-dev
Re: [Repoze-dev] repoze.bfg random intermittent server errors fetching static resources
Sorry, not here. It works 100% of the time for us, at least in all the apps we've deployed. - C On Wed, 2010-08-18 at 15:34 -0700, Iain Duncan wrote: > Hi everyone, I have an app that I have set up to use the bfg resources > facility for serving static files. I'm pretty sure I've done it right, > because most of the time everything works. > > > However, a lot of the time, seemingly random static request just get > served up an internal server error 500 by bfg. I can't see why, > sometimes I hit reload and it works. If I copy the url into another > browser window, it *always* works. But very frequently a bunch of > these static files get returned a 500. > > > Does anyone else know what I'm on about? Does this happen to other > people? It seems like counting on bfg to serve up static resources is > unreliable, but I can't see where I might have done anything wrong. > > > thanks > iain > ___ > Repoze-dev mailing list > Repoze-dev@lists.repoze.org > http://lists.repoze.org/listinfo/repoze-dev ___ Repoze-dev mailing list Repoze-dev@lists.repoze.org http://lists.repoze.org/listinfo/repoze-dev