Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-16358

Can't create SOLR collection using V2 API

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Invalid
    • 9.0
    • None
    • cli
      • operating system: RHEL
      • java version: 11.0

    Description

      curl --netrc-file ~/.netrc -X POST http://localhost:8983/api/cores -H 'Content-Type: application/json' -d '
        {
          "create": {
            "name": "test_notes",
            "numShards": 1,
            "replicationFactor": 1    }
        }
      '
      

      Produces this error:

      {
        "responseHeader":{
          "status":400,
          "QTime":3},
        "error":{
          "metadata":[
            "error-class","org.apache.solr.common.SolrException",
            "root-error-class","org.apache.solr.core.SolrResourceNotFoundException"],
          "msg":"Error CREATEing SolrCore 'test_notes': Unable to create core [test_notes] Caused by: Can't find resource 'solrconfig.xml' in classpath or '/app/solr/server/solr/test_notes'",
          "code":400}}
      

      I see the same error when I use `config:solrconfig.xml` in the curl call. This is the content of my `solr_home/server/solr` folder.

      ❯ ls ~/solr/server/solr/configsets/
      _default  sample_techproducts_configs
      

      This is the java code that's running solr:

       /app/jdk-11.0.1/bin/java -server -Xms512m -Xmx512m -XX:+UseG1GC -XX:+PerfDisableSharedMem -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=250 -XX:+UseLargePages -XX:+AlwaysPreTouch -XX:+ExplicitGCInvokesConcurrent -Xlog:gc*:file=/home/linuxuser/solr/server/logs/solr_gc.log:time,uptime:filecount=9,filesize=20M -Dsolr.jetty.inetaccess.includes= -Dsolr.jetty.inetaccess.excludes= -Dsolr.log.dir=/home/linuxuser/solr/server/logs -Djetty.port=13745 -DSTOP.PORT=12745 -DSTOP.KEY=solrrocks -Dhost=localhost -Duser.timezone=UTC -XX:-OmitStackTraceInFastThrow -XX:OnOutOfMemoryError=/home/linuxuser/solr/bin/oom_solr.sh 13745 /home/linuxuser/solr/server/logs -Djetty.home=/home/linuxuser/solr/server -Dsolr.solr.home=/app/solr/server/solr/ -Dsolr.data.home= -Dsolr.install.dir=/home/linuxuser/solr -Dsolr.default.confdir=/home/linuxuser/solr/server/solr/configsets/_default/conf -Xss256k -Dsolr.httpclient.builder.factory=org.apache.solr.client.solrj.impl.PreemptiveBasicAuthClientBuilderFactory -Dbasicauth=linuxuser:SolrForCedarU54 -Djava.security.manager -Djava.security.policy=/home/linuxuser/solr/server/etc/security.policy -Djava.security.properties=/home/linuxuser/solr/server/etc/security.properties -Dsolr.internal.network.permission=* -DdisableAdminUI=false -Dsolr.log.muteconsole -jar start.jar --module=http --module=requestlog --module=gzip
      
      

      My questions are:

      a. What am I doing wrong?
      b. Why is Solr trying to find a solrconfig.xml in a directory that it has not yet created (`test_notes`)?
      c. What is this `classpath` Solr is referring to?

      Also, I have symlinked `/app/solr` to `~/solr`. I presume that won't cause a problem?

      Attachments

        1. screenshot-1.png
          665 kB
          sagnik ray choudhury

        Activity

          People

            epugh Eric Pugh
            sagnikrayc sagnik ray choudhury
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: