【问题标题】:Uploading files in CKAN but received 'Could not connect to DataPusher' error在 CKAN 中上传文件但收到“无法连接到 DataPusher”错误
【发布时间】:2020-07-03 16:56:18
【问题描述】:

我正在尝试将文件上传到 CKAN。但是,我从日志中收到了这个错误:

{'message': 'Could not connect to DataPusher.', 'details': "HTTPConnectionPool(host='localhost', port=8800): url: /job 超过最大重试次数(由 NewConnectionError(':无法建立新连接:[Errno 99] 无法分配请求的地址',))"}

CKAN重试几次后,终于上传完成了。我能够下载我的资源并跟踪视图。

我不明白为什么前几次连接失败。我尝试使用 curl 来测试连接:curl http://localhost:8800 但我收到了错误:

curl: (56) Recv failure: Connection reset by peer.

然后我尝试修改我的ckan.ini,现在设置指定如下:

ckan.plugins = datastore datapusher
ckan.datapusher.url = http://localhost:8800

同样在 datapusher.conf 中,我的主机设置为0.0.0.0,端口设置为8800:

Listen 8800
<VirtualHost 0.0.0.0:8800>
    ServerName ${CKAN_SERVER_NAME}
    ServerAlias www.${CKAN_SERVER_NAME}

    <Directory "${DATAPUSHER_CONFIG}">
      Require all granted
    </Directory>

    WSGIScriptAlias / ${DATAPUSHER_CONFIG}/datapusher.wsgi
    WSGIPassAuthorization On

    ErrorLog /var/log/apache2/datapusher.error.log
    CustomLog /var/log/apache2/datapusher.custom.log combined

    <IfModule mod_headers.c>
      Header set X-UA-Compatible "IE=edge"
    </IfModule>
</VirtualHost>

在datapusher_settings.py 中,主机和端口也设置为'0.0.0.0' 和8800。

我阅读了this 的帖子,但没有发现任何与此设置不同的地方。然后我将ckan.ini中的主机从localhost名称空间更改为实际的127.0.0.1,并在CKAN docker容器中重新启动apache服务,但它仍然返回

无法连接到数据推送器

我尝试上传文件,但以不同的错误编号结束,如下所示:

{'message': 'Could not connect to DataPusher.', 'details': "HTTPConnectionPool(host='127.0.0.1', port=8800): url: /job 超过最大重试次数(由 NewConnectionError( ': 建立新连接失败:[Errno 111] Connection refused',))"}

令人惊讶的是,在 CKAN 中重试几次连接后,我能够查看资源文件并下载它。我很困惑,因为我几个月都在使用相同的设置,而且我没有更新任何配置,而且这个问题最近才开始出现。

【问题讨论】:

    标签: python apache networking urllib ckan


    【解决方案1】:

    我找到了一种手动解决问题以进行开发的方法。该问题是由于数据推送器未在机器上运行引起的。我通过

    手动启动了 datapusher

    python datapusher/main.py deployment/datapusher_settings.py

    datapusher不间断运行后,ckan可以再次连接datapusher。

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-05-19
    • 2021-05-23
    • 2021-12-04
    • 2018-07-06
    • 2013-06-08
    • 1970-01-01
    相关资源
    最近更新 更多