Solr
  1. Solr
  2. SOLR-6158

Solr looks up configSets in the wrong directory

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.8, 4.8.1
    • Fix Version/s: 4.9
    • Component/s: None
    • Labels:
      None

      Description

      I tried the small tutorial on http://heliosearch.org/solr-4-8-features/ to create "Named Config Sets" based on the Solr example shipped with Solr 4.8.1 (like it's done in the tutorial, same problem with 4.8.0).
      Creating a new core with a configSet seems to work (directory 'books' and 'books/core.properties' are created correctly).

      But loading the new core does not work:

      67446 [qtp25155085-11] INFO  org.apache.solr.handler.admin.CoreAdminHandler  core create command configSet=generic&name=books&action=CREATE
      67452 [qtp25155085-11] ERROR org.apache.solr.core.CoreContainer  Unable to create core: books
      org.apache.solr.common.SolrException: Could not load configuration from directory C:\dev\solr-4.8.1\example\configsets\generic
              at org.apache.solr.core.ConfigSetService$Default.locateInstanceDir(ConfigSetService.java:145)
              at org.apache.solr.core.ConfigSetService$Default.createCoreResourceLoader(ConfigSetService.java:130)
              at org.apache.solr.core.ConfigSetService.getConfig(ConfigSetService.java:58)
              at org.apache.solr.core.CoreContainer.create(CoreContainer.java:554)
              ...
      

      It seems like Solr looks up the config sets in the wrong directory:
      C:\dev\solr-4.8.1\example\configsets\generic (in the log above) instead of
      C:\dev\solr-4.8.1\example\solr\configsets\generic (like stated in the tutorial and the documentation on https://cwiki.apache.org/confluence/display/solr/Config+Sets)

      Moving the configsets directory one level up (into 'example') will work.
      But as of the documentation (and the tutorial) it should be located in the solr home directory.

      In case I'm completely wrong and everythings works as expected, how can the configsets directory be configured?
      The documentation on https://cwiki.apache.org/confluence/display/solr/Config+Sets mentions a "configurable configset base directory", but I can't find any information on the web.

      Another thing: If it would work as I expect, the references <lib dir="../../../contrib/extraction/lib" regex=".*\.jar" /> etc. in solr-4.8.1/example/solr/configsets/generic/conf/solrconfig.xml should get one more "../" added, I guess (missing in the tutorial).

      1. SOLR-6158.patch
        3 kB
        Alan Woodward

        Issue Links

          Activity

          Simon Endele created issue -
          Simon Endele made changes -
          Field Original Value New Value
          Link This issue relates to SOLR-4478 [ SOLR-4478 ]
          Simon Endele made changes -
          Description I tried the small tutorial on http://heliosearch.org/solr-4-8-features/ to create "Named Config Sets" based on the Solr example shipped with Solr 4.8.1 (like it's done in the tutorial, same problem with 4.8.0).
          Creating a new core with a configSet seems to work (directory 'books' and 'books/core.properties' are created correctly).

          But loading the new core does not work:
          {code:none}67446 [qtp25155085-11] INFO org.apache.solr.handler.admin.CoreAdminHandler core create command configSet=generic&name=books&action=CREATE
          67452 [qtp25155085-11] ERROR org.apache.solr.core.CoreContainer Unable to create core: books
          org.apache.solr.common.SolrException: Could not load configuration from directory C:\dev\solr-4.8.1\example\configsets\generic
                  at org.apache.solr.core.ConfigSetService$Default.locateInstanceDir(ConfigSetService.java:145)
                  at org.apache.solr.core.ConfigSetService$Default.createCoreResourceLoader(ConfigSetService.java:130)
                  at org.apache.solr.core.ConfigSetService.getConfig(ConfigSetService.java:58)
                  at org.apache.solr.core.CoreContainer.create(CoreContainer.java:554)
                  ...
          {code}

          It seems like Solr looks up the config sets in the wrong directory:
          C:\dev\solr-4.8.1\example\configsets\generic (in the log above) instead of
          C:\dev\solr-4.8.1\example\solr\configsets\generic (like stated in the tutorial and the documentation on https://cwiki.apache.org/confluence/display/solr/Config+Sets)

          Moving the configsets directory one level up (into 'example') will work.
          But as of the documentation (and the tutorial) it should be located in the solr home directory.

          In case I'm completely wrong and everythings works as expected, how can one configure the configsets directory be configured?
          The documentation on https://cwiki.apache.org/confluence/display/solr/Config+Sets mentions a "configurable configset base directory", but I can't find any information on the web.

          Another thing: If it would work as I expect, the references <lib dir="../../../contrib/extraction/lib" regex=".*\.jar" /> etc. in solr-4.8.1/example/solr/configsets/generic/conf/solrconfig.xml should get one more "../" added, I guess (missing in the tutorial).
          I tried the small tutorial on http://heliosearch.org/solr-4-8-features/ to create "Named Config Sets" based on the Solr example shipped with Solr 4.8.1 (like it's done in the tutorial, same problem with 4.8.0).
          Creating a new core with a configSet seems to work (directory 'books' and 'books/core.properties' are created correctly).

          But loading the new core does not work:
          {code:none}67446 [qtp25155085-11] INFO org.apache.solr.handler.admin.CoreAdminHandler core create command configSet=generic&name=books&action=CREATE
          67452 [qtp25155085-11] ERROR org.apache.solr.core.CoreContainer Unable to create core: books
          org.apache.solr.common.SolrException: Could not load configuration from directory C:\dev\solr-4.8.1\example\configsets\generic
                  at org.apache.solr.core.ConfigSetService$Default.locateInstanceDir(ConfigSetService.java:145)
                  at org.apache.solr.core.ConfigSetService$Default.createCoreResourceLoader(ConfigSetService.java:130)
                  at org.apache.solr.core.ConfigSetService.getConfig(ConfigSetService.java:58)
                  at org.apache.solr.core.CoreContainer.create(CoreContainer.java:554)
                  ...
          {code}

          It seems like Solr looks up the config sets in the wrong directory:
          C:\dev\solr-4.8.1\example\configsets\generic (in the log above) instead of
          C:\dev\solr-4.8.1\example\solr\configsets\generic (like stated in the tutorial and the documentation on https://cwiki.apache.org/confluence/display/solr/Config+Sets)

          Moving the configsets directory one level up (into 'example') will work.
          But as of the documentation (and the tutorial) it should be located in the solr home directory.

          In case I'm completely wrong and everythings works as expected, how can the configsets directory be configured?
          The documentation on https://cwiki.apache.org/confluence/display/solr/Config+Sets mentions a "configurable configset base directory", but I can't find any information on the web.

          Another thing: If it would work as I expect, the references <lib dir="../../../contrib/extraction/lib" regex=".*\.jar" /> etc. in solr-4.8.1/example/solr/configsets/generic/conf/solrconfig.xml should get one more "../" added, I guess (missing in the tutorial).
          Alan Woodward made changes -
          Assignee Alan Woodward [ romseygeek ]
          Hide
          Alan Woodward added a comment -

          Ah, looks like if the configSetBaseDir isn't specified it defaults to ```configsets``` underneath the CWD, rather than under solr home. Should be an easy fix.

          As a workaround, you can set ```configSetBaseDir``` in solr.xml, see https://cwiki.apache.org/confluence/display/solr/Format+of+solr.xml.

          Show
          Alan Woodward added a comment - Ah, looks like if the configSetBaseDir isn't specified it defaults to ```configsets``` underneath the CWD, rather than under solr home. Should be an easy fix. As a workaround, you can set ```configSetBaseDir``` in solr.xml, see https://cwiki.apache.org/confluence/display/solr/Format+of+solr.xml .
          Hide
          Alan Woodward added a comment -

          Fix, with a couple of tests.

          Show
          Alan Woodward added a comment - Fix, with a couple of tests.
          Alan Woodward made changes -
          Attachment SOLR-6158.patch [ 12649635 ]
          Hide
          ASF subversion and git services added a comment -

          Commit 1601758 from Alan Woodward in branch 'dev/trunk'
          [ https://svn.apache.org/r1601758 ]

          SOLR-6158: Fix configSetBaseDir path resolution

          Show
          ASF subversion and git services added a comment - Commit 1601758 from Alan Woodward in branch 'dev/trunk' [ https://svn.apache.org/r1601758 ] SOLR-6158 : Fix configSetBaseDir path resolution
          Hide
          ASF subversion and git services added a comment -

          Commit 1601759 from Alan Woodward in branch 'dev/branches/branch_4x'
          [ https://svn.apache.org/r1601759 ]

          SOLR-6158: Fix configSetBaseDir path resolution

          Show
          ASF subversion and git services added a comment - Commit 1601759 from Alan Woodward in branch 'dev/branches/branch_4x' [ https://svn.apache.org/r1601759 ] SOLR-6158 : Fix configSetBaseDir path resolution
          Hide
          Alan Woodward added a comment -

          Thanks for reporting, Simon!

          Show
          Alan Woodward added a comment - Thanks for reporting, Simon!
          Alan Woodward made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Hide
          Simon Endele added a comment -

          No problem. Thanks a lot for the quick response and the fix!

          Show
          Simon Endele added a comment - No problem. Thanks a lot for the quick response and the fix!
          Hide
          Simon Endele added a comment -

          For all who may stumble upon this: Your solr.xml should look like this (for the example project):

          <solr>
            <str name="configSetBaseDir">${configSetBaseDir:solr/configsets}</str>
            ...
          </solr>
          
          Show
          Simon Endele added a comment - For all who may stumble upon this: Your solr.xml should look like this (for the example project): <solr> <str name= "configSetBaseDir" > ${configSetBaseDir:solr/configsets} </str> ... </solr>
          Alan Woodward made changes -
          Fix Version/s 4.9 [ 12326731 ]
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Resolved Resolved
          4h 5m 1 Alan Woodward 10/Jun/14 19:55

            People

            • Assignee:
              Alan Woodward
              Reporter:
              Simon Endele
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development