#2366: Hotfix - fas /usr/lib/python2.6/site-packages/fas/templates/user/view.htmlw -------------------------+-------------------------------------------------- Reporter: ricky | Owner: webmaster Type: change | Status: new Priority: major | Milestone: Component: Web Content | Version: Severity: Normal | Keywords: hotfix -------------------------+-------------------------------------------------- = Change Requested = Applied the following patch to /usr/lib/python2.6/site- packages/fas/templates/user/view.html on fas0[1-3] to work around 500s on /user/view:
{{{ --- /usr/lib/python2.6/site-packages/fas/templates/user/view.html 2010-08-27 15:57:26.000000000 +0000 +++ /home/fedora/ricky/view.html 2010-08-31 05:26:14.136666045 +0000 @@ -123,8 +123,8 @@ <dl> <dt>${_('Status:')}</dt> <dd> - <span class="approved" py:if="role.group in person.approved_memberships">${_('Approved')}</span> - <span class="unapproved" py:if="role.group in person.unapproved_memberships">${_('Unapproved')}</span> + <span class="approved" py:if="role.role_status == 'approved'">${_('Approved')}</span> + <span class="unapproved" py:if="role.role_status == 'unapproved'">${_('Unapproved')}</span> </dd> <py:if test="personal"> <dt>${_('Tools:')}</dt> }}}
This patch doesn't actually address the root of the problem, so we will need to investigate further. The full traceback for the 500s was:
{{{ cherrypy.msg INFO HTTP: Page handler: <bound method User.view of <fas.user.User object at 0xb4203c2c>> Traceback (most recent call last): File "/usr/lib/python2.6/site- packages/CherryPy-2.3.0-py2.6.egg/cherrypy/_cphttptools.py", line 121, in _run self.main() File "/usr/lib/python2.6/site- packages/CherryPy-2.3.0-py2.6.egg/cherrypy/_cphttptools.py", line 264, in main body = page_handler(*virtual_path, **self.params) File "<string>", line 3, in view File "/usr/lib/python2.6/site- packages/turbogears/identity/conditions.py", line 210, in require return fn(self, *args, **kwargs) File "<string>", line 3, in view File "/usr/lib/python2.6/site-packages/turbogears/controllers.py", line 195, in validate return errorhandling.run_with_errors(errors, func, *args, **kw) File "/usr/lib/python2.6/site-packages/turbogears/errorhandling.py", line 119, in run_with_errors return func(self, *args, **kw) File "<string>", line 3, in view File "/usr/lib/python2.6/site-packages/turbogears/controllers.py", line 360, in expose *args, **kw) File "<string>", line 5, in run_with_transaction File "/usr/lib/python2.6/site-packages/turbogears/database.py", line 411, in sa_rwt retval = func(*args, **kw) File "<string>", line 5, in _expose File "/usr/lib/python2.6/site-packages/turbogears/controllers.py", line 373, in <lambda> mapping, fragment, args, kw))) File "/usr/lib/python2.6/site-packages/turbogears/controllers.py", line 420, in _execute_func return _process_output(output, template, format, content_type, mapping, fragment) File "/usr/lib/python2.6/site-packages/turbogears/controllers.py", line 88, in _process_output fragment=fragment) File "/usr/lib/python2.6/site-packages/turbogears/view/base.py", line 159, in render return engine.render(**kw) File "/usr/lib/python2.6/site-packages/genshi/template/plugin.py", line 110, in render return self.transform(info, template).render(**kwargs) File "/usr/lib/python2.6/site-packages/genshi/core.py", line 179, in render return encode(generator, method=method, encoding=encoding, out=out) File "/usr/lib/python2.6/site-packages/genshi/output.py", line 60, in encode return _encode(u''.join(list(iterator))) File "/usr/lib/python2.6/site-packages/genshi/output.py", line 311, in __call__ for kind, data, pos in stream: File "/usr/lib/python2.6/site-packages/genshi/output.py", line 592, in __call__ for kind, data, pos in stream: File "/usr/lib/python2.6/site-packages/genshi/output.py", line 698, in __call__ for kind, data, pos in chain(stream, [(None, None, None)]): File "/usr/lib/python2.6/site-packages/genshi/output.py", line 532, in __call__ for ev in stream: File "/usr/lib/python2.6/site-packages/genshi/core.py", line 283, in _ensure for event in stream: File "/usr/lib/python2.6/site-packages/genshi/template/base.py", line 569, in _include for event in stream: File "/usr/lib/python2.6/site-packages/genshi/template/markup.py", line 279, in _match content = list(content) File "/usr/lib/python2.6/site-packages/genshi/template/base.py", line 569, in _include for event in stream: File "/usr/lib/python2.6/site-packages/genshi/template/markup.py", line 245, in _match for event in stream: File "/usr/lib/python2.6/site-packages/genshi/template/markup.py", line 234, in _strip event = stream.next() File "/usr/lib/python2.6/site-packages/genshi/template/base.py", line 543, in _exec for event in stream: File "/usr/lib/python2.6/site-packages/genshi/template/base.py", line 496, in _eval for kind, data, pos in stream: File "/usr/lib/python2.6/site-packages/genshi/template/base.py", line 558, in _flatten for event in self._flatten(substream, ctxt, **vars): File "/usr/lib/python2.6/site-packages/genshi/template/base.py", line 558, in _flatten for event in self._flatten(substream, ctxt, **vars): File "/usr/lib/python2.6/site-packages/genshi/template/base.py", line 557, in _flatten **vars) File "/usr/lib/python2.6/site-packages/genshi/template/base.py", line 272, in _apply_directives stream = directives[0](iter(stream), directives[1:], ctxt, **vars) File "/usr/lib/python2.6/site-packages/genshi/template/directives.py", line 411, in __call__ value = _eval_expr(self.expr, ctxt, **vars) File "/usr/lib/python2.6/site-packages/genshi/template/base.py", line 286, in _eval_expr retval = expr.evaluate(ctxt) File "/usr/lib/python2.6/site-packages/genshi/template/eval.py", line 180, in evaluate return eval(self.code, _globals, {'__data__': data}) File "/usr/lib/python2.6/site-packages/fas/templates/user/view.html", line 126, in <Expression u'role.group in person.approved_memberships'> <span class="approved" py:if="role.group in person.approved_memberships">${_('Approved')}</span> File "/usr/lib/python2.6/site- packages/sqlalchemy/ext/associationproxy.py", line 356, in __contains__ for member in self.col: File "/usr/lib/python2.6/site- packages/sqlalchemy/ext/associationproxy.py", line 300, in <lambda> col = property(lambda self: self.lazy_collection()) File "/usr/lib/python2.6/site- packages/sqlalchemy/ext/associationproxy.py", line 158, in lazy_collection "stale association proxy, parent object has gone out of " InvalidRequestError: stale association proxy, parent object has gone out of scope }}}
#2366: Hotfix - fas /usr/lib/python2.6/site-packages/fas/templates/user/view.htmlw -------------------------+-------------------------------------------------- Reporter: ricky | Owner: webmaster Type: change | Status: new Priority: major | Milestone: Component: Web Content | Version: Severity: Normal | Resolution: Keywords: hotfix | -------------------------+-------------------------------------------------- Comment (by toshio):
http://www.mail-archive.com/sqlalchemy@googlegroups.com/msg08914.html
#2366: Hotfix - fas /usr/lib/python2.6/site-packages/fas/templates/user/view.htmlw -------------------------+-------------------------------------------------- Reporter: ricky | Owner: webmaster Type: change | Status: new Priority: major | Milestone: Component: Web Content | Version: Severity: Normal | Resolution: Keywords: hotfix | -------------------------+-------------------------------------------------- Comment (by toshio):
Ran the test from that thread and I don't see the problem so this is different in some way.
#2366: Hotfix - fas /usr/lib/python2.6/site-packages/fas/templates/user/view.htmlw -------------------------+-------------------------------------------------- Reporter: ricky | Owner: webmaster Type: change | Status: new Priority: major | Milestone: Component: Web Content | Version: Production Severity: Normal | Resolution: Keywords: hotfix | -------------------------+-------------------------------------------------- Changes (by toshio):
* cc: lmacken, toshio (added) * version: => Production
Comment:
This also affects the json return values which is problematic for fedoracommunity and probably python-fedora. lmacken, any ideas on what this could be?
{{{ [Tue Aug 31 22:54:01 2010] [error] Traceback (most recent call last): [Tue Aug 31 22:54:01 2010] [error] File "/usr/lib/python2.6/site- packages/CherryPy-2.3.0-py2.6.egg/cherrypy/_cphtt ptools.py", line 121, in _run [Tue Aug 31 22:54:01 2010] [error] self.main() [Tue Aug 31 22:54:01 2010] [error] File "/usr/lib/python2.6/site- packages/CherryPy-2.3.0-py2.6.egg/cherrypy/_cphtt ptools.py", line 264, in main [Tue Aug 31 22:54:01 2010] [error] body = page_handler(*virtual_path, **self.params) [Tue Aug 31 22:54:01 2010] [error] File "<string>", line 3, in list [Tue Aug 31 22:54:01 2010] [error] File "/usr/lib/python2.6/site- packages/turbogears/identity/conditions.py", line 210, in require [Tue Aug 31 22:54:01 2010] [error] return fn(self, *args, **kwargs) [Tue Aug 31 22:54:01 2010] [error] File "<string>", line 3, in list [Tue Aug 31 22:54:01 2010] [error] File "/usr/lib/python2.6/site- packages/turbogears/controllers.py", line 360, in expose [Tue Aug 31 22:54:01 2010] [error] *args, **kw) [Tue Aug 31 22:54:01 2010] [error] File "<string>", line 5, in run_with_transaction [Tue Aug 31 22:54:01 2010] [error] File "/usr/lib/python2.6/site- packages/turbogears/database.py", line 411, in sa_rwt [Tue Aug 31 22:54:01 2010] [error] retval = func(*args, **kw) [Tue Aug 31 22:54:01 2010] [error] File "<string>", line 5, in _expose [Tue Aug 31 22:54:01 2010] [error] File "/usr/lib/python2.6/site- packages/turbogears/controllers.py", line 252, in <lambda> [Tue Aug 31 22:54:01 2010] [error] None, False, args, kw)) [Tue Aug 31 22:54:01 2010] [error] File "/usr/lib/python2.6/site- packages/turbogears/controllers.py", line 420, in _execute_func [Tue Aug 31 22:54:01 2010] [error] return _process_output(output, template, format, content_type, mapping, fragment) [Tue Aug 31 22:54:01 2010] [error] File "/usr/lib/python2.6/site- packages/turbogears/controllers.py", line 88, in _process_output [Tue Aug 31 22:54:01 2010] [error] fragment=fragment) [Tue Aug 31 22:54:01 2010] [error] File "/usr/lib/python2.6/site- packages/turbogears/view/base.py", line 159, in render [Tue Aug 31 22:54:01 2010] [error] return engine.render(**kw) [Tue Aug 31 22:54:01 2010] [error] File "/usr/lib/python2.6/site- packages/turbojson/jsonsupport.py", line 40, in render [Tue Aug 31 22:54:01 2010] [error] output = self.encoder.encode(info) [Tue Aug 31 22:54:01 2010] [error] File "/usr/lib/python2.6/site- packages/simplejson/encoder.py", line 200, in encode [Tue Aug 31 22:54:01 2010] [error] chunks = self.iterencode(o, _one_shot=True) [Tue Aug 31 22:54:01 2010] [error] File "/usr/lib/python2.6/site- packages/simplejson/encoder.py", line 260, in iterencode [Tue Aug 31 22:54:01 2010] [error] return _iterencode(o, 0) [Tue Aug 31 22:54:01 2010] [error] File "/usr/lib/python2.6/site- packages/turbojson/jsonify.py", line 163, in default [Tue Aug 31 22:54:01 2010] [error] return jsonify(obj) [Tue Aug 31 22:54:01 2010] [error] File "<generated code>", line 0, in jsonify [Tue Aug 31 22:54:01 2010] [error] File "/usr/lib/python2.6/site- packages/peak/rules/core.py", line 153, in __call__ [Tue Aug 31 22:54:01 2010] [error] return self.body(*args, **kw) [Tue Aug 31 22:54:01 2010] [error] File "/usr/lib/python2.6/site- packages/fedora/tg/json.py", line 156, in jsonify_salist [Tue Aug 31 22:54:01 2010] [error] return [jsonify(element) for element in obj] [Tue Aug 31 22:54:01 2010] [error] File "/usr/lib/python2.6/site- packages/sqlalchemy/ext/associationproxy.py", line 380, in __iter__ [Tue Aug 31 22:54:01 2010] [error] for member in self.col: [Tue Aug 31 22:54:01 2010] [error] File "/usr/lib/python2.6/site- packages/sqlalchemy/ext/associationproxy.py", line 300, in <lambda> [Tue Aug 31 22:54:01 2010] [error] col = property(lambda self: self.lazy_collection()) [Tue Aug 31 22:54:01 2010] [error] File "/usr/lib/python2.6/site- packages/sqlalchemy/ext/associationproxy.py", line 158, in lazy_collection [Tue Aug 31 22:54:01 2010] [error] "stale association proxy, parent object has gone out of " [Tue Aug 31 22:54:01 2010] [error] InvalidRequestError: stale association proxy, parent object has gone out of scope [Tue Aug 31 22:54:01 2010] [error] [Tue Aug 31 22:54:01 2010] [error] turbogears.access INFO - toshio "GET /accounts/user/list/U*?tg_format=json&_csrf_token=3b593877564f86ebda28d23d46a1a3c0a70e3d22 HTTP/1.0" 500 791 "" "Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.7) Gecko/20100723 Fedora/3.6.7-1.fc13 Firefox/3.6.7" }}}
#2366: Hotfix - fas /usr/lib/python2.6/site-packages/fas/templates/user/view.htmlw -------------------------+-------------------------------------------------- Reporter: ricky | Owner: webmaster Type: change | Status: new Priority: major | Milestone: Component: Web Content | Version: Production Severity: Normal | Resolution: Keywords: hotfix | -------------------------+-------------------------------------------------- Comment (by toshio):
This is replicable in the staging environment. For instance:
https://admin.stg.fedoraproject.org/accounts/user/list/U*?tg_format=json
I also tested the latest 0.5.x version of sqlalchemy but the issue does not go away: python-sqlalchemy-0.5.8-3.el6.noarch.rpm
(Built this in koji and tested it on fas01.stg. After testing, reverted to 0.5.5)
#2366: Hotfix - fas /usr/lib/python2.6/site-packages/fas/templates/user/view.htmlw -------------------------+-------------------------------------------------- Reporter: ricky | Owner: webmaster Type: change | Status: new Priority: major | Milestone: Component: Web Content | Version: Production Severity: Normal | Resolution: Keywords: hotfix | -------------------------+-------------------------------------------------- Comment (by toshio):
Okay, attaching a new hotfix patch -- this was applied on top of the other patch but this is the only one that should be sufficient if we have to rebuild a server. lmacken, please test fedoracommunity, this should fix json and html for all URLs.
#2366: Hotfix - fas /usr/lib/python2.6/site-packages/fas/templates/user/view.html -------------------------+-------------------------------------------------- Reporter: ricky | Owner: webmaster Type: change | Status: new Priority: major | Milestone: Component: Web Content | Version: Production Severity: Normal | Resolution: Keywords: hotfix | -------------------------+-------------------------------------------------- Changes (by toshio):
* summary: Hotfix - fas /usr/lib/python2.6/site- packages/fas/templates/user/view.htmlw => Hotfix - fas /usr/lib/python2.6/site- packages/fas/templates/user/view.html
Comment:
New fix because the last fix was too slow when querying for all of the people who have signed cla_done. I've converted the method to use the SQL level API instead of the ORM. I had to replicate a bit of filter_private code to do so. We might want to try abstracting that at some point in the future.
#2366: Hotfix - fas /usr/lib/python2.6/site-packages/fas/templates/user/view.html -------------------------+-------------------------------------------------- Reporter: ricky | Owner: webmaster Type: change | Status: closed Priority: major | Milestone: Component: Web Content | Version: Production Severity: Normal | Resolution: fixed Keywords: hotfix | -------------------------+-------------------------------------------------- Changes (by toshio):
* status: new => closed * resolution: => fixed
Comment:
This change is in the latest fas release which is now deployed.
websites@lists.fedoraproject.org