CKAN 收割机插件在 "paster harvester initdb" 失败?

CKAN harvester plugin fails at "paster harvester initdb"?

我正在尝试在 CentOS 6.7 / Python 2.6.6 / CKAN 2.5.0a 上安装 harvester 插件 (https://github.com/ckan/ckanext-harvest) 并且一切正常很好,直到我执行以下操作:

paster --plugin=ckanext-harvest harvest initdb --config=/etc/ckan/default/production.ini

然后我收到以下错误消息:

Traceback (most recent call last):
  File "/usr/lib/ckan/default/bin/paster", line 9, in <module>
    load_entry_point('PasteScript==1.7.5', 'console_scripts', 'paster')()
  File "/usr/lib/ckan/default/lib/python2.6/site-packages/paste/script/command.py", line 104, in run
    invoke(command, command_name, options, args[1:])
  File "/usr/lib/ckan/default/lib/python2.6/site-packages/paste/script/command.py", line 143, in invoke
    exit_code = runner.run(args)
  File "/usr/lib/ckan/default/lib/python2.6/site-packages/paste/script/command.py", line 238, in run
    result = self.command()
  File "/usr/lib/ckan/default/src/ckanext-harvest/ckanext/harvest/commands/harvester.py", line 129, in command
    self._load_config()
  File "/usr/lib/ckan/default/src/ckanext-harvest/ckanext/harvest/commands/harvester.py", line 199, in _load_config
    super(Harvester, self)._load_config()
  File "/usr/lib/ckan/default/src/ckan/ckan/lib/cli.py", line 147, in _load_config
    load_environment(conf.global_conf, conf.local_conf)
  File "/usr/lib/ckan/default/src/ckan/ckan/config/environment.py", line 232, in load_environment
    p.load_all(config)
  File "/usr/lib/ckan/default/src/ckan/ckan/plugins/core.py", line 124, in load_all
    unload_all()
  File "/usr/lib/ckan/default/src/ckan/ckan/plugins/core.py", line 181, in unload_all
    unload(*reversed(_PLUGINS))
  File "/usr/lib/ckan/default/src/ckan/ckan/plugins/core.py", line 209, in unload
    plugins_update()
  File "/usr/lib/ckan/default/src/ckan/ckan/plugins/core.py", line 116, in plugins_update
    environment.update_config()
  File "/usr/lib/ckan/default/src/ckan/ckan/config/environment.py", line 316, in update_config
    search.check_solr_schema_version()
  File "/usr/lib/ckan/default/src/ckan/ckan/lib/search/__init__.py", line 291, in check_solr_schema_version
    res = urllib2.urlopen(req)
  File "/usr/lib64/python2.6/urllib2.py", line 126, in urlopen
    return _opener.open(url, data, timeout)
  File "/usr/lib64/python2.6/urllib2.py", line 397, in open
    response = meth(req, response)
  File "/usr/lib64/python2.6/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib64/python2.6/urllib2.py", line 429, in error
    result = self._call_chain(*args)
  File "/usr/lib64/python2.6/urllib2.py", line 369, in _call_chain
    result = func(*args)
  File "/usr/lib64/python2.6/urllib2.py", line 616, in http_error_302
    return self.parent.open(new, timeout=req.timeout)
  File "/usr/lib64/python2.6/urllib2.py", line 397, in open
    response = meth(req, response)
  File "/usr/lib64/python2.6/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib64/python2.6/urllib2.py", line 435, in error
    return self._call_chain(*args)
  File "/usr/lib64/python2.6/urllib2.py", line 369, in _call_chain
    result = func(*args)
  File "/usr/lib64/python2.6/urllib2.py", line 518, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 401: Unauthorized

感谢任何帮助(如果可用,我什至可以使用 SQL 创建 table 的文本作为解决方法)。

此致,

我确实设置了 http_proxyhttps_proxy 环境变量以执行此步骤:

pip install -e git+https://github.com/ckan/ckanext-harvest.git#egg=ckanext-harvest

然而,在代理已经启用的情况下,当粘贴脚本查找 127.0.0.1 (SOLR) 时,它也在使用代理... 我只需要取消设置 http_proxy 和 https_proxy 变量 然后 运行 paster 命令没有问题:

    unset http_proxy
    unset https_proxy

    paster --plugin=ckanext-harvest harvester initdb --config=/etc/ckan/default/production.ini

    2016-03-16 14:33:45,918 DEBUG [ckanext.harvest.model] Harvest tables defined in memory
    2016-03-16 14:33:46,177 DEBUG [ckanext.harvest.model] Harvest tables created
    DB tables created