Solr
  1. Solr
  2. SOLR-6182

Using rest manager endpoint to create a new (yet unused) managed resource results in corrupt file, solr can't restart

    Details

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

      Description

      The ref guide documents that...

      You can also create new managed resource using PUT/POST to the appropriate URL – before ever configuring anything that uses these resources.

      ...however attempting to do this results in the creation of "_rest_managed.json" file that is not in the format expected by solr, and prevents solr from starting up.

        Activity

        Hide
        ASF subversion and git services added a comment -

        Commit 1604085 from Timothy Potter in branch 'dev/trunk'
        [ https://svn.apache.org/r1604085 ]

        SOLR-6182: add to change list for 4.9 release

        Show
        ASF subversion and git services added a comment - Commit 1604085 from Timothy Potter in branch 'dev/trunk' [ https://svn.apache.org/r1604085 ] SOLR-6182 : add to change list for 4.9 release
        Hide
        ASF subversion and git services added a comment -

        Commit 1604084 from Timothy Potter in branch 'dev/branches/branch_4x'
        [ https://svn.apache.org/r1604084 ]

        SOLR-6182: add to change list for 4.9 release

        Show
        ASF subversion and git services added a comment - Commit 1604084 from Timothy Potter in branch 'dev/branches/branch_4x' [ https://svn.apache.org/r1604084 ] SOLR-6182 : add to change list for 4.9 release
        Hide
        ASF subversion and git services added a comment -

        Commit 1604083 from Timothy Potter in branch 'dev/branches/lucene_solr_4_9'
        [ https://svn.apache.org/r1604083 ]

        SOLR-6182: correctly cast managedData as a List<Object> when loading stored RestManager data; solution verified with manual testing only as the unit tests use in-memory storage so will need to re-work the backing store to test this behavior in the unit test; backport to 4.9 branch

        Show
        ASF subversion and git services added a comment - Commit 1604083 from Timothy Potter in branch 'dev/branches/lucene_solr_4_9' [ https://svn.apache.org/r1604083 ] SOLR-6182 : correctly cast managedData as a List<Object> when loading stored RestManager data; solution verified with manual testing only as the unit tests use in-memory storage so will need to re-work the backing store to test this behavior in the unit test; backport to 4.9 branch
        Hide
        ASF subversion and git services added a comment -

        Commit 1604080 from Timothy Potter in branch 'dev/branches/branch_4x'
        [ https://svn.apache.org/r1604080 ]

        SOLR-6182: correctly cast managedData as a List<Object> when loading stored RestManager data; solution verified with manual testing only as the unit tests use in-memory storage so will need to re-work the backing store to test this behavior in the unit test; backport to branch_4x

        Show
        ASF subversion and git services added a comment - Commit 1604080 from Timothy Potter in branch 'dev/branches/branch_4x' [ https://svn.apache.org/r1604080 ] SOLR-6182 : correctly cast managedData as a List<Object> when loading stored RestManager data; solution verified with manual testing only as the unit tests use in-memory storage so will need to re-work the backing store to test this behavior in the unit test; backport to branch_4x
        Hide
        ASF subversion and git services added a comment -

        Commit 1604078 from Timothy Potter in branch 'dev/trunk'
        [ https://svn.apache.org/r1604078 ]

        SOLR-6182: correctly cast managedData as a List<Object> when loading stored RestManager data; solution verified with manual testing only as the unit tests use in-memory storage so will need to re-work the backing store to test this behavior in the unit test.

        Show
        ASF subversion and git services added a comment - Commit 1604078 from Timothy Potter in branch 'dev/trunk' [ https://svn.apache.org/r1604078 ] SOLR-6182 : correctly cast managedData as a List<Object> when loading stored RestManager data; solution verified with manual testing only as the unit tests use in-memory storage so will need to re-work the backing store to test this behavior in the unit test.
        Hide
        Timothy Potter added a comment -

        cooking up the fix now ... should be ready in about 30 minutes

        Show
        Timothy Potter added a comment - cooking up the fix now ... should be ready in about 30 minutes
        Hide
        Robert Muir added a comment -

        Can you pls keep me up to date? I will wait till i hear back from you. We can also just spin an RC tomorrow if you don't have time tonight.

        Show
        Robert Muir added a comment - Can you pls keep me up to date? I will wait till i hear back from you. We can also just spin an RC tomorrow if you don't have time tonight.
        Hide
        Timothy Potter added a comment -

        Well that's .... embarrassing Will get it resolved this evening so it can hopefully make it into 4.9

        Show
        Timothy Potter added a comment - Well that's .... embarrassing Will get it resolved this evening so it can hopefully make it into 4.9
        Hide
        Hoss Man added a comment -

        Steps to reproduce:

        • launch solr 4.8 with the example configs (java -jar start.jar)
        • execute the following curl command (taken verbatim from the ref guide)
          curl -X PUT -H 'Content-type:application/json' --data-binary '{"class":"org.apache.solr.rest.schema.analysis.ManagedWordSetResource"}' "http://localhost:8983/solr/collection1/schema/analysis/stopwords/german"
          
        • shutdown solr (Ctrl-C)
        • restart solr (java -jar start.jar)

        Error message preventing collection1 from starting...

        2726 [coreLoadExecutor-5-thread-1] ERROR org.apache.solr.core.CoreContainer  – Unable to create core: collection1
        org.apache.solr.common.SolrException: java.util.ArrayList cannot be cast to java.util.Map
        	at org.apache.solr.core.SolrCore.<init>(SolrCore.java:868)
        	at org.apache.solr.core.SolrCore.<init>(SolrCore.java:643)
        	at org.apache.solr.core.CoreContainer.create(CoreContainer.java:556)
        	at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:261)
        	at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:253)
        	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: java.lang.ClassCastException: java.util.ArrayList cannot be cast to java.util.Map
        	at org.apache.solr.rest.RestManager$RestManagerManagedResource.onManagedDataLoadedFromStorage(RestManager.java:457)
        	at org.apache.solr.rest.ManagedResource.reloadFromStorage(ManagedResource.java:230)
        	at org.apache.solr.rest.ManagedResource.loadManagedDataAndNotify(ManagedResource.java:86)
        	at org.apache.solr.rest.RestManager.init(RestManager.java:589)
        	at org.apache.solr.core.SolrCore.initRestManager(SolrCore.java:2351)
        	at org.apache.solr.core.SolrCore.<init>(SolrCore.java:847)
        	... 10 more
        

        The contents of the solr/collection1/conf/_rest_managed.json file that was created by Solr when the curl command was executed...

        {
          "initArgs":{},
          "initializedOn":"2014-06-19T19:57:11.889Z",
          "managedList":[{
              "resourceId":"/schema/analysis/stopwords/german",
              "class":"org.apache.solr.rest.schema.analysis.ManagedWordSetResource",
              "numObservers":"0"}]}
        
        Show
        Hoss Man added a comment - Steps to reproduce: launch solr 4.8 with the example configs (java -jar start.jar) execute the following curl command (taken verbatim from the ref guide) curl -X PUT -H 'Content-type:application/json' --data-binary '{ "class" : "org.apache.solr. rest .schema.analysis.ManagedWordSetResource" }' "http: //localhost:8983/solr/collection1/schema/analysis/stopwords/german" shutdown solr (Ctrl-C) restart solr (java -jar start.jar) Error message preventing collection1 from starting... 2726 [coreLoadExecutor-5-thread-1] ERROR org.apache.solr.core.CoreContainer – Unable to create core: collection1 org.apache.solr.common.SolrException: java.util.ArrayList cannot be cast to java.util.Map at org.apache.solr.core.SolrCore.<init>(SolrCore.java:868) at org.apache.solr.core.SolrCore.<init>(SolrCore.java:643) at org.apache.solr.core.CoreContainer.create(CoreContainer.java:556) at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:261) at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:253) 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: java.lang.ClassCastException: java.util.ArrayList cannot be cast to java.util.Map at org.apache.solr.rest.RestManager$RestManagerManagedResource.onManagedDataLoadedFromStorage(RestManager.java:457) at org.apache.solr.rest.ManagedResource.reloadFromStorage(ManagedResource.java:230) at org.apache.solr.rest.ManagedResource.loadManagedDataAndNotify(ManagedResource.java:86) at org.apache.solr.rest.RestManager.init(RestManager.java:589) at org.apache.solr.core.SolrCore.initRestManager(SolrCore.java:2351) at org.apache.solr.core.SolrCore.<init>(SolrCore.java:847) ... 10 more The contents of the solr/collection1/conf/_rest_managed.json file that was created by Solr when the curl command was executed... { "initArgs" :{}, "initializedOn" : "2014-06-19T19:57:11.889Z" , "managedList" :[{ "resourceId" : "/schema/analysis/stopwords/german" , "class" : "org.apache.solr. rest .schema.analysis.ManagedWordSetResource" , "numObservers" : "0" }]}

          People

          • Assignee:
            Timothy Potter
            Reporter:
            Hoss Man
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development