pysolr
pysolr copied to clipboard
pysolr.SolrError: ('Unknown collection: %s", collectionname)
i am trying to use the pysolr api and i am getting this strange error my solr instance is in cloud mode with zookeeper running and i can even see the collection name inside the solr admin browser can anyone help with that ? solr version running is 5.5.3 with zookeeper 3.4.6 on ubuntu server 16.01 with anaconda 3 and python 3
I just pushed ac421dc9ea8f8ed47ab2924f083159b11cc31000 which will at least fix that error message to show the name it expected to find. Do you know which collection name was being passed in and/or have a reproducible test case for this?
@acdha sorry for the late reply , i just modified my pysolr.py as well and it still wont find the collection , i added a line to print self.collections which prints "{}" meaning no collections exist for solr is this normal ? i am sure the collection is created i can see it on my solr admin menu and i can see all my nodes are alive also yes i know the collection name its trying to add data to and i tried 2 different collections which i can see in my solr admin view that they exist however they still cant be seen by pysolr
You can change pysolr.ZooKeeper.CLUSTER_STATE = '/collections/{collection_name}/state.json'
according to your collection. Then it'll work. Because solr stop managing cluster states in clusterstate.json
That looks like a bit of a refactor since https://github.com/django-haystack/pysolr/blob/f8489464902edb111f0684cf820401e5baa7234a/pysolr.py#L1279 assumes that the cluster state URL can be known in advance and now it'll need to change when the collection changes.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This is still an issue for me
@chadgh Yes - if you want to contribute a pull request I’m sure it’d be appreciated by the other users
@acdha Maybe I will.
For reference it looks like since version 6.3.0 SolrCloud doesn't update the clusterstate.json anymore. http://lucene.472066.n3.nabble.com/clusterstate-json-not-updated-in-zookeeper-after-creating-the-collection-using-API-td4328845.html
I've got a working version of pysolr tweaked a bit after I found that out. I'll do some more testing and submit a PR.
hi @chadgh , any news on this ?
@parisni, Sorry, not really.
I've made a few changes to the pysolr file to get things working with solr cloud 7.3. I have not tested it against other versions of solr and am in the middle of getting things to work for my specific problem.
I have no timeline on when I'll be able to get a solution submitted that is tested and compatible with other versions of solr.
@chadgh thanks for the answer.
From my side the @uzayr method worked. That's fairly simple. (solr 7.6)
@acdha I've run into this as well and would like to contribute a PR. Can you reopen and assign to me please?
Hi, I think I encountered similar issue. My specific use-case is integration testing. It looks like I have this error if I create new instance of pysolr.ZooKeeper
too early (maybe service itself is not fully initialized?) For me sleep(5)
solves this problem, but I hate that.
btw, @rokclimb15 how is progress?