Solr
  1. Solr
  2. SOLR-6647

Bad error message when missing resource from ZK when parsing Schema

    Details

      Description

      Creating a collection via Collection API. Schema points to a file which is not in our config folder in ZooKeeper. Getting the infamous error message ZkSolrResourceLoader does not support getConfigDir() instead of the more helpful message about which resource is missing.

      1. SOLR-6647.patch
        3 kB
        Jan Høydahl
      2. SOLR-6647.patch
        2 kB
        Jan Høydahl

        Issue Links

          Activity

          Hide
          Jan Høydahl added a comment -

          Attaching patch against trunk which prints the resource path relative to ZK root if in ZK mode.

          Show
          Jan Høydahl added a comment - Attaching patch against trunk which prints the resource path relative to ZK root if in ZK mode.
          Hide
          Alan Woodward added a comment -

          There are a couple of places where we have this (x instanceof ZkSolrResourceLoader) check now - maybe we should either a) support getConfigDir() in ZkSolrResourceLoader or b) replace it with something else that makes more sense?

          Show
          Alan Woodward added a comment - There are a couple of places where we have this (x instanceof ZkSolrResourceLoader) check now - maybe we should either a) support getConfigDir() in ZkSolrResourceLoader or b) replace it with something else that makes more sense?
          Hide
          Jan Høydahl added a comment - - edited

          New patch using new static method CloudUtil#unifiedResourcePath(loader). This will return the getCollectionZkPath if in ZK mode.

          I think it is dangerous to support getConfigDir in ZK loader, as the typical error is to assume that this method returns a valid File-system path, which we can never do from ZK.

          And I think we should create another JIRA to handle all other places where there is unsafe usage of getConfigDir. I have spotted a few already...

          Show
          Jan Høydahl added a comment - - edited New patch using new static method CloudUtil#unifiedResourcePath(loader) . This will return the getCollectionZkPath if in ZK mode. I think it is dangerous to support getConfigDir in ZK loader, as the typical error is to assume that this method returns a valid File-system path, which we can never do from ZK. And I think we should create another JIRA to handle all other places where there is unsafe usage of getConfigDir. I have spotted a few already...
          Hide
          Alan Woodward added a comment -

          +1 to both!

          Show
          Alan Woodward added a comment - +1 to both!
          Hide
          ASF subversion and git services added a comment -

          Commit 1633969 from janhoy@apache.org in branch 'dev/trunk'
          [ https://svn.apache.org/r1633969 ]

          SOLR-6647: Bad error message when missing resource from ZK when parsing Schema

          Show
          ASF subversion and git services added a comment - Commit 1633969 from janhoy@apache.org in branch 'dev/trunk' [ https://svn.apache.org/r1633969 ] SOLR-6647 : Bad error message when missing resource from ZK when parsing Schema
          Hide
          ASF subversion and git services added a comment -

          Commit 1633970 from janhoy@apache.org in branch 'dev/branches/branch_5x'
          [ https://svn.apache.org/r1633970 ]

          SOLR-6647: Bad error message when missing resource from ZK when parsing Schema (backport)

          Show
          ASF subversion and git services added a comment - Commit 1633970 from janhoy@apache.org in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1633970 ] SOLR-6647 : Bad error message when missing resource from ZK when parsing Schema (backport)
          Hide
          ASF subversion and git services added a comment -

          Commit 1634015 from janhoy@apache.org in branch 'dev/branches/lucene_solr_4_10'
          [ https://svn.apache.org/r1634015 ]

          SOLR-6647: Bad error message when missing resource from ZK when parsing Schema (backport)

          Show
          ASF subversion and git services added a comment - Commit 1634015 from janhoy@apache.org in branch 'dev/branches/lucene_solr_4_10' [ https://svn.apache.org/r1634015 ] SOLR-6647 : Bad error message when missing resource from ZK when parsing Schema (backport)
          Hide
          Jan Høydahl added a comment -

          Closing. Followup with further improvements in SOLR-6649

          Show
          Jan Høydahl added a comment - Closing. Followup with further improvements in SOLR-6649

            People

            • Assignee:
              Jan Høydahl
              Reporter:
              Jan Høydahl
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development