You are viewing a plain text version of this content. The canonical link for it is here.
Posted to yarn-dev@hadoop.apache.org by "Wang, Xinglong (Jira)" <ji...@apache.org> on 2021/04/14 12:18:00 UTC

[jira] [Created] (YARN-10735) Unmanaged AM is won't populate AMRMToken to ApplicationReport in secure cluster

Wang, Xinglong created YARN-10735:
-------------------------------------

             Summary: Unmanaged AM is won't populate AMRMToken to ApplicationReport in secure cluster
                 Key: YARN-10735
                 URL: https://issues.apache.org/jira/browse/YARN-10735
             Project: Hadoop YARN
          Issue Type: Bug
            Reporter: Wang, Xinglong
            Assignee: Wang, Xinglong


With kerberos enabled, NPE will be reported when launching UnmanagedAMLauncher.
It is due to there is no AMRMToken is returned in ApplicationReport. After a while investigation, it turns out that RMAppImpl has a bad if condition inside createAndGetApplicationReport

{code:java}
21/04/14 02:46:01 INFO unmanagedamlauncher.UnmanagedAMLauncher: Initializing Client
21/04/14 02:46:02 INFO unmanagedamlauncher.UnmanagedAMLauncher: Starting Client
21/04/14 02:46:02 INFO client.AHSProxy: Connecting to Application History server at /0.0.0.0:10200
21/04/14 02:46:02 INFO unmanagedamlauncher.UnmanagedAMLauncher: Setting up application submission context for ASM
21/04/14 02:46:02 INFO client.ConfiguredRMFailoverProxyProvider: Failing over to rm2
21/04/14 02:46:02 INFO unmanagedamlauncher.UnmanagedAMLauncher: Setting unmanaged AM
21/04/14 02:46:02 INFO unmanagedamlauncher.UnmanagedAMLauncher: Submitting application to ASM
21/04/14 02:46:03 INFO impl.YarnClientImpl: Submitted application application_1618393442264_0002
21/04/14 02:46:04 INFO unmanagedamlauncher.UnmanagedAMLauncher: Got application report from ASM for, appId=2, appAttemptId=appattempt_1618393442264_0002_000001, clientToAMToken=Token { kind: YARN_CLIENT_TOKEN, service:  }, appDiagnostics=AM container is launched, waiting for AM container to Register with RM, appMasterHost=N/A, appQueue=hdmi-default, appMasterRpcPort=-1, appStartTime=1618393562917, yarnAppState=ACCEPTED, distributedFinalState=UNDEFINED, appTrackingUrl=N/A, appUser=b_carmel
21/04/14 02:46:04 INFO unmanagedamlauncher.UnmanagedAMLauncher: Launching AM with application attempt id appattempt_1618393442264_0002_000001
21/04/14 02:46:04 FATAL unmanagedamlauncher.UnmanagedAMLauncher: Error running Client
java.lang.NullPointerException
	at org.apache.hadoop.yarn.applications.unmanagedamlauncher.UnmanagedAMLauncher.launchAM(UnmanagedAMLauncher.java:186)
	at org.apache.hadoop.yarn.applications.unmanagedamlauncher.UnmanagedAMLauncher.run(UnmanagedAMLauncher.java:354)
	at org.apache.hadoop.yarn.applications.unmanagedamlauncher.UnmanagedAMLauncher.main(UnmanagedAMLauncher.java:111)
{code}

 

{code:java}
 public ApplicationReport createAndGetApplicationReport(String clientUserName,
      boolean allowAccess) {
        ......
        if (currentAttempt != null && 
            currentAttempt.getAppAttemptState() == RMAppAttemptState.LAUNCHED) {
          if (getApplicationSubmissionContext().getUnmanagedAM() &&
              clientUserName != null && getUser().equals(clientUserName)) {
            Token<AMRMTokenIdentifier> token = currentAttempt.getAMRMToken();
            if (token != null) {
              amrmToken = BuilderUtils.newAMRMToken(token.getIdentifier(),
                  token.getKind().toString(), token.getPassword(),
                  token.getService().toString());
            }
          }
        }
{code}

clientUserName is fullName of a kerberos principle like abc@domain.com whereas getUser() will return the username recorded in RMAppImpl which is short name.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: yarn-dev-unsubscribe@hadoop.apache.org
For additional commands, e-mail: yarn-dev-help@hadoop.apache.org