![](/img/trans.png)
[英]CKAN datapusher error 500 datapusher.wsgi cannot be loaded as python module
[英]Uploading files in CKAN but received 'Could not connect to DataPusher' error
我正在嘗試將文件上傳到 CKAN。 但是,我從日志中收到此錯誤:
{'message': 'Could not connect to DataPusher.', 'details': "HTTPConnectionPool(host='localhost', port=8800): Max retries exceeded with url: /job (Caused by NewConnectionError(': Failed to build新連接:[Errno 99] 無法分配請求的地址',))"}
CKAN重試幾次后,終於上傳完成。 我能夠下載我的資源並跟蹤視圖。
我不明白為什么前幾次連接失敗。 我嘗試使用 curl 來測試連接: curl http://localhost:8800
但我收到錯誤:
curl: (56) Recv 失敗:連接由對等方重置。
然后我嘗試修改我的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
, Host 和 Port 也設置為'0.0.0.0'
和8800
。
我讀了這篇文章,但我沒有發現任何與此設置不同的地方。 然后我將ckan.ini
主機從localhost
命名空間更改為實際的127.0.0.1
,並在 CKAN docker 容器中重新啟動 apache 服務,但它仍然返回
無法連接到 Datapusher
我嘗試上傳文件,但以不同的錯誤號結尾,如下所示:
{'message': 'Could not connect to DataPusher.', 'details': "HTTPConnectionPool(host='127.0.0.1', port=8800): 最大重試次數超過 url: /job (Caused by NewConnectionError(': Failed)建立新連接:[Errno 111] 連接被拒絕',))"}
令人驚訝的是,在CKAN中重試連接幾次后,我能夠查看資源文件並下載它。 我很困惑,因為我幾個月來都在使用相同的設置,而且我還沒有更新任何配置,而且這個問題最近才開始出現。
我找到了一種手動解決開發問題的方法。 該問題是由機器上未運行的 datapusher 引起的。 我手動啟動了datapusher
python datapusher/main.py deployment/datapusher_settings.py
datapusher 運行無中斷后,ckan 可以再次連接到datapusher。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.