#3849 mirrormanager admin interface HTTP 500 error
Closed: Fixed None Opened 6 years ago by mdomsch.

= bug description =
From: Josef Gryga [mailto:mirror@karneval.cz]
Sent: Thursday, June 20, 2013 4:47 PM
To: Domsch, Matt
Subject: Re: MirrorManager 1.4 - new options for mirror admins

Hi Matt,

I wanted to try your new mirrormanager, but I received error on the mirrormanager web page (https://admin.fedoraproject.org/mirrormanager)
The page https://admin.fedoraproject.org/mirrormanager/?_csrf_token=0e2af3fa25bcaa5c151f4e072b16cde375eb3e2e is reporting this error to me:

500 Internal error
The server encountered an unexpected condition which prevented it from fulfilling the request.

Can you please check it?
My username is "karneval"

Regards,
Josef

= bug analysis =

= fix recommendation =


{{{
[Thu Jun 20 09:46:40 2013] [error] 2013-06-20 09:46:40,873 cherrypy.msg INFO HTTP: Page handler: <bound method="" root.index="" of="" <mirrormanager.controllers.root="" object="" at="" 0xb052818c="">>
[Thu Jun 20 09:46:40 2013] [error] Traceback (most recent call last):
[Thu Jun 20 09:46:40 2013] [error] File "/usr/lib/python2.6/site-packages/CherryPy-2.3.0-py2.6.egg/cherrypy/_cphttptools.py", line 121, in _run
[Thu Jun 20 09:46:40 2013] [error] self.main()
[Thu Jun 20 09:46:40 2013] [error] File "/usr/lib/python2.6/site-packages/CherryPy-2.3.0-py2.6.egg/cherrypy/_cphttptools.py", line 264, in main
[Thu Jun 20 09:46:40 2013] [error] body = page_handler(virtual_path, self.params)
[Thu Jun 20 09:46:40 2013] [error] File "<string>", line 3, in index
[Thu Jun 20 09:46:40 2013] [error] File "/usr/lib/python2.6/site-packages/turbogears/controllers.py", line 361, in expose
[Thu Jun 20 09:46:40 2013] [error] *args,
kw)
[Thu Jun 20 09:46:40 2013] [error] File "<generated code="">", line 0, in run_with_transaction
[Thu Jun 20 09:46:40 2013] [error] File "/usr/lib/python2.6/site-packages/peak/rules/core.py", line 153, in call
[Thu Jun 20 09:46:40 2013] [error] return self.body(
args, kw)
[Thu Jun 20 09:46:40 2013] [error] File "/usr/lib/python2.6/site-packages/turbogears/database.py", line 410, in so_rwt
[Thu Jun 20 09:46:40 2013] [error] retval = func(*args,
kw)
[Thu Jun 20 09:46:40 2013] [error] File "/usr/lib/python2.6/site-packages/turbogears/controllers.py", line 244, in _expose
[Thu Jun 20 09:46:40 2013] [error] @abstract()
[Thu Jun 20 09:46:40 2013] [error] File "<generated code="">", line 0, in _expose
[Thu Jun 20 09:46:40 2013] [error] File "/usr/lib/python2.6/site-packages/peak/rules/core.py", line 153, in call
[Thu Jun 20 09:46:40 2013] [error] return self.body(args, kw)
[Thu Jun 20 09:46:40 2013] [error] File "/usr/lib/python2.6/site-packages/turbogears/controllers.py", line 390, in <lambda>
[Thu Jun 20 09:46:40 2013] [error] fragment, options, args, kw)))
[Thu Jun 20 09:46:40 2013] [error] File "/usr/lib/python2.6/site-packages/turbogears/controllers.py", line 425, in _execute_func
[Thu Jun 20 09:46:40 2013] [error] output = errorhandling.try_call(func, *args,
kw)
[Thu Jun 20 09:46:40 2013] [error] File "/usr/lib/python2.6/site-packages/turbogears/errorhandling.py", line 77, in try_call
[Thu Jun 20 09:46:40 2013] [error] return func(self,
args, kw)
[Thu Jun 20 09:46:40 2013] [error] File "<string>", line 3, in index
[Thu Jun 20 09:46:40 2013] [error] File "/usr/lib/python2.6/site-packages/turbogears/identity/conditions.py", line 249, in require
[Thu Jun 20 09:46:40 2013] [error] return fn(self, *args,
kwargs)
[Thu Jun 20 09:46:40 2013] [error] File "/usr/share/mirrormanager/server/mirrormanager/controllers.py", line 852, in index
[Thu Jun 20 09:46:40 2013] [error] sites = user_sites(identity)
[Thu Jun 20 09:46:40 2013] [error] File "/usr/share/mirrormanager/server/mirrormanager/model.py", line 151, in user_sites
[Thu Jun 20 09:46:40 2013] [error] query_result = Site.select(join=INNERJOINOn(Site, SiteAdmin, AND(SiteAdmin.q.siteID == Site.q.id,
[Thu Jun 20 09:46:40 2013] [error] NameError: global name 'INNERJOINOn' is not defined
}}}

I think the patch is simply this:

{{{
diff --git a/server/mirrormanager/model.py b/server/mirrormanager/model.py
index 5ac4a92..e2753c3 100644
--- a/server/mirrormanager/model.py
+++ b/server/mirrormanager/model.py
@@ -1,6 +1,6 @@
from sqlobject import *
from sqlobject.converters import sqlrepr
-from sqlobject.sqlbuilder import RLIKE
+from sqlobject.sqlbuilder import RLIKE, INNERJOINOn
from turbogears import identity, config
from datetime import datetime
import time
}}}

989fa061b7c5b2e6339617d550c251ae5c2fe55f is the commit that remove INNERJOINOn from being imported, specifically :

{{{
diff --git a/server/mirrormanager/model.py b/server/mirrormanager/model.py
index 021a460..ba8642d 100644
--- a/server/mirrormanager/model.py
+++ b/server/mirrormanager/model.py
@@ -1,5 +1,5 @@
from sqlobject import
-from sqlobject.sqlbuilder import

+from sqlobject.sqlbuilder import RLIKE
from turbogears import identity, config
from datetime import datetime
import time
}}}

{{{
From af5dcda8cda236bbb34c0317168ca356656e5da0 Mon Sep 17 00:00:00 2001
From: Matt Domsch Matt_Domsch@dell.com
Date: Thu, 20 Jun 2013 17:13:06 -0500
Subject: [PATCH] model.py: fix sqlbuilder imports


server/mirrormanager/model.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/server/mirrormanager/model.py b/server/mirrormanager/model.py
index 5ac4a92..bba2ee7 100644
--- a/server/mirrormanager/model.py
+++ b/server/mirrormanager/model.py
@@ -1,6 +1,6 @@
from sqlobject import *
from sqlobject.converters import sqlrepr
-from sqlobject.sqlbuilder import RLIKE
+from sqlobject.sqlbuilder import RLIKE, AND, OR, INNERJOINOn
from turbogears import identity, config
from datetime import datetime
import time
--
1.8.1.4
}}}

hotfix in Fedora Infrastructure production now.

more tracebacks yet... :-(
{{{
Traceback (most recent call last):
[Fri Jun 21 12:09:29 2013] [error] File "/usr/lib/python2.6/site-packages/CherryPy-2.3.0-py2.6.egg/cherrypy/_cphttptools.py", line 121, in _run
[Fri Jun 21 12:09:29 2013] [error] self.main()
[Fri Jun 21 12:09:29 2013] [error] File "/usr/lib/python2.6/site-packages/CherryPy-2.3.0-py2.6.egg/cherrypy/_cphttptools.py", line 264, in main
[Fri Jun 21 12:09:29 2013] [error] body = page_handler(virtual_path, self.params)
[Fri Jun 21 12:09:29 2013] [error] File "<string>", line 3, in index
[Fri Jun 21 12:09:29 2013] [error] File "/usr/lib/python2.6/site-packages/turbogears/controllers.py", line 361, in expose
[Fri Jun 21 12:09:29 2013] [error] *args,
kw)
[Fri Jun 21 12:09:29 2013] [error] File "<generated code="">", line 0, in run_with_transaction
[Fri Jun 21 12:09:29 2013] [error] File "/usr/lib/python2.6/site-packages/peak/rules/core.py", line 153, in call
[Fri Jun 21 12:09:29 2013] [error] return self.body(
args, kw)
[Fri Jun 21 12:09:29 2013] [error] File "/usr/lib/python2.6/site-packages/turbogears/database.py", line 410, in so_rwt
[Fri Jun 21 12:09:29 2013] [error] retval = func(*args,
kw)
[Fri Jun 21 12:09:29 2013] [error] File "/usr/lib/python2.6/site-packages/turbogears/controllers.py", line 244, in _expose
[Fri Jun 21 12:09:29 2013] [error] @abstract()
[Fri Jun 21 12:09:29 2013] [error] File "<generated code="">", line 0, in _expose
[Fri Jun 21 12:09:29 2013] [error] File "/usr/lib/python2.6/site-packages/peak/rules/core.py", line 153, in call
[Fri Jun 21 12:09:29 2013] [error] return self.body(args, kw)
[Fri Jun 21 12:09:29 2013] [error] File "/usr/lib/python2.6/site-packages/turbogears/controllers.py", line 390, in <lambda>
[Fri Jun 21 12:09:29 2013] [error] fragment, options, args, kw)))
[Fri Jun 21 12:09:29 2013] [error] File "/usr/lib/python2.6/site-packages/turbogears/controllers.py", line 425, in _execute_func
[Fri Jun 21 12:09:29 2013] [error] output = errorhandling.try_call(func, *args,
kw)
[Fri Jun 21 12:09:29 2013] [error] File "/usr/lib/python2.6/site-packages/turbogears/errorhandling.py", line 77, in try_call
[Fri Jun 21 12:09:29 2013] [error] return func(self,
args, kw)
[Fri Jun 21 12:09:29 2013] [error] File "<string>", line 3, in index
[Fri Jun 21 12:09:29 2013] [error] File "/usr/lib/python2.6/site-packages/turbogears/identity/conditions.py", line 249, in require
[Fri Jun 21 12:09:29 2013] [error] return fn(self, *args,
kwargs)
[Fri Jun 21 12:09:29 2013] [error] File "/usr/share/mirrormanager/server/mirrormanager/controllers.py", line 852, in index
[Fri Jun 21 12:09:29 2013] [error] sites = user_sites(identity)
[Fri Jun 21 12:09:29 2013] [error] File "/usr/share/mirrormanager/server/mirrormanager/model.py", line 155, in user_sites
[Fri Jun 21 12:09:29 2013] [error] result.append((site.id, site.name, host.id, host.name))
[Fri Jun 21 12:09:29 2013] [error] NameError: global name 'host' is not defined
}}}

Fixed in 1.4.3 in production now too. Closing.

Login to comment on this ticket.

Metadata