首页 > 解决方案 > CKAN Datastore Create 不起作用,action/datastore_create 说“内部错误”

问题描述

来自 API 的“http://MY_CKAN_URL//api/3/action/datastore_create”返回此错误:

{
"help": "http://MY_CKAN_URL/api/3/action/help_show?name=datastore_create",
"success": false,
"error": {
"message": "Internal Server Error",
"__type": "Internal Server Error"
}
}

我已经在 Docker 中安装了 CKAN,我也遇到了同样的错误,这就是我在 ckan_default.error.log 中的内容:

[wsgi:error] [pid 20:tid 140290595436288] [remote 127.0.0.1:50840] [SQL: 'CREATETRIGGER zfulltext\n BEFORE INSERT OR UPDATE ON "c8ad5ab0-da25-4935-8619-167ea686a1cf"\n FOR EACH ROW EXECUTE PROCEDURE populate_full_text_trigger()']

这里面的error.log:[core:notice] [pid 18:tid 140290744224704] AH00094:命令行:'/usr/sbin/apache2 -D FOREGROUND'

在 Datapusher 中:JobError: CKAN DataStore 响应错误。状态码:500 内部服务器错误。在:http://MY_CKAN_URL/api/3/action/datastore_create。响应:{u'error': {u'__type': u'Internal Server Error', u'message': u'Internal Server Error'},

u'help': u'http://MY_CKAN_URL/api/3/action/help_show?name=datastore_create', u'success': False}

此外,我也有这个错误:

AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 10.0.4.222. Set the 'ServerName' directive globally to suppress this message

标签: ckan

解决方案


编辑 /etc/ckan/default/production.ini ckan.site_url = http://ckan28.local

在 Postgres 数据库中: sudo -u postgres createuser -S -D -R -P -l datastore_default 输入新角色的密码 sudo -u postgres createdb -O ckan_default datastore_default -E utf-8

使用 sudo -u postgres psql -l 你应该有这个: Name Owner datastore_default ckan_default

编辑:sudo nano /etc/ckan/default/production.ini

ckan.datastore.write_url = postgresql://ckan_default:ckan_default@localhost/datastore_default ckan.datastore.read_url = postgresql://datastore_default:datastore_default@localhost/datastore_default

有了这个它应该可以正常工作。


推荐阅读