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

core discovery can fail w/NPE and no explanation if a non-readable directory exists

    Details

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

      Centos 6.4
      tomcat6

      Description

      Core discovery doesn't behave well if it encounters a directory it can't read. We should either make core discover log & ignore directories such as this, or improve the error message in such a situation if we think it should be fatale.

      steps to reproduce...

      hossman@frisbee:~/lucene/4x_dev/solr/example$ mkdir solr/NO_READ
      hossman@frisbee:~/lucene/4x_dev/solr/example$ chmod a-r solr/NO_READ/
      hossman@frisbee:~/lucene/4x_dev/solr/example$ java -jar start.jar 
      ...
      1434 [main] ERROR org.apache.solr.servlet.SolrDispatchFilter  – Could not start Solr. Check solr/home property and the logs
      1452 [main] ERROR org.apache.solr.core.SolrCore  – null:java.lang.NullPointerException
      	at org.apache.solr.core.CorePropertiesLocator.discoverUnder(CorePropertiesLocator.java:131)
      	at org.apache.solr.core.CorePropertiesLocator.discoverUnder(CorePropertiesLocator.java:140)
      	at org.apache.solr.core.CorePropertiesLocator.discover(CorePropertiesLocator.java:123)
      	at org.apache.solr.core.CoreContainer.load(CoreContainer.java:240)
      
      "original bug report"

      Hello.

      When in solr/home directory exists directory to which solr do not have rights, then solr failed to start with exception

      2108 [main] INFO org.apache.solr.core.CoresLocator - Looking for core definitions underneath /var/lib/solr
      2109 [main] ERROR org.apache.solr.servlet.SolrDispatchFilter - Could not start Solr. Check solr/home property and the logs
      2138 [main] ERROR org.apache.solr.core.SolrCore - null:java.lang.NullPointerException
              at org.apache.solr.core.CorePropertiesLocator.discoverUnder(CorePropertiesLocator.java:121)
              at org.apache.solr.core.CorePropertiesLocator.discoverUnder(CorePropertiesLocator.java:130)
              at org.apache.solr.core.CorePropertiesLocator.discover(CorePropertiesLocator.java:113)
              at org.apache.solr.core.CoreContainer.load(CoreContainer.java:226)
              at org.apache.solr.servlet.SolrDispatchFilter.createCoreContainer(SolrDispatchFilter.java:177)
              at org.apache.solr.servlet.SolrDispatchFilter.init(SolrDispatchFilter.java:127)
              at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:295)
              at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:422)
              at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:115)
              at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3838)
              at org.apache.catalina.core.StandardContext.start(StandardContext.java:4488)
              at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
              at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
              at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:526)
              at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:637)
              at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:563)
              at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:498)
              at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277)
              at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321)
              at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
              at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
              at org.apache.catalina.core.StandardHost.start(StandardHost.java:722)
              at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
              at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
              at org.apache.catalina.core.StandardService.start(StandardService.java:516)
              at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
              at org.apache.catalina.startup.Catalina.start(Catalina.java:593)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:616)
              at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
              at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
      
      2138 [main] INFO org.apache.solr.servlet.SolrDispatchFilter - SolrDispatchFilter.init() done
      

      For example:
      solr home located on /var/lib/solr
      /var/lib/solr is another file system, it has lost+found directory.
      As result solr can't to star.

      Yours faithfully.

        Attachments

        1. SOLR-5322.patch
          6 kB
          Erick Erickson
        2. SOLR-5322.patch
          7 kB
          Erick Erickson
        3. SOLR-5322.patch
          8 kB
          Erick Erickson

          Activity

            People

            • Assignee:
              erickerickson Erick Erickson
              Reporter:
              said Said Chavkin
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: