okfn/openspending — Issue #325: Error 500 showing unlikely error messages
Author: mk270
Created: 2011-11-22 11:17:58+00:00
State: open

These URLs:

http://openspending.org/dataset/ukgov-25k-spending/entries?filter-department_family.label_facet=DCMS&page=77&filter-from.label_facet=ODA&filter-to.label_facet=COFELY+EAST+LONDON+ENERGY+LIMITED

http://openspending.org/entry/616c3b361a17eaf16e5967859c89d966d885479c

start as "ArgumentError: Trying to redefine primary-key column 'id' as a non-primary-key column on table 'city-of-whiteacre-spending__department'" but are presented to the user as "non-existent dataset", which isn't quite right. For the /entry/ one, i'd like to know where the URL came from in the first place

Traceback for the latter follows

URL: http://openspending.org/entry/616c3b361a17eaf16e5967859c89d966d885479c
File '/home/okfn/var/srvc/openspending.org/lib/python2.6/site-packages/weberror/errormiddleware.py', line 162 in __call__
app_iter = self.application(environ, sr_checker)
File '/home/okfn/var/srvc/openspending.org/lib/python2.6/site-packages/repoze/who/middleware.py', line 87 in __call__
app_iter = app(environ, wrapper.wrap_start_response)
File '/home/okfn/var/srvc/openspending.org/lib/python2.6/site-packages/beaker/middleware.py', line 73 in __call__
return self.app(environ, start_response)
File '/home/okfn/var/srvc/openspending.org/lib/python2.6/site-packages/beaker/middleware.py', line 155 in __call__
return self.wrap_app(environ, session_start_response)
File '/home/okfn/var/srvc/openspending.org/lib/python2.6/site-packages/routes/middleware.py', line 131 in __call__
response = self.app(environ, start_response)
File '/home/okfn/var/srvc/openspending.org/lib/python2.6/site-packages/pylons/wsgiapp.py', line 107 in __call__
response = self.dispatch(controller, environ, start_response)
File '/home/okfn/var/srvc/openspending.org/lib/python2.6/site-packages/pylons/wsgiapp.py', line 312 in dispatch
return controller(environ, start_response)
File '/home/okfn/var/srvc/openspending.org/src/openspending/openspending/ui/lib/base.py', line 89 in __call__
return WSGIController.__call__(self, environ, start_response)
File '/home/okfn/var/srvc/openspending.org/lib/python2.6/site-packages/pylons/controllers/core.py', line 207 in __call__
response = self._inspect_call(self.__before__)
File '/home/okfn/var/srvc/openspending.org/lib/python2.6/site-packages/pylons/controllers/core.py', line 105 in _inspect_call
result = self._perform_call(func, args)
File '/home/okfn/var/srvc/openspending.org/lib/python2.6/site-packages/pylons/controllers/core.py', line 57 in _perform_call
return func(**args)
File '/home/okfn/var/srvc/openspending.org/src/openspending/openspending/ui/lib/base.py', line 108 in __before__
self._detect_dataset_subdomain()
File '/home/okfn/var/srvc/openspending.org/src/openspending/openspending/ui/lib/base.py', line 130 in _detect_dataset_subdomain
for dataset in c.datasets:
File '/home/okfn/var/srvc/openspending.org/lib/python2.6/site-packages/sqlalchemy/orm/query.py', line 1960 in instances
rows = [process[0](row, None) for row in fetch]
File '/home/okfn/var/srvc/openspending.org/lib/python2.6/site-packages/sqlalchemy/orm/mapper.py', line 2603 in _instance
state.manager.dispatch.load(state, context)
File '/home/okfn/var/srvc/openspending.org/lib/python2.6/site-packages/sqlalchemy/event.py', line 274 in __call__
fn(*args, **kw)
File '/home/okfn/var/srvc/openspending.org/lib/python2.6/site-packages/sqlalchemy/orm/mapper.py', line 2802 in _event_on_load
instrumenting_mapper._reconstructor(state.obj())
File '/home/okfn/var/srvc/openspending.org/src/openspending/openspending/model/dataset.py', line 83 in _load_model
self.init()
File '/home/okfn/var/srvc/openspending.org/src/openspending/openspending/model/dataset.py', line 116 in init
field.init(self.meta, self.table)
File '/home/okfn/var/srvc/openspending.org/src/openspending/openspending/model/dimension.py', line 133 in init
attr.init(meta, self.table)
File '/home/okfn/var/srvc/openspending.org/src/openspending/openspending/model/attribute.py', line 40 in init
table.append_column(self.column)
File '/home/okfn/var/srvc/openspending.org/lib/python2.6/site-packages/sqlalchemy/schema.py', line 453 in append_column
column._set_parent_with_dispatch(self)
File '/home/okfn/var/srvc/openspending.org/lib/python2.6/site-packages/sqlalchemy/events.py', line 227 in _set_parent_with_dispatch
self._set_parent(parent)
File '/home/okfn/var/srvc/openspending.org/lib/python2.6/site-packages/sqlalchemy/schema.py', line 952 in _set_parent
self.key, table.fullname))
ArgumentError: Trying to redefine primary-key column 'id' as a non-primary-key column on table 'city-of-whiteacre-spending__department'