我試圖在我的MacBook Pro上運行OS X 10.10.3,在Homebrew的幫助下構建ckan(v2.3)數據門戶。雖然我不得不對官方文檔進行小小的調整,以便從源代碼工作中進行安裝,但我已經能夠使用Solr和Tomcat運行它,並且無需安裝DataStore和FileStore組件。我可以使用系統管理員帳戶上傳文件並再次下載,而不會出現任何問題。在Mac上安裝DataPusher後ckan網站的不可逆,可重現的崩潰
問題是,當我嘗試安裝DataPusher以嘗試確保用戶上傳的數據自動放入DataStore中時。繼位於here指南中的「開發」部分導致一些非常奇怪的事情發生。
首先,雖然在我的設置資料儲存庫安裝「端口」變量設置爲默認值(8800)並沒有什麼阻止它在端口8800,實際的服務似乎堅持跑步通過港口8000.我不認爲這應該影響任何事情,但爲了記錄所有奇怪的行爲,我將它留在這裏。其次,只要我將ckan安裝的DataPusher url指向正確的端口,並在ckan的development.ini文件中啓用該應用程序及其所有默認設置,我的ckan安裝就會立即變得完全不可用。前頁面顯示正常,但每一次我嘗試登錄或註冊,因爲我得到這個回溯任何用戶(長度道歉):
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'
這似乎是與用戶最近的活動顯示方式有關,但之後我不知道發生了什麼。常識似乎決定我可以禁用插件,事情會再次好起來,但可悲的是,情況並非如此。即使我從ini文件中的DataPusher插件斷開並完全停止服務,該錯誤仍然存在。它有效地破壞了我的整個ckan安裝,而且我能夠重新開始工作的唯一方法就是再次從源代碼安裝ckan。
這是第一次發生這似乎是一種僥倖。我發現在我的數據庫中必須損壞某些東西,所以我卸載了ckan,刪除了所有的PostgreSQL數據庫,並重新安裝了一個乾淨的版本。同樣的事情發生了。如果任何人能夠幫助我理解爲什麼會出現這種錯誤,並且更廣泛地說明爲什麼安裝DataPusher會永久破壞我的ckan網站,我將非常感激。感謝你的協助。
你可以檢查你的SQLAlchemy版本嗎?看起來'select_entity_from'是在SQLAlchemy 0.8中添加的:http://docs.sqlalchemy.org/en/rel_1_0/orm/query.html#sqlalchemy.orm.query.Query.select_entity_from –
好奇,pip似乎給了我0.7 0.8。我會嘗試更新它。 – ochrence
用點數升級到0.8。沒有這樣的運氣;我有同樣的錯誤。不過謝謝您的幫助。 – ochrence