Uploaded image for project: 'Hadoop YARN'
  1. Hadoop YARN
  2. YARN-4246

NPE while listing app attempt

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.8.0, 3.0.0-alpha1
    • 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());
      

      Attachments

        1. YARN-4246_1.patch
          3 kB
          nijel
        2. YARN-4246_2.patch
          3 kB
          nijel

        Activity

          People

            nijel nijel
            varun_saxena Varun Saxena
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: