Solr
  1. Solr
  2. SOLR-5814

CoreContainer reports incorrect & missleading path for solrconfig.xml when there are loading problems

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.10.1, 5.0, 6.0
    • Component/s: None
    • Labels:
      None

      Description

      The error messages thrown by CoreContainer when there is a problem loading solrconfig.xml refer to the wrong path (leaves out "conf/").

      This is missleading users (who may not notice the root cause) into thinking they need to move their solrconfig.xml from collection_name/conf/solrconfig.xml to collection_name/solrconfig.xml at which point they still get the same error message because solr still can't find the file in the conf dir

      1. SOLR-5814.patch
        4 kB
        Hoss Man
      2. SOLR-5814.patch
        2 kB
        Pradeep

        Activity

        Hide
        Hoss Man added a comment -

        As an example, i did this...

        hossman@frisbee:~/lucene/4x_dev/solr/example$ echo "giberish" > solr/collection1/conf/solrconfig.xml
        

        And then started solr and got this...

        1450 [main] INFO  org.apache.solr.core.CoresLocator  – Looking for core definitions underneath /home/hossman/lucene/4x_dev/solr/example/solr
        1457 [main] INFO  org.apache.solr.core.CoresLocator  – Found core collection1 in /home/hossman/lucene/4x_dev/solr/example/solr/collection1/
        1467 [main] INFO  org.apache.solr.core.CoresLocator  – Found 1 core definitions
        1470 [coreLoadExecutor-4-thread-1] INFO  org.apache.solr.core.CoreContainer  – Creating SolrCore 'collection1' using instanceDir: /home/hossman/lucene/4x_dev/solr/example/solr/collection1
        1470 [coreLoadExecutor-4-thread-1] INFO  org.apache.solr.core.SolrResourceLoader  – new SolrResourceLoader for directory: '/home/hossman/lucene/4x_dev/solr/example/solr/collection1/'
        1568 [coreLoadExecutor-4-thread-1] ERROR org.apache.solr.core.Config  – Exception during parsing file: solrconfig.xml:org.xml.sax.SAXParseException; systemId: solrres:/solrconfig.xml; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.
        	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198)
        	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177)
        	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:441)
        	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:368)
        	at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1436)
        	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:999)
        	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)
        ...
        	at org.apache.solr.core.Config.<init>(Config.java:134)
        	at org.apache.solr.core.Config.<init>(Config.java:86)
        	at org.apache.solr.core.SolrConfig.<init>(SolrConfig.java:140)
        	at org.apache.solr.core.CoreContainer.createFromLocal(CoreContainer.java:527)
        	at org.apache.solr.core.CoreContainer.create(CoreContainer.java:597)
        	at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:258)
        	at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:250)
        	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        	at java.lang.Thread.run(Thread.java:744)
        
        1570 [coreLoadExecutor-4-thread-1] ERROR org.apache.solr.core.CoreContainer  – Failed to load file /home/hossman/lucene/4x_dev/solr/example/solr/collection1/solrconfig.xml
        1570 [coreLoadExecutor-4-thread-1] ERROR org.apache.solr.core.CoreContainer  – Unable to create core: collection1
        org.apache.solr.common.SolrException: Could not load config file /home/hossman/lucene/4x_dev/solr/example/solr/collection1/solrconfig.xml
        	at org.apache.solr.core.CoreContainer.createFromLocal(CoreContainer.java:530)
        	at org.apache.solr.core.CoreContainer.create(CoreContainer.java:597)
        	at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:258)
        	at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:250)
        	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        	at java.lang.Thread.run(Thread.java:744)
        Caused by: org.apache.solr.common.SolrException: org.xml.sax.SAXParseException; systemId: solrres:/solrconfig.xml; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.
        	at org.apache.solr.core.Config.<init>(Config.java:148)
        	at org.apache.solr.core.Config.<init>(Config.java:86)
        	at org.apache.solr.core.SolrConfig.<init>(SolrConfig.java:140)
        	at org.apache.solr.core.CoreContainer.createFromLocal(CoreContainer.java:527)
        	... 9 more
        Caused by: org.xml.sax.SAXParseException; systemId: solrres:/solrconfig.xml; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.
        	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198)
        ...
        

        Note in particular the line that says: 1570 [coreLoadExecutor-4-thread-1] ERROR org.apache.solr.core.CoreContainer – Failed to load file /home/hossman/lucene/4x_dev/solr/example/solr/collection1/solrconfig.xml

        which is also what was front and center when i tried to load the admin UI in the browser.

        If i then stop solr and naively attempt to "fix" the problem...

        hossman@frisbee:~/lucene/4x_dev/solr/example$ mv solr/collection1/conf/solrconfig.xml solr/collection1/solrconfig.xml
        

        Restarting solr gives an even less helpful variant of the same basic error (because there is no longer any useful root cause - the file really can't be found, just not in the place the main error says solr is looking) ...

        1497 [main] INFO  org.apache.solr.core.CoresLocator  – Found core collection1 in /home/hossman/lucene/4x_dev/solr/example/solr/collection1/
        1498 [main] INFO  org.apache.solr.core.CoresLocator  – Found 1 core definitions
        1500 [coreLoadExecutor-4-thread-1] INFO  org.apache.solr.core.CoreContainer  – Creating SolrCore 'collection1' using instanceDir: /home/hossman/lucene/4x_dev/solr/example/solr/collection1
        1500 [coreLoadExecutor-4-thread-1] INFO  org.apache.solr.core.SolrResourceLoader  – new SolrResourceLoader for directory: '/home/hossman/lucene/4x_dev/solr/example/solr/collection1/'
        1512 [coreLoadExecutor-4-thread-1] ERROR org.apache.solr.core.CoreContainer  – Failed to load file /home/hossman/lucene/4x_dev/solr/example/solr/collection1/solrconfig.xml
        1514 [coreLoadExecutor-4-thread-1] ERROR org.apache.solr.core.CoreContainer  – Unable to create core: collection1
        org.apache.solr.common.SolrException: Could not load config file /home/hossman/lucene/4x_dev/solr/example/solr/collection1/solrconfig.xml
        	at org.apache.solr.core.CoreContainer.createFromLocal(CoreContainer.java:530)
        	at org.apache.solr.core.CoreContainer.create(CoreContainer.java:597)
        	at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:258)
        ...
        Caused by: java.io.IOException: Can't find resource 'solrconfig.xml' in classpath or '/home/hossman/lucene/4x_dev/solr/example/solr/collection1/conf'
        	at org.apache.solr.core.SolrResourceLoader.openResource(SolrResourceLoader.java:342)
        	at org.apache.solr.core.SolrResourceLoader.openConfig(SolrResourceLoader.java:288)
        	at org.apache.solr.core.Config.<init>(Config.java:116)
        	at org.apache.solr.core.Config.<init>(Config.java:86)
        	at org.apache.solr.core.SolrConfig.<init>(SolrConfig.java:140)
        	at org.apache.solr.core.CoreContainer.createFromLocal(CoreContainer.java:527)
        	... 9 more
        1517 [coreLoadExecutor-4-thread-1] ERROR org.apache.solr.core.CoreContainer  – null:org.apache.solr.common.SolrException: Unable to create core: collection1
        	at org.apache.solr.core.CoreContainer.recordAndThrow(CoreContainer.java:989)
        	at org.apache.solr.core.CoreContainer.create(CoreContainer.java:606)
        	at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:258)
        	at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:250)
        	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        
        Show
        Hoss Man added a comment - As an example, i did this... hossman@frisbee:~/lucene/4x_dev/solr/example$ echo "giberish" > solr/collection1/conf/solrconfig.xml And then started solr and got this... 1450 [main] INFO org.apache.solr.core.CoresLocator – Looking for core definitions underneath /home/hossman/lucene/4x_dev/solr/example/solr 1457 [main] INFO org.apache.solr.core.CoresLocator – Found core collection1 in /home/hossman/lucene/4x_dev/solr/example/solr/collection1/ 1467 [main] INFO org.apache.solr.core.CoresLocator – Found 1 core definitions 1470 [coreLoadExecutor-4-thread-1] INFO org.apache.solr.core.CoreContainer – Creating SolrCore 'collection1' using instanceDir: /home/hossman/lucene/4x_dev/solr/example/solr/collection1 1470 [coreLoadExecutor-4-thread-1] INFO org.apache.solr.core.SolrResourceLoader – new SolrResourceLoader for directory: '/home/hossman/lucene/4x_dev/solr/example/solr/collection1/' 1568 [coreLoadExecutor-4-thread-1] ERROR org.apache.solr.core.Config – Exception during parsing file: solrconfig.xml:org.xml.sax.SAXParseException; systemId: solrres:/solrconfig.xml; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog. at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198) at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:441) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:368) at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1436) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:999) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606) ... at org.apache.solr.core.Config.<init>(Config.java:134) at org.apache.solr.core.Config.<init>(Config.java:86) at org.apache.solr.core.SolrConfig.<init>(SolrConfig.java:140) at org.apache.solr.core.CoreContainer.createFromLocal(CoreContainer.java:527) at org.apache.solr.core.CoreContainer.create(CoreContainer.java:597) at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:258) at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:250) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:744) 1570 [coreLoadExecutor-4-thread-1] ERROR org.apache.solr.core.CoreContainer – Failed to load file /home/hossman/lucene/4x_dev/solr/example/solr/collection1/solrconfig.xml 1570 [coreLoadExecutor-4-thread-1] ERROR org.apache.solr.core.CoreContainer – Unable to create core: collection1 org.apache.solr.common.SolrException: Could not load config file /home/hossman/lucene/4x_dev/solr/example/solr/collection1/solrconfig.xml at org.apache.solr.core.CoreContainer.createFromLocal(CoreContainer.java:530) at org.apache.solr.core.CoreContainer.create(CoreContainer.java:597) at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:258) at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:250) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:744) Caused by: org.apache.solr.common.SolrException: org.xml.sax.SAXParseException; systemId: solrres:/solrconfig.xml; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog. at org.apache.solr.core.Config.<init>(Config.java:148) at org.apache.solr.core.Config.<init>(Config.java:86) at org.apache.solr.core.SolrConfig.<init>(SolrConfig.java:140) at org.apache.solr.core.CoreContainer.createFromLocal(CoreContainer.java:527) ... 9 more Caused by: org.xml.sax.SAXParseException; systemId: solrres:/solrconfig.xml; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog. at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198) ... Note in particular the line that says: 1570 [coreLoadExecutor-4-thread-1] ERROR org.apache.solr.core.CoreContainer – Failed to load file /home/hossman/lucene/4x_dev/solr/example/solr/collection1/solrconfig.xml which is also what was front and center when i tried to load the admin UI in the browser. If i then stop solr and naively attempt to "fix" the problem... hossman@frisbee:~/lucene/4x_dev/solr/example$ mv solr/collection1/conf/solrconfig.xml solr/collection1/solrconfig.xml Restarting solr gives an even less helpful variant of the same basic error (because there is no longer any useful root cause - the file really can't be found, just not in the place the main error says solr is looking) ... 1497 [main] INFO org.apache.solr.core.CoresLocator – Found core collection1 in /home/hossman/lucene/4x_dev/solr/example/solr/collection1/ 1498 [main] INFO org.apache.solr.core.CoresLocator – Found 1 core definitions 1500 [coreLoadExecutor-4-thread-1] INFO org.apache.solr.core.CoreContainer – Creating SolrCore 'collection1' using instanceDir: /home/hossman/lucene/4x_dev/solr/example/solr/collection1 1500 [coreLoadExecutor-4-thread-1] INFO org.apache.solr.core.SolrResourceLoader – new SolrResourceLoader for directory: '/home/hossman/lucene/4x_dev/solr/example/solr/collection1/' 1512 [coreLoadExecutor-4-thread-1] ERROR org.apache.solr.core.CoreContainer – Failed to load file /home/hossman/lucene/4x_dev/solr/example/solr/collection1/solrconfig.xml 1514 [coreLoadExecutor-4-thread-1] ERROR org.apache.solr.core.CoreContainer – Unable to create core: collection1 org.apache.solr.common.SolrException: Could not load config file /home/hossman/lucene/4x_dev/solr/example/solr/collection1/solrconfig.xml at org.apache.solr.core.CoreContainer.createFromLocal(CoreContainer.java:530) at org.apache.solr.core.CoreContainer.create(CoreContainer.java:597) at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:258) ... Caused by: java.io.IOException: Can't find resource 'solrconfig.xml' in classpath or '/home/hossman/lucene/4x_dev/solr/example/solr/collection1/conf' at org.apache.solr.core.SolrResourceLoader.openResource(SolrResourceLoader.java:342) at org.apache.solr.core.SolrResourceLoader.openConfig(SolrResourceLoader.java:288) at org.apache.solr.core.Config.<init>(Config.java:116) at org.apache.solr.core.Config.<init>(Config.java:86) at org.apache.solr.core.SolrConfig.<init>(SolrConfig.java:140) at org.apache.solr.core.CoreContainer.createFromLocal(CoreContainer.java:527) ... 9 more 1517 [coreLoadExecutor-4-thread-1] ERROR org.apache.solr.core.CoreContainer – null:org.apache.solr.common.SolrException: Unable to create core: collection1 at org.apache.solr.core.CoreContainer.recordAndThrow(CoreContainer.java:989) at org.apache.solr.core.CoreContainer.create(CoreContainer.java:606) at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:258) at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:250) at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        Hide
        Pradeep added a comment -

        correct, I also noticed this when I was upgraded to 4.7 and I had a spelling mistake in schema.xml property.

        Show
        Pradeep added a comment - correct, I also noticed this when I was upgraded to 4.7 and I had a spelling mistake in schema.xml property.
        Hide
        Pradeep added a comment -

        Similarly, if there is any mistake in schema.xml file, error does not show /conf in the path either. I was working on this issue, yesterday and thought to add a patch.

        Show
        Pradeep added a comment - Similarly, if there is any mistake in schema.xml file, error does not show /conf in the path either. I was working on this issue, yesterday and thought to add a patch.
        Hide
        Shawn Heisey added a comment - - edited

        Hoss Man, this came up on the mailing list today. I confirmed that it's still a problem in 4.9.0 by screwing up my solrconfig.xml file.

        Show
        Shawn Heisey added a comment - - edited Hoss Man , this came up on the mailing list today. I confirmed that it's still a problem in 4.9.0 by screwing up my solrconfig.xml file.
        Hide
        Hoss Man added a comment -

        updated patch to trunk - some code moved around a bit.

        this also fixes TestLazyCores which had a test for the error condition (yeah!) but was asserting that the bad path was in the error message (booo!)

        running more tests and then i'll commit & backport.

        Show
        Hoss Man added a comment - updated patch to trunk - some code moved around a bit. this also fixes TestLazyCores which had a test for the error condition (yeah!) but was asserting that the bad path was in the error message (booo!) running more tests and then i'll commit & backport.
        Hide
        ASF subversion and git services added a comment -

        Commit 1622569 from hossman@apache.org in branch 'dev/trunk'
        [ https://svn.apache.org/r1622569 ]

        SOLR-5814: CoreContainer reports incorrect & missleading path for solrconfig.xml when there are loading problems

        Show
        ASF subversion and git services added a comment - Commit 1622569 from hossman@apache.org in branch 'dev/trunk' [ https://svn.apache.org/r1622569 ] SOLR-5814 : CoreContainer reports incorrect & missleading path for solrconfig.xml when there are loading problems
        Hide
        ASF subversion and git services added a comment -

        Commit 1622573 from hossman@apache.org in branch 'dev/branches/branch_4x'
        [ https://svn.apache.org/r1622573 ]

        SOLR-5814: CoreContainer reports incorrect & missleading path for solrconfig.xml when there are loading problems (merge r1622569)

        Show
        ASF subversion and git services added a comment - Commit 1622573 from hossman@apache.org in branch 'dev/branches/branch_4x' [ https://svn.apache.org/r1622573 ] SOLR-5814 : CoreContainer reports incorrect & missleading path for solrconfig.xml when there are loading problems (merge r1622569)
        Hide
        Hoss Man added a comment -

        i could have sworn i resolved this a few days ago

        Show
        Hoss Man added a comment - i could have sworn i resolved this a few days ago
        Hide
        ASF subversion and git services added a comment -

        Commit 1624082 from hossman@apache.org in branch 'dev/branches/lucene_solr_4_10'
        [ https://svn.apache.org/r1624082 ]

        SOLR-5814: CoreContainer reports incorrect & missleading path for solrconfig.xml when there are loading problems (merge r1622569)

        Show
        ASF subversion and git services added a comment - Commit 1624082 from hossman@apache.org in branch 'dev/branches/lucene_solr_4_10' [ https://svn.apache.org/r1624082 ] SOLR-5814 : CoreContainer reports incorrect & missleading path for solrconfig.xml when there are loading problems (merge r1622569)
        Hide
        Anshum Gupta added a comment -

        Bulk close after 5.0 release.

        Show
        Anshum Gupta added a comment - Bulk close after 5.0 release.

          People

          • Assignee:
            Hoss Man
            Reporter:
            Hoss Man
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development