Hi,
Does anyone have experience about integrating MongoDB as datastore?
I followed this tutorial, GitHub - NaturalHistoryMuseum/ckanext-versioned-datastore: A CKAN extension providing a versioned datastore using MongoDB and Elasticsearch.(https://github.com/NaturalHistoryMuseum/ckanext-versioned-datastore) in order to use MongoDB as datastore.
However, the data seem failed to be ingested into MongoDB but index succesfully ingested into Elasticsearch, and I found an error log on ckan-uwsgi.stderror.log.
2021-03-15 18:43:25,717 ERROR [ckan.config.middleware.flask_app] None - {'message': 'There is no ingested data for this version'}
Traceback (most recent call last):
File "/usr/lib/ckan/default/lib/python3.8/site-packages/flask/app.py", line 1949, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/lib/ckan/default/lib/python3.8/site-packages/flask/app.py", line 1935, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/usr/lib/ckan/default/src/ckanext-versioned-datastore/ckanext/versioned_datastore/routes/datastore.py", line 39, in resource_data
toolkit.get_action('datastore_reindex')({}, {
File "/usr/lib/ckan/default/src/ckan/ckan/logic/__init__.py", line 477, in wrapped
result = _action(context, data_dict, **kw)
File "/usr/lib/ckan/default/src/ckanext-versioned-datastore/ckanext/versioned_datastore/logic/actions/utils.py", line 131, in action_function
return function(**params)
File "/usr/lib/ckan/default/src/ckanext-versioned-datastore/ckanext/versioned_datastore/logic/actions/crud.py", line 131, in datastore_reindex
raise toolkit.ValidationError('There is no ingested data for this version')
ckan.logic.ValidationError: None - {'message': 'There is no ingested data for this version'}
CKAN version 2.9.
Elasticsearch version 6.8.1
MongoDB version 4.4.4
Ckanext-versioned-datastore version 3.0.0
This is my CKAN configuration for ckanext-versioned-datastore,
…
## Database Settings
sqlalchemy.url = postgresql://ckan_default:ckan_default@localhost/ckan_default
ckan.datastore.write_url = postgresql://ckan_default:ckan_default@localhost/datastore_default
ckan.datastore.read_url = postgresql://datastore_default:datastore_default@localhost/datastore_default
ckanext.versioned_datastore.elasticsearch_hosts = localhost
ckanext.versioned_datastore.elasticsearch_port = 9200
ckanext.versioned_datastore.elasticsearch_index_prefix = ckan-
ckanext.versioned_datastore.mongo_host = localhost
ckanext.versioned_datastore.mongo_port = 27017
ckanext.versioned_datastore.mongo_database = ckan-db
ckan.plugins = stats text_view image_view recline_view versioned_datastore datapusher
…
Initialize DB succeeded with ckan command, ckan -c /etc/ckan/default/ckan.ini versioned-datastore initdb (from CKAN2.9 onwards paster command has been replaced with ckan command).
Did I miss some steps?
Thank you very much.
Regards,
Ferdy
Sent from Mail for Windows 10