ckan / example-add-dataset

Example script that uses the CKAN API to create a dataset and upload some files to it
3 stars 9 forks source link

Running this against a 2.3 installation is failing with solr error #2

Open Analect opened 9 years ago

Analect commented 9 years ago

@amercader I know this example is slightly dated, but it's useful to test the new resource view formats. I upgraded from a 2.2 to a 2.3 installation ... I'm using the ckan/ckan-docker implementation and ended up having to copy across the 2.3 schema manually to the solr container ... Any idea why I'm getting this "multiple values encountered for non multiValued field", when the API is being used to push multiple files at once?

Thanks.

python add_example_datasets.py Creating "Data viewer examples" package Creating "Example GEOJSON file" resource Creating "Example JPG file" resource Error while creating resource: {"help": "http://127.0.0.1/api/3/action/help_show?name=resource_create", "success": false, "error": {"message": "Unable to add package to search index: Solr returned an error: 400 Bad Request - <?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\n<lst name=\"responseHeader\"><int name=\"status\">400<int name=\"QTime\">1<lst name=\"error\"><str name=\"msg\">ERROR: [doc=16243cb72e616125ec9797151b9b1c2c] multiple values encountered for non multiValued field res_name: [Example GEOJSON file, Example JPG file]<int name=\"code\">400\n\n", "__type": "Search Index Error"}}

amercader commented 9 years ago

@Analect I don't think this is related to pushing multiple files at once, it's the error you get if you are trying to index a new dataset from a CKAN 2.3 instance to Solr running the 2.2 schema. So I guess that the problem is that the solr image didn't have an updated schema file.

Analect commented 9 years ago

@amercader Thanks for the info. I restored a 2.2 database using ckan-docker with a v2.2 branch of ckan and solr schema ver 2.0. I then moved to the 2.3 branch in the ckan container and ran through a database upgrade to ver 76 (from 71). I then restarted the ckan-docker suite of containers on the default 2.3 setup, with version 2.3 in the solr schema. It seems my usage of: 'paster search-index rebuild -r -c /etc/ckan/default/ckan.ini' works in terms of getting restored datasets visible on ckan, but this is somehow not getting persisted on solr in the ckan-docker set-up. It seems references to restarting jetty or tomcat in the docs aren't really applicable to a set-up that has been split-out and containerized. I've had problems restoring / upgrading databases and getting things working in general, documented here: https://github.com/ckan/ckan-docker/issues/16 https://github.com/ckan/ckan-docker/issues/17

I'd love to get these resolved so I can document for others hoping to go down the docker approach ... but where existing docs are generally not capturing that type of install. Thanks.