I've started getting an intermittent Beaker error. It happens in the base controller when I pass ``session.id`` to a generic logging routine. However, I have three sites with the same logging code, and it's only happening on one of the sites. It occurs on a variety of URLs. Here's the exception:
URL: http://localhost:8010/search/results Module weberror.errormiddleware:162 in __call__ << __traceback_supplement__ = Supplement, self, environ sr_checker = ResponseStartChecker(start_response) app_iter = self.application(environ, sr_checker) return self.make_catching_iter(app_iter, environ, sr_checker) except: >> app_iter = self.application(environ, sr_checker) Module beaker.middleware:81 in __call__ << self.cache_manager) environ[self.environ_key] = self.cache_manager return self.app(environ, start_response) >> return self.app(environ, start_response) Module beaker.middleware:159 in __call__ << headers.append(('Set-cookie', cookie)) return start_response(status, headers, exc_info) return self.wrap_app(environ, session_start_response) def _get_session(self): >> return self.wrap_app(environ, session_start_response) Module routes.middleware:118 in __call__ << environ['SCRIPT_NAME'] = environ['SCRIPT_NAME'][:-1] response = self.app(environ, start_response) # Wrapped in try as in rare cases the attribute will be gone already >> response = self.app(environ, start_response) Module pylons.wsgiapp:117 in __call__ << controller = self.resolve(environ, start_response) response = self.dispatch(controller, environ, start_response) if 'paste.testing_variables' in environ and hasattr(response, >> response = self.dispatch(controller, environ, start_response) Module pylons.wsgiapp:316 in dispatch << if log_debug: log.debug("Calling controller class with WSGI interface") return controller(environ, start_response) def load_test_env(self, environ): >> return controller(environ, start_response) Module cameo.lib.base:39 in __call__ << return WSGIController.__call__(self, environ, start_response) finally: self.sitestats.log_access_pylons(request, response, session.id) self.sitestats.log_referer(request.referer) g.backend.cleanup_request() >> self.sitestats.log_access_pylons(request, response, session.id) Module paste.registry:137 in __getattr__ << def __getattr__(self, attr): return getattr(self._current_obj(), attr) def __setattr__(self, attr, value): >> return getattr(self._current_obj(), attr) Module beaker.session:463 in __getattr__ << def __getattr__(self, attr): return getattr(self._session(), attr) def __setattr__(self, attr, value): >> return getattr(self._session(), attr) Module beaker.session:459 in _session << else: self.__dict__['_sess'] = Session(req, use_cookies=True, **params) return self.__dict__['_sess'] >> **params) Module beaker.session:103 in __init__ << except: if invalidate_corrupt: self.invalidate() else: raise >> self.invalidate() Module beaker.session:170 in invalidate << if hasattr(self, 'namespace'): namespace = self.namespace namespace.acquire_write_lock() try: namespace.remove() >> namespace.acquire_write_lock() Module beaker.container:113 in acquire_write_lock << def acquire_write_lock(self, wait=True): r = self.access_lock.acquire_write_lock(wait) try: if (wait or r): >> r = self.access_lock.acquire_write_lock(wait) Module beaker.synchronization:172 in acquire_write_lock << if state.reentrantcount == 0: x = self.do_acquire_write_lock(wait) if (wait or x): state.reentrantcount += 1 >> x = self.do_acquire_write_lock(wait) Module beaker.synchronization:260 in do_acquire_write_lock << return False else: fcntl.flock(filedescriptor, fcntl.LOCK_EX) return True >> fcntl.flock(filedescriptor, fcntl.LOCK_EX) TypeError: argument must be an int, or have a fileno() method. The Beaker WSGI variables are: beaker.cache <beaker.cache.CacheManager object at 0x8f5eccc> beaker.get_session <bound method SessionMiddleware._get_session of <beaker.middleware.SessionMiddleware object at 0x8f5ec6c>> beaker.session Cannot print: argument must be an int, or have a fileno() method. Note that the ``beaker.session`` message is identical to the exception. That makes me wonder if it's a second exception that's masking the original one. On the other hand, the traceback location is quite plausable. -- Mike Orr <[email protected]> --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~----------~----~----~----~------~----~------~--~---
