Uploaded image for project: 'Apache Storm'
  1. Apache Storm
  2. STORM-3631

Wrong format of logs.users/groups in topology conf can cause supervisor/logviewer to terminate

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0, 2.1.0
    • Fix Version/s: 2.2.0
    • Component/s: None
    • Labels:
      None

      Description

      If users submit a topology with logs.users set as a single string, it will cause ClassCastException and cause Supervisor to terminate

      2020-04-28 19:33:59.901 o.a.s.d.s.Slot SLOT_6707 [ERROR] Error when processing event
      java.lang.ClassCastException: java.lang.String cannot be cast to java.util.List
              at org.apache.storm.daemon.supervisor.Container.writeLogMetadata(Container.java:)
      

      Can be easily reproduced by

      storm jar storm-starter.jar org.apache.storm.starter.WordCountTopology wc -c logs.users=[null, "fake-groups"] 
      

      If users submit with logs.users set with a list with null member, for example, logs.users='[null, "fake-2-users"]', it will cause NullPointerException and cause logviewer to terminate

      Caused by: java.lang.NullPointerException
              at org.apache.storm.utils.ObjectReader.getStrings(ObjectReader.java:)
              at org.apache.storm.daemon.logviewer.utils.ResourceAuthorizer.getLogUserGroupWhitelist(ResourceAuthorizer.java)
      

      Can be easily reproduced by

      storm jar storm-starter.jar org.apache.storm.starter.WordCountTopology wc -c logs.users="fake-users"
      

      Ideally logs.users and logs.groups should be daemon config only and we should have something like topology.logs.users and topology.logs.groups for topology level config sit in Config.java (so it can be validated by ConfigValidation). Because now there two configs are in DaemonConfig, it wont' be validated against "@isStringList" rule when it is from topo conf.

      But even with the rule, it doesn't validate when logs.users include a null member in the list.

      For backwards compatibility, we have to fix these configs instead of removing them from topo conf (by adding topology.logs.users).

        Attachments

          Activity

            People

            • Assignee:
              ethanli Ethan Li
              Reporter:
              ethanli Ethan Li
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 10m
                10m