Ethan Li created STORM-3631:
-------------------------------

             Summary: Wrong format of logs.users/groups in topology conf can 
cause supervisor/logviewer to terminate
                 Key: STORM-3631
                 URL: https://issues.apache.org/jira/browse/STORM-3631
             Project: Apache Storm
          Issue Type: Bug
            Reporter: Ethan Li
            Assignee: Ethan Li


If users submit a topology with logs.users set as a single string, it will 
cause ClassCastException and cause Supervisor to terminate
{code:java}
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:)
{code}

Can be easily reproduced by 

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


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

{code:java}
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)
{code}

Can be easily reproduced by 

{code:java}
storm jar storm-starter.jar org.apache.storm.starter.WordCountTopology wc -c 
logs.users="fake-users"
{code}


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).




--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to