添加数据集按钮显示来自CKAN的Insernal服务器错误

问题描述 投票:0回答:1

我已经根据以下网址配置了docker-compose ckan。

https://docs.ckan.org/en/2.8/maintaining/installing/install-from-docker-compose.html

添加ckan插件时数据存储没有问题。

ckan.plugins = stats text_view image_view recline_view datastore

但是,当我添加数据推送器并按下添加数据集按钮时,我可以看到以下屏幕。

'内部服务器错误'

ckan.plugins = stats text_view image_view recline_view datastore datapusher

# Define which views should be created by default
# (plugins must be loaded in ckan.plugins)
ckan.views.default_views = image_view text_view recline_view

ckan.datapusher.formats = csv xls xlsx tsv application/csv application/vnd.ms-excel application/vnd.openxmlformats-officedocument.spreadsheetml.sheet

我检查了docker-compose logs ckan命令,它显示了以下输出:

 2019-12-31 01:52:57,225 ERROR [ckan.config.middleware.flask_app] 'NoneType' object has no attribute 'transaction'
ckan          | Traceback (most recent call last):
ckan          |   File "/usr/lib/ckan/venv/local/lib/python2.7/site-packages/flask/app.py", line 1949, in full_dispatch_request
ckan          |     rv = self.dispatch_request()
ckan          |   File "/usr/lib/ckan/venv/local/lib/python2.7/site-packages/flask/app.py", line 1935, in dispatch_request
ckan          |     return self.view_functions[rule.endpoint](**req.view_args)
ckan          |   File "/usr/lib/ckan/venv/local/lib/python2.7/site-packages/flask/views.py", line 89, in view
ckan          |     return self.dispatch_request(*args, **kwargs)
ckan          |   File "/usr/lib/ckan/venv/local/lib/python2.7/site-packages/flask/views.py", line 163, in dispatch_request
ckan          |     return meth(*args, **kwargs)
ckan          |   File "/usr/lib/ckan/venv/src/ckan/ckan/views/resource.py", line 242, in post
ckan          |     get_action(u'resource_create')(context, data)
ckan          |   File "/usr/lib/ckan/venv/src/ckan/ckan/logic/__init__.py", line 469, in wrapped
ckan          |     result = _action(context, data_dict, **kw)
ckan          |   File "/usr/lib/ckan/venv/src/ckan/ckan/logic/action/create.py", line 327, in resource_create
ckan          |     model.repo.commit()
ckan          |   File "/usr/lib/ckan/venv/local/lib/python2.7/site-packages/sqlalchemy/orm/scoping.py", line 162, in do
ckan          |     return getattr(self.registry(), name)(*args, **kwargs)
ckan          |   File "/usr/lib/ckan/venv/local/lib/python2.7/site-packages/sqlalchemy/orm/session.py", line 1027, in commit
ckan          |     self.transaction.commit()
ckan          |   File "/usr/lib/ckan/venv/local/lib/python2.7/site-packages/sqlalchemy/orm/session.py", line 494, in commit
ckan          |     self._prepare_impl()
ckan          |   File "/usr/lib/ckan/venv/local/lib/python2.7/site-packages/sqlalchemy/orm/session.py", line 464, in _prepare_impl
ckan          |     stx = self.session.transaction
ckan          | AttributeError: 'NoneType' object has no attribute 'transaction'
ckan          | 2019-12-31 01:52:57,341 INFO  [ckan.config.middleware.flask_app]  /dataset/testdataset07/resource/new render time 3.881 seconds
ckan          | 2019-12-31 01:52:57,624 INFO  [ckan.config.middleware.flask_app]  /api/i18n/en render time 0.001 seconds
ckan          | db:5432 - accepting connections
ckan          | /usr/lib/ckan/venv/local/lib/python2.7/site-packages/webassets/loaders.py:162: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
ckan          |   obj = self.yaml.load(f) or {}
ckan          | Initialising DB: SUCCESS
ckan          | 2019-12-31 01:53:31,960 INFO  [ckan.config.environment] Loading static files from public
ckan          | /usr/lib/ckan/venv/local/lib/python2.7/site-packages/webassets/loaders.py:162: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
ckan          |   obj = self.yaml.load(f) or {}
ckan          | 2019-12-31 01:53:32,004 INFO  [ckan.config.environment] Loading templates from /usr/lib/ckan/venv/src/ckan/ckan/templates

这是数据推送日志

datapusher    | Deleting "8da3ff38-7c78-45ad-bff0-cd84ee76546e" from datastore.
datapusher    | Determined headers and types: [{'type': u'text', 'id': u'Region'}, {'type': u'text', 'id': u'Country'}, {'type': u'text', 'id': u'Item Type'}, {'type': u'text', 'id': u'Sales Channel'}, {'type': u'text', 'id': u'Order Priority'}, {'type': u'timestamp', 'id': u'Order Date'}, {'type': u'numeric', 'id': u'Order ID'}, {'type': u'timestamp', 'id': u'Ship Date'}, {'type': u'numeric', 'id': u'Units Sold'}, {'type': u'numeric', 'id': u'Unit Price'}, {'type': u'numeric', 'id': u'Unit Cost'}, {'type': u'numeric', 'id': u'Total Revenue'}, {'type': u'numeric', 'id': u'Total Cost'}, {'type': u'numeric', 'id': u'Total Profit'}]
datapusher    | Saving chunk 0
datapusher    | Successfully pushed 100 entries to "8da3ff38-7c78-45ad-bff0-cd84ee76546e".

可以采取哪些步骤来重现此问题?

ckan
1个回答
0
投票

我通过将其更改为稳定版本来解决。

git checkout tags / ckan-2.8.2
© www.soinside.com 2019 - 2024. All rights reserved.