You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-issues@hadoop.apache.org by "Todd Lipcon (Created) (JIRA)" <ji...@apache.org> on 2012/02/16 00:04:04 UTC

[jira] [Created] (HDFS-2956) calling fetchdt without a --renewer argument throws NPE

calling fetchdt without a --renewer argument throws NPE
-------------------------------------------------------

                 Key: HDFS-2956
                 URL: https://issues.apache.org/jira/browse/HDFS-2956
             Project: Hadoop HDFS
          Issue Type: Bug
          Components: security
    Affects Versions: 0.24.0
            Reporter: Todd Lipcon


If I call "bin/hdfs fetchdt /tmp/mytoken" without a "--renewer foo" argument, then it will throw a NullPointerException:

Exception in thread "main" java.lang.NullPointerException
        at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolTranslatorPB.getDelegationToken(ClientNamenodeProtocolTranslatorPB.java:830)

this is because getDelegationToken is being called with a null renewer

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HDFS-2956) calling fetchdt without a --renewer argument throws NPE

Posted by "Aaron T. Myers (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-2956?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13278396#comment-13278396 ] 

Aaron T. Myers commented on HDFS-2956:
--------------------------------------

Hey Daryn, any update here? I just bumped into this myself.
                
> calling fetchdt without a --renewer argument throws NPE
> -------------------------------------------------------
>
>                 Key: HDFS-2956
>                 URL: https://issues.apache.org/jira/browse/HDFS-2956
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: security
>    Affects Versions: 0.24.0
>            Reporter: Todd Lipcon
>
> If I call "bin/hdfs fetchdt /tmp/mytoken" without a "--renewer foo" argument, then it will throw a NullPointerException:
> Exception in thread "main" java.lang.NullPointerException
>         at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolTranslatorPB.getDelegationToken(ClientNamenodeProtocolTranslatorPB.java:830)
> this is because getDelegationToken is being called with a null renewer

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HDFS-2956) calling fetchdt without a --renewer argument throws NPE

Posted by "Aaron T. Myers (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-2956?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13288744#comment-13288744 ] 

Aaron T. Myers commented on HDFS-2956:
--------------------------------------

bq. I am leaning towards fixing it to be like it was befor

+1
                
> calling fetchdt without a --renewer argument throws NPE
> -------------------------------------------------------
>
>                 Key: HDFS-2956
>                 URL: https://issues.apache.org/jira/browse/HDFS-2956
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: security
>    Affects Versions: 0.24.0
>            Reporter: Todd Lipcon
>            Assignee: Daryn Sharp
>
> If I call "bin/hdfs fetchdt /tmp/mytoken" without a "--renewer foo" argument, then it will throw a NullPointerException:
> Exception in thread "main" java.lang.NullPointerException
>         at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolTranslatorPB.getDelegationToken(ClientNamenodeProtocolTranslatorPB.java:830)
> this is because getDelegationToken is being called with a null renewer

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HDFS-2956) calling fetchdt without a --renewer argument throws NPE

Posted by "Daryn Sharp (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-2956?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13280185#comment-13280185 ] 

Daryn Sharp commented on HDFS-2956:
-----------------------------------

I'll look into it.  It's probably a 1-line fix.
                
> calling fetchdt without a --renewer argument throws NPE
> -------------------------------------------------------
>
>                 Key: HDFS-2956
>                 URL: https://issues.apache.org/jira/browse/HDFS-2956
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: security
>    Affects Versions: 0.24.0
>            Reporter: Todd Lipcon
>
> If I call "bin/hdfs fetchdt /tmp/mytoken" without a "--renewer foo" argument, then it will throw a NullPointerException:
> Exception in thread "main" java.lang.NullPointerException
>         at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolTranslatorPB.getDelegationToken(ClientNamenodeProtocolTranslatorPB.java:830)
> this is because getDelegationToken is being called with a null renewer

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HDFS-2956) calling fetchdt without a --renewer argument throws NPE

Posted by "Todd Lipcon (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-2956?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13287747#comment-13287747 ] 

Todd Lipcon commented on HDFS-2956:
-----------------------------------

Seems to me (without a ton of expertise in this area of the code) that we should treat it as a bug in the PB-ification and restore the previous behavior of non-renewable tokens.
                
> calling fetchdt without a --renewer argument throws NPE
> -------------------------------------------------------
>
>                 Key: HDFS-2956
>                 URL: https://issues.apache.org/jira/browse/HDFS-2956
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: security
>    Affects Versions: 0.24.0
>            Reporter: Todd Lipcon
>            Assignee: Daryn Sharp
>
> If I call "bin/hdfs fetchdt /tmp/mytoken" without a "--renewer foo" argument, then it will throw a NullPointerException:
> Exception in thread "main" java.lang.NullPointerException
>         at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolTranslatorPB.getDelegationToken(ClientNamenodeProtocolTranslatorPB.java:830)
> this is because getDelegationToken is being called with a null renewer

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Assigned] (HDFS-2956) calling fetchdt without a --renewer argument throws NPE

Posted by "Daryn Sharp (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HDFS-2956?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daryn Sharp reassigned HDFS-2956:
---------------------------------

    Assignee: Daryn Sharp
    
> calling fetchdt without a --renewer argument throws NPE
> -------------------------------------------------------
>
>                 Key: HDFS-2956
>                 URL: https://issues.apache.org/jira/browse/HDFS-2956
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: security
>    Affects Versions: 0.24.0
>            Reporter: Todd Lipcon
>            Assignee: Daryn Sharp
>
> If I call "bin/hdfs fetchdt /tmp/mytoken" without a "--renewer foo" argument, then it will throw a NullPointerException:
> Exception in thread "main" java.lang.NullPointerException
>         at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolTranslatorPB.getDelegationToken(ClientNamenodeProtocolTranslatorPB.java:830)
> this is because getDelegationToken is being called with a null renewer

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Assigned] (HDFS-2956) calling fetchdt without a --renewer argument throws NPE

Posted by "Aaron T. Myers (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HDFS-2956?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Aaron T. Myers reassigned HDFS-2956:
------------------------------------

    Assignee:     (was: Daryn Sharp)

Thanks for the update, Daryn. Unassigning from you.
                
> calling fetchdt without a --renewer argument throws NPE
> -------------------------------------------------------
>
>                 Key: HDFS-2956
>                 URL: https://issues.apache.org/jira/browse/HDFS-2956
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: security
>    Affects Versions: 0.24.0
>            Reporter: Todd Lipcon
>
> If I call "bin/hdfs fetchdt /tmp/mytoken" without a "--renewer foo" argument, then it will throw a NullPointerException:
> Exception in thread "main" java.lang.NullPointerException
>         at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolTranslatorPB.getDelegationToken(ClientNamenodeProtocolTranslatorPB.java:830)
> this is because getDelegationToken is being called with a null renewer

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HDFS-2956) calling fetchdt without a --renewer argument throws NPE

Posted by "Aaron T. Myers (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-2956?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13439154#comment-13439154 ] 

Aaron T. Myers commented on HDFS-2956:
--------------------------------------

Hey Daryn, any update on this?
                
> calling fetchdt without a --renewer argument throws NPE
> -------------------------------------------------------
>
>                 Key: HDFS-2956
>                 URL: https://issues.apache.org/jira/browse/HDFS-2956
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: security
>    Affects Versions: 0.24.0
>            Reporter: Todd Lipcon
>            Assignee: Daryn Sharp
>
> If I call "bin/hdfs fetchdt /tmp/mytoken" without a "--renewer foo" argument, then it will throw a NullPointerException:
> Exception in thread "main" java.lang.NullPointerException
>         at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolTranslatorPB.getDelegationToken(ClientNamenodeProtocolTranslatorPB.java:830)
> this is because getDelegationToken is being called with a null renewer

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HDFS-2956) calling fetchdt without a --renewer argument throws NPE

Posted by "Daryn Sharp (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-2956?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13287738#comment-13287738 ] 

Daryn Sharp commented on HDFS-2956:
-----------------------------------

It's potentially more than a 1-liner.  The NN used to generate (apparently by design) a non-renewable token if the renewer is null.  The PB stuff broke the ability to pass a null renewer.  OTOH, the hftp servlet defaults the renewer to the client's UGI when passed a null renewer.

The quick and dirty answer is for the token fetcher to default the renewer to UGI's login user unless the renewer flag is explicitly provided.  This breaks the ability to request a non-renewable hdfs token, but as mentioned earlier, PB broke that anyway.

Or should the PB code be fixed to allow a null renewer once again, and perhaps for consistency change hftp to not default a null renewer to the client's UGI?
                
> calling fetchdt without a --renewer argument throws NPE
> -------------------------------------------------------
>
>                 Key: HDFS-2956
>                 URL: https://issues.apache.org/jira/browse/HDFS-2956
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: security
>    Affects Versions: 0.24.0
>            Reporter: Todd Lipcon
>            Assignee: Daryn Sharp
>
> If I call "bin/hdfs fetchdt /tmp/mytoken" without a "--renewer foo" argument, then it will throw a NullPointerException:
> Exception in thread "main" java.lang.NullPointerException
>         at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolTranslatorPB.getDelegationToken(ClientNamenodeProtocolTranslatorPB.java:830)
> this is because getDelegationToken is being called with a null renewer

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HDFS-2956) calling fetchdt without a --renewer argument throws NPE

Posted by "Daryn Sharp (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-2956?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13255725#comment-13255725 ] 

Daryn Sharp commented on HDFS-2956:
-----------------------------------

If someone doesn't take this, I'll get to it in the next few days since I'm already touching tokens.
                
> calling fetchdt without a --renewer argument throws NPE
> -------------------------------------------------------
>
>                 Key: HDFS-2956
>                 URL: https://issues.apache.org/jira/browse/HDFS-2956
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: security
>    Affects Versions: 0.24.0
>            Reporter: Todd Lipcon
>
> If I call "bin/hdfs fetchdt /tmp/mytoken" without a "--renewer foo" argument, then it will throw a NullPointerException:
> Exception in thread "main" java.lang.NullPointerException
>         at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolTranslatorPB.getDelegationToken(ClientNamenodeProtocolTranslatorPB.java:830)
> this is because getDelegationToken is being called with a null renewer

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HDFS-2956) calling fetchdt without a --renewer argument throws NPE

Posted by "Daryn Sharp (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-2956?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13439538#comment-13439538 ] 

Daryn Sharp commented on HDFS-2956:
-----------------------------------

Unfortunately I've been too consumed with other token work to double back to this jira...  I can spare time to review if you want to take a stab at a patch.
                
> calling fetchdt without a --renewer argument throws NPE
> -------------------------------------------------------
>
>                 Key: HDFS-2956
>                 URL: https://issues.apache.org/jira/browse/HDFS-2956
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: security
>    Affects Versions: 0.24.0
>            Reporter: Todd Lipcon
>            Assignee: Daryn Sharp
>
> If I call "bin/hdfs fetchdt /tmp/mytoken" without a "--renewer foo" argument, then it will throw a NullPointerException:
> Exception in thread "main" java.lang.NullPointerException
>         at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolTranslatorPB.getDelegationToken(ClientNamenodeProtocolTranslatorPB.java:830)
> this is because getDelegationToken is being called with a null renewer

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HDFS-2956) calling fetchdt without a --renewer argument throws NPE

Posted by "Daryn Sharp (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-2956?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13255720#comment-13255720 ] 

Daryn Sharp commented on HDFS-2956:
-----------------------------------

It's supposed to be acceptable to pass a null renewer.  Since the renewer is a {{Text}}, the typical problem is code leaving off a null check before calling {{renewer.toString()}}.
                
> calling fetchdt without a --renewer argument throws NPE
> -------------------------------------------------------
>
>                 Key: HDFS-2956
>                 URL: https://issues.apache.org/jira/browse/HDFS-2956
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: security
>    Affects Versions: 0.24.0
>            Reporter: Todd Lipcon
>
> If I call "bin/hdfs fetchdt /tmp/mytoken" without a "--renewer foo" argument, then it will throw a NullPointerException:
> Exception in thread "main" java.lang.NullPointerException
>         at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolTranslatorPB.getDelegationToken(ClientNamenodeProtocolTranslatorPB.java:830)
> this is because getDelegationToken is being called with a null renewer

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HDFS-2956) calling fetchdt without a --renewer argument throws NPE

Posted by "Raju (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-2956?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13425861#comment-13425861 ] 

Raju commented on HDFS-2956:
----------------------------

Here we are defining the protocol message as
{code}
message GetDelegationTokenRequestProto {
  required string renewer = 1;
}
{code}

based on some of the above comments I feel the renewer should be optional (since null can be passed I mean we are not providing renewer).

Even with optional we will have the generated class with null check for renewer, so I guess we can have null check for renewer like

{code}
if(renewer != null) {
    GetDelegationTokenRequestProto req = GetDelegationTokenRequestProto
        .newBuilder()
        .setRenewer(renewer.toString())
        .build();
    } else {
      GetDelegationTokenRequestProto req = GetDelegationTokenRequestProto
      .newBuilder()
      .build();
    }    
{code} 
This should be possible since we are declaring the renewer optional, similarly we can parse the message back at serverside translator.

Please correct me if I am wrong
                
> calling fetchdt without a --renewer argument throws NPE
> -------------------------------------------------------
>
>                 Key: HDFS-2956
>                 URL: https://issues.apache.org/jira/browse/HDFS-2956
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: security
>    Affects Versions: 0.24.0
>            Reporter: Todd Lipcon
>            Assignee: Daryn Sharp
>
> If I call "bin/hdfs fetchdt /tmp/mytoken" without a "--renewer foo" argument, then it will throw a NullPointerException:
> Exception in thread "main" java.lang.NullPointerException
>         at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolTranslatorPB.getDelegationToken(ClientNamenodeProtocolTranslatorPB.java:830)
> this is because getDelegationToken is being called with a null renewer

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HDFS-2956) calling fetchdt without a --renewer argument throws NPE

Posted by "Daryn Sharp (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-2956?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13288536#comment-13288536 ] 

Daryn Sharp commented on HDFS-2956:
-----------------------------------

I am leaning towards fixing it to be like it was before, but wanted input before making the change.  Does anyone else disagree?
                
> calling fetchdt without a --renewer argument throws NPE
> -------------------------------------------------------
>
>                 Key: HDFS-2956
>                 URL: https://issues.apache.org/jira/browse/HDFS-2956
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: security
>    Affects Versions: 0.24.0
>            Reporter: Todd Lipcon
>            Assignee: Daryn Sharp
>
> If I call "bin/hdfs fetchdt /tmp/mytoken" without a "--renewer foo" argument, then it will throw a NullPointerException:
> Exception in thread "main" java.lang.NullPointerException
>         at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolTranslatorPB.getDelegationToken(ClientNamenodeProtocolTranslatorPB.java:830)
> this is because getDelegationToken is being called with a null renewer

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira