[
https://issues.apache.org/jira/browse/SOLR-16678?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Jason Gerlowski resolved SOLR-16678.
------------------------------------
Fix Version/s: main (10.0)
9.3
Assignee: Jason Gerlowski
Resolution: Fixed
Alex is right, this looks to be a syntax error on the reporters part. The
issue description here shows a JSON property called "property.lib.path", when
the v2 syntax instead calls for a sub-object with the key "properties", with
"lib.path" underneath it.
e.g.
{code}
{
...
"properties": {
"lib.path": "/my/lib/path"
}
}
{code}
Additionally, thanks for the test-case [~stillalex]! I've backported this to
branch_9x, so I'll close this ticket out.
(Lastly, it looks like Julien set up some sort of OOO or
"direct-all-questions-to" auto response. A bit spammy here, but I didn't know
that was possible in JIRA - neat!)
> Collection API v2 CREATE does not handle user-defined properties
> ----------------------------------------------------------------
>
> Key: SOLR-16678
> URL: https://issues.apache.org/jira/browse/SOLR-16678
> Project: Solr
> Issue Type: Bug
> Components: v2 API
> Affects Versions: 9.1
> Reporter: Julien Massiera
> Assignee: Jason Gerlowski
> Priority: Major
> Fix For: main (10.0), 9.3
>
> Time Spent: 40m
> Remaining Estimate: 0h
>
> According to this documentation
> [https://solr.apache.org/guide/solr/latest/configuration-guide/property-substitution.html],
> we should be able with the Collection API v2 CREATE, to define custom core
> properties and use them in the solrconfig.xml file
> This is not working properly as, for example, if I try to define a "lib.path"
> property that I use in the solrconfig.xml of my collection, I get the
> following error:
> {code:java}
> curl -XPOST http://localhost:8983/api/collections -H 'Content-Type:
> application/json' -d '{"create": {"name": "MyCollection", "config": "Init",
> "numShards": 2, "replicationFactor":1, "property.lib.path":"/my/lib/path"}}'
> {
> "responseHeader":{
> "status":400,
> "QTime":738},
> "failure":{
>
> "127.0.0.1:8983_solr":"org.apache.solr.client.solrj.impl.BaseHttpSolrClient$RemoteSolrException:Error
> from server at null: Error CREATEing SolrCore
> 'MyCollection_shard1_replica_n3': Unable to create core
> [MyCollection_shard1_replica_n3] Caused by: No system property or default
> value specified for lib.path value:${lib.path}/Custom",
>
> "127.0.0.1:8983_solr":"org.apache.solr.client.solrj.impl.BaseHttpSolrClient$RemoteSolrException:Error
> from server at null: Error CREATEing SolrCore
> 'MyCollection_shard2_replica_n1': Unable to create core
> [MyCollection_shard2_replica_n1] Caused by: No system property or default
> value specified for lib.path value:${lib.path}/Custom"},
> "Operation create caused
> exception:":"org.apache.solr.common.SolrException:org.apache.solr.common.SolrException:
> Underlying core creation failed while creating collection: MyCollection",
> "exception":{
> "msg":"Underlying core creation failed while creating collection:
> MyCollection",
> "rspCode":400},
> "error":{
> "metadata":[
> "error-class","org.apache.solr.common.SolrException",
> "root-error-class","org.apache.solr.common.SolrException"],
> "msg":"Underlying core creation failed while creating collection:
> MyCollection",
> "code":400}}{code}
>
> Doing the same with the Collection API v1 properly works:
> {code:java}
> curl -XGET
> "http://localhost:8983/solr/admin/collections?action=CREATE&name=MyCollection&collection.configName=Init&numShards=2&maxShardsPerNode=2&replicationFactor=1&property.lib.path=/my/lib/path"
> {
> "responseHeader":{
> "status":0,
> "QTime":1419},
> "success":{
> "127.0.0.1:8983_solr":{
> "responseHeader":{
> "status":0,
> "QTime":1062},
> "core":"MyCollection_shard1_replica_n3"},
> "127.0.0.1:8983_solr":{
> "responseHeader":{
> "status":0,
> "QTime":1062},
> "core":"MyCollection_shard2_replica_n1"}}} {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]