Solr
  1. Solr
  2. SOLR-3829

Admin UI Logging events broken if schema.xml defines a catch-all dynamicField with type ignored

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.0-BETA
    • Fix Version/s: 4.1
    • Component/s: web gui
    • Labels:
      None

      Description

      The Solr Admin page does not show any log events. There are Javascript errors

      TypeError: doc.logger.esc is not a function
      ... '<abbr title="' + doc.logger.esc() + '">' + doc.logger.split( '.' ).pop().esc()...
      

      This is because the response of the LoggingHandler added unexpected [ ... ] characters around the values for time, level, logger and message:

      ...
      "history":{"numFound":2,"start":0,"docs":[{"time":["2012-09-11T15:07:05.453Z"],"level":["WARNING"],"logger":["org.apache.solr.core.SolrCore"],"message":["New index directory detected: ...
      

      This is caused by the way the JSON is created. org.apache.solr.logging.LogWatcher#toSolrDocument creates a SolrDocument which is then formatted with a org.apache.solr.response.JSONResponseWriter.
      But the JSONResponseWriter uses the index schema to decide how to format the JSON. We have the following field declaration in schema.xml:

          <dynamicField name="*" type="ignored" />
      

      The field type "ignored" has the attribute multiValued set to true. Because of this JSONResponseWriter adds [] characters in org.apache.solr.response.JSONWriter#writeSolrDocument

      The formatting should be independent from schema.xml

      1. SOLR-3829.patch
        0.5 kB
        Stefan Matheis (steffkes)

        Issue Links

          Activity

          Hide
          Stefan Matheis (steffkes) added a comment -

          Hm, that's right .. no idea what happens there?!

          Perhaps Ryan McKinley or Hoss Man could have an look on this?

          I'll attach an (really) quick-fix for the problem .. which should be treated as workaround, but not as solution for the underlying problem

          Show
          Stefan Matheis (steffkes) added a comment - Hm, that's right .. no idea what happens there?! Perhaps Ryan McKinley or Hoss Man could have an look on this? I'll attach an (really) quick-fix for the problem .. which should be treated as workaround, but not as solution for the underlying problem
          Hide
          Hoss Man added a comment -

          I'm not really familiar with this code, but based on the issue description: if LogWatcher has a toSolrDocument method that creates "fake" SolrDocuments based on log messages, that would definitely make the output affected by the schema, which oculd cause all sorts of potential problems when log message property names and schema field names overlap.

          I have no idea why LogWatcher doesn't just output a Map or NamedList for each log message - that seems like it would be much more straight forward.

          Show
          Hoss Man added a comment - I'm not really familiar with this code, but based on the issue description: if LogWatcher has a toSolrDocument method that creates "fake" SolrDocuments based on log messages, that would definitely make the output affected by the schema, which oculd cause all sorts of potential problems when log message property names and schema field names overlap. I have no idea why LogWatcher doesn't just output a Map or NamedList for each log message - that seems like it would be much more straight forward.
          Hide
          Stefan Matheis (steffkes) added a comment -

          If no one objects i'd like to commit my hackish patch, so at least we have it still working. whoever is able to figure that out, no worries to drop out my temporary solution ;>

          Show
          Stefan Matheis (steffkes) added a comment - If no one objects i'd like to commit my hackish patch, so at least we have it still working. whoever is able to figure that out, no worries to drop out my temporary solution ;>
          Hide
          Stefan Matheis (steffkes) added a comment -

          trunk: r1429298
          branch_4x: r1429299

          Show
          Stefan Matheis (steffkes) added a comment - trunk: r1429298 branch_4x: r1429299
          Hide
          Commit Tag Bot added a comment -

          [branch_4x commit] Stefan Matheis
          http://svn.apache.org/viewvc?view=revision&revision=1429299

          SOLR-3829: Admin UI Logging events broken if schema.xml defines a catch-all dynamicField with type ignored (merge r1429298)

          Show
          Commit Tag Bot added a comment - [branch_4x commit] Stefan Matheis http://svn.apache.org/viewvc?view=revision&revision=1429299 SOLR-3829 : Admin UI Logging events broken if schema.xml defines a catch-all dynamicField with type ignored (merge r1429298)
          Hide
          Commit Tag Bot added a comment -

          [trunk commit] Stefan Matheis
          http://svn.apache.org/viewvc?view=revision&revision=1429298

          SOLR-3829: Admin UI Logging events broken if schema.xml defines a catch-all dynamicField with type ignored

          Show
          Commit Tag Bot added a comment - [trunk commit] Stefan Matheis http://svn.apache.org/viewvc?view=revision&revision=1429298 SOLR-3829 : Admin UI Logging events broken if schema.xml defines a catch-all dynamicField with type ignored
          Hide
          Hoss Man added a comment -

          I think this is a good step towards solving what is probably the most common example of this problem – but we should still try to fix the underlying design flaw: i've opened SOLR-4281 so we don't lose track of the problem

          Show
          Hoss Man added a comment - I think this is a good step towards solving what is probably the most common example of this problem – but we should still try to fix the underlying design flaw: i've opened SOLR-4281 so we don't lose track of the problem

            People

            • Assignee:
              Stefan Matheis (steffkes)
              Reporter:
              Andreas Hubold
            • Votes:
              3 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development