Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
-
Reviewed
Description
Exception in thread "main" java.lang.NullPointerException at org.apache.hadoop.yarn.client.cli.ApplicationCLI.listApplicationAttempts(ApplicationCLI.java:669) at org.apache.hadoop.yarn.client.cli.ApplicationCLI.run(ApplicationCLI.java:233) at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70) at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:84) at org.apache.hadoop.yarn.client.cli.ApplicationCLI.main(ApplicationCLI.java:89)
This is because AM container id can be null if AM container hasnt been allocated. In ApplicationCLI#listApplicationAttempts we should check whether AM container ID is null instead of directly calling toString.
writer.printf(APPLICATION_ATTEMPTS_PATTERN, appAttemptReport .getApplicationAttemptId(), appAttemptReport .getYarnApplicationAttemptState(), appAttemptReport .getAMContainerId().toString(), appAttemptReport.getTrackingUrl());