在 Mac 上安装 DataPusher 后,ckan 网站发生不可逆、可重现的崩溃

Irreversible, reproducible crash of ckan website upon installing DataPusher on Mac

我正在尝试在 Homebrew 的帮助下在我的 MacBook Pro 运行ning OS X 10.10.3 上构建一个 ckan (v2.3) 数据门户。虽然我不得不对官方文档进行小幅调整以使从源代码安装对我有用,但我已经能够 运行 使用 Solr 和 Tomcat 并安装 DataStore 和 FileStore 组件没有事件。我可以使用系统管理员帐户上传文件并再次下载它们,没有任何问题。

问题是当我尝试安装 DataPusher 以确保用户上传的数据自动放入 DataStore 时。按照位于 here 的指南中的 "Development" 部分进行操作会导致一些非常奇怪的事情发生。


File '/usr/lib/ckan/default/lib/python2.7/site-packages/weberror/evalexception.py', line 431 in respond
  app_iter = self.application(environ, detect_start_response)
File '/usr/lib/ckan/default/lib/python2.7/site-packages/webob/dec.py', line 147 in __call__
  resp = self.call_func(req, *args, **self.kwargs)
File '/usr/lib/ckan/default/lib/python2.7/site-packages/webob/dec.py', line 208 in call_func
  return self.func(req, *args, **kwargs)
File '/usr/lib/ckan/default/lib/python2.7/site-packages/fanstatic/publisher.py', line 234 in __call__
  return request.get_response(self.app)
File '/usr/lib/ckan/default/lib/python2.7/site-packages/webob/request.py', line 1053 in get_response
  application, catch_exc_info=False)
File '/usr/lib/ckan/default/lib/python2.7/site-packages/webob/request.py', line 1022 in call_application
  app_iter = application(self.environ, start_response)
File '/usr/lib/ckan/default/lib/python2.7/site-packages/webob/dec.py', line 147 in __call__
  resp = self.call_func(req, *args, **self.kwargs)
File '/usr/lib/ckan/default/lib/python2.7/site-packages/webob/dec.py', line 208 in call_func
  return self.func(req, *args, **kwargs)
File '/usr/lib/ckan/default/lib/python2.7/site-packages/fanstatic/injector.py', line 54 in __call__
  response = request.get_response(self.app)
File '/usr/lib/ckan/default/lib/python2.7/site-packages/webob/request.py', line 1053 in get_response
  application, catch_exc_info=False)
File '/usr/lib/ckan/default/lib/python2.7/site-packages/webob/request.py', line 1022 in call_application
  app_iter = application(self.environ, start_response)
File '/usr/lib/ckan/default/lib/python2.7/site-packages/beaker/middleware.py', line 73 in __call__
  return self.app(environ, start_response)
File '/usr/lib/ckan/default/lib/python2.7/site-packages/beaker/middleware.py', line 155 in __call__
  return self.wrap_app(environ, session_start_response)
File '/usr/lib/ckan/default/lib/python2.7/site-packages/routes/middleware.py', line 131 in __call__
  response = self.app(environ, start_response)
File '/usr/lib/ckan/default/lib/python2.7/site-packages/pylons/wsgiapp.py', line 125 in __call__
  response = self.dispatch(controller, environ, start_response)
File '/usr/lib/ckan/default/lib/python2.7/site-packages/pylons/wsgiapp.py', line 324 in dispatch
  return controller(environ, start_response)
File '/Users/<user>/ckan/lib/default/src/ckan/ckan/lib/base.py', line 338 in __call__
  res = WSGIController.__call__(self, environ, start_response)
File '/usr/lib/ckan/default/lib/python2.7/site-packages/pylons/controllers/core.py', line 221 in __call__
  response = self._dispatch_call()
File '/usr/lib/ckan/default/lib/python2.7/site-packages/pylons/controllers/core.py', line 172 in _dispatch_call
  response = self._inspect_call(func)
File '/usr/lib/ckan/default/lib/python2.7/site-packages/pylons/controllers/core.py', line 107 in _inspect_call
  result = self._perform_call(func, args)
File '/usr/lib/ckan/default/lib/python2.7/site-packages/pylons/controllers/core.py', line 60 in _perform_call
  return func(**args)
File '/Users/<user>/ckan/lib/default/src/ckan/ckan/controllers/home.py', line 182 in index
  return base.render('home/index.html', cache_force=True)
File '/Users/<user>/ckan/lib/default/src/ckan/ckan/lib/base.py', line 217 in render
  loader_class=loader_class)
File '/usr/lib/ckan/default/lib/python2.7/site-packages/pylons/templating.py', line 249 in cached_template
  return render_func()
File '/Users/<user>/ckan/lib/default/src/ckan/ckan/lib/base.py', line 155 in render_template
  return render_jinja2(template_name, globs)
File '/Users/<user>/ckan/lib/default/src/ckan/ckan/lib/base.py', line 104 in render_jinja2
  return template.render(**extra_vars)
File '/usr/lib/ckan/default/lib/python2.7/site-packages/jinja2/environment.py', line 894 in render
  return self.environment.handle_exception(exc_info, True)
File '/Users/<user>/ckan/lib/default/src/ckan/ckan/templates/home/index.html', line 2 in top-level template code
  {% set homepage_style = ( g.homepage_style or '1' ) %}
File '/Users/<user>/ckan/lib/default/src/ckan/ckan/templates/page.html', line 1 in top-level template code
  {% extends "base.html" %}
File '/Users/<user>/ckan/lib/default/src/ckan/ckan/templates/base.html', line 103 in top-level template code
  {%- block page %}{% endblock -%}
File '/Users/<user>/ckan/lib/default/src/ckan/ckan/templates/page.html', line 14 in block "page"
  {%- block header %}
File '/Users/<user>/ckan/lib/default/src/ckan/ckan/templates/page.html', line 15 in block "header"
  {% include "header.html" %}
File '/Users/<user>/ckan/lib/default/src/ckan/ckan/templates/header.html', line 1 in top-level template code
  {% block header_wrapper %}
File '/Users/<user>/ckan/lib/default/src/ckan/ckan/templates/header.html', line 2 in block "header_wrapper"
  {% block header_account %}
File '/Users/<user>/ckan/lib/default/src/ckan/ckan/templates/header.html', line 5 in block "header_account"
  {% block header_account_container_content %}
File '/Users/<user>/ckan/lib/default/src/ckan/ckan/templates/header.html', line 9 in block "header_account_container_content"
  {% block header_account_logged %}
File '/Users/<user>/ckan/lib/default/src/ckan/ckan/templates/header.html', line 23 in block "header_account_logged"
  {% set new_activities = h.new_activities() %}
File '/Users/<user>/ckan/lib/default/src/ckan/ckan/lib/helpers.py', line 1855 in new_activities
  return action({}, {})
File '/Users/<user>/ckan/lib/default/src/ckan/ckan/logic/__init__.py', line 424 in wrapped
  result = _action(context, data_dict, **kw)
File '/Users/<user>/ckan/lib/default/src/ckan/ckan/logic/action/get.py', line 3259 in dashboard_new_activities_count
  context, data_dict)
File '/Users/<user>/ckan/lib/default/src/ckan/ckan/logic/__init__.py', line 424 in wrapped
  result = _action(context, data_dict, **kw)
File '/Users/<user>/ckan/lib/default/src/ckan/ckan/logic/__init__.py', line 510 in wrapper
  return action(context, data_dict)
File '/Users/<user>/ckan/lib/default/src/ckan/ckan/logic/action/get.py', line 3190 in dashboard_activity_list
  limit=limit, offset=offset)
File '/Users/<user>/ckan/lib/default/src/ckan/ckan/model/activity.py', line 298 in dashboard_activity_list
  q = _dashboard_activity_query(user_id, limit + offset)
File '/Users/<user>/ckan/lib/default/src/ckan/ckan/model/activity.py', line 283 in _dashboard_activity_query
  q1 = _user_activity_query(user_id, limit)
File '/Users/<user>/ckan/lib/default/src/ckan/ckan/model/activity.py', line 126 in _user_activity_query
  return _activities_union_all(q1, q2)
File '/Users/<user>/ckan/lib/default/src/ckan/ckan/model/activity.py', line 96 in _activities_union_all
  return model.Session.query(model.Activity).select_entity_from(
AttributeError: 'Query' object has no attribute 'select_entity_from'

好像和用户最近activity的显示方式有关,但之后就不知道是怎么回事了。常识似乎表明我可以禁用插件,一切都会好起来的,但遗憾的是事实并非如此。即使我与 ini 文件中的 DataPusher 插件断开连接并完全停止服务,此错误仍然存​​在。它有效地破坏了我的整个 ckan 安装,而我能够使事情再次运行的唯一方法是从源代码重新安装 ckan。

第一次发生这种情况似乎是侥幸。我想我的数据库中一定有什么东西已经损坏了,所以我卸载了 ckan,删除了所有 PostgreSQL 数据库,然后从头开始重新安装所有东西。同样的事情发生了。如果有人能够帮助我理解为什么会发生此错误,以及为什么安装 DataPusher 会永久破坏我的 ckan 网站,我将不胜感激。感谢您的协助。

所以问题似乎是使用普通的 ckan 文档从源代码安装导致我走错了路。他们的安装仍然安装了几个错误版本的 SQLAlchemy 相关插件。按照 here 为我解决的说明并消除了这次崩溃。我建议任何维护 ckan 源代码的人检查 SQLAlchemy 0.8 是自动安装的版本,而不是 0.7.8。感谢 Mikko Ohtamaa 的协助。