go-solr
go-solr copied to clipboard
Panic on interface convertion
interface conversion: interface {} is nil, not map[string]interface {}:
panic(0x2423640, 0xc0168b8930)
C:/Go/src/runtime/panic.go:513 +0x1c7
github.com/vanng822/go-solr/solr.(*StandardResultParser).Parse(0x3410718, 0xc07f1360e0, 0x6, 0xc015d9cf38, 0xc07f1360e0)
C:/Users/Margaryta/GoSrc/src/bitbucket.org/repustate/repustate-go/src/github.com/vanng822/go-solr/solr/parser.go:130 +0x6a5
github.com/vanng822/go-solr/solr.(*Search).Result(0xc032187710, 0x0, 0x0, 0x0, 0x1, 0xc04ed9c0b0)
C:/Users/Margaryta/GoSrc/src/bitbucket.org/repustate/repustate-go/src/github.com/vanng822/go-solr/solr/search.go:72 +0xbe
Happens when Solr fails to load core to execute solr.Search , in such cases Solr instance returns error object like :
"error":{
"metadata":[
"error-class","org.apache.solr.core.SolrCoreInitializationException",
"root-error-class","org.apache.solr.common.SolrException"],
"msg":"SolrCore 'clientindices' is not available due to init failure: Could not load configuration from directory /var/solr/data/configsets/_default",
"trace":"org.apache.solr.core.SolrCoreInitializationException: SolrCore 'clientindices' is not available due to init failure: Could not load configuration from directory /var/solr/data/configsets/_default\n\tat org.apache.solr.core.CoreContainer.getCore(CoreContainer.java:1593)\n\tat org.apache.solr.servlet.HttpSolrCall.init(HttpSolrCall.java:249)\n\tat .
...
org.apache.solr.servlet.HttpSolrCall.handleAdmin(HttpSolrCall.java:734)\n\tat org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:496)\n\t... 36 more\n",
"code":500}}
@gwan284 Just came across this same issue. Find a solution?
@chadwcarlson workarounded by checking core status via STATUS command before executing search.
@gwan284 Is this something that can be done using SolrInterface or it requires a CoreAdmin?
It requires CoreAdmin (see STATUS command):
https://lucene.apache.org/solr/guide/6_6/coreadmin-api.html
If your client might not have such access level, just fork this lib and fix locally, because this repo seems to be not maintained any longer.
Sorry for not responding It sounds like you need a better release process and monitoring tool to make sure things are up and running.