java.lang.NullPointerException

JIRA | Josh Reed | 6 years ago
  1. 0

    When one tries to cancel a job (in this case of type=command), the cancellation (in reading through the code/setting break points) tries to send off a notification email PRIOR to actually killing the process. This means that when email properties are not set up, a NullPointerException ensues, and the location in which it is caught (in IndexServlet's cancelJob method) means that the code that actually kills the process is bypassed completely! (See call stack info below for details) I feel like, ideally, the killing of the job should occur prior to the sending off of the error email (and the email sending should occur in the background as well, so that the UI does not hang while waiting on the SMTP server). This way the email is a notification of WHAT ALREADY HAPPENED rather than what is expected to happen, because in the event that an email gets sent, but for some reason the process doesn't get terminated, then the process may still be running, giving the user a false impression on the status of the job. Additionally, it'd be nice if the UI did not hang while canceling a job until after the email is sent. Lastly, I think that either your code or your documentation needs to be changed, because this is part of the reason I found this bug in the first place. For instance, nowhere is it mentioned that one should include a "mail.sender" property in the system.properties file, and that it is "notify.emails" that is used for the recipient list (whereas in the documentation it says "success.emails" and "failure.emails"). These type of static property names SHOULD NOT have to be found via digging through the code. Without setting the mail.sender property is what causes this specific exception, but from the documentation I didn't know I even needed to set that property. 10/12/22 10:17:04 ERROR pages.IndexServlet: Exception while attempting to cancel flow 'long-running'. java.lang.NullPointerException at javax.mail.internet.InternetAddress.parse(InternetAddress.java:609) at javax.mail.internet.InternetAddress.parse(InternetAddress.java:569) at javax.mail.internet.InternetAddress.<init>(InternetAddress.java:105) at javax.mail.internet.InternetAddress.<init>(InternetAddress.java:133) at azkaban.app.Mailman.sendEmail(Mailman.java:63) at azkaban.app.Mailman.sendEmailIfPossible(Mailman.java:78) at azkaban.app.Scheduler.sendErrorEmail(Scheduler.java:549) at azkaban.app.Scheduler.access$1000(Scheduler.java:67) at azkaban.app.Scheduler$ScheduledRunnable$1.completed(Scheduler.java:733) at azkaban.flow.IndividualJobExecutableFlow.cancel(IndividualJobExecutableFlow.java:232) at azkaban.flow.WrappingExecutableFlow.cancel(WrappingExecutableFlow.java:38) at azkaban.web.pages.IndexServlet.cancelJob(IndexServlet.java:174) at azkaban.web.pages.IndexServlet.doPost(IndexServlet.java:106) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Thread.java:636)

    JIRA | 6 years ago | Josh Reed
    java.lang.NullPointerException
  2. 0

    When one tries to cancel a job (in this case of type=command), the cancellation (in reading through the code/setting break points) tries to send off a notification email PRIOR to actually killing the process. This means that when email properties are not set up, a NullPointerException ensues, and the location in which it is caught (in IndexServlet's cancelJob method) means that the code that actually kills the process is bypassed completely! (See call stack info below for details) I feel like, ideally, the killing of the job should occur prior to the sending off of the error email (and the email sending should occur in the background as well, so that the UI does not hang while waiting on the SMTP server). This way the email is a notification of WHAT ALREADY HAPPENED rather than what is expected to happen, because in the event that an email gets sent, but for some reason the process doesn't get terminated, then the process may still be running, giving the user a false impression on the status of the job. Additionally, it'd be nice if the UI did not hang while canceling a job until after the email is sent. Lastly, I think that either your code or your documentation needs to be changed, because this is part of the reason I found this bug in the first place. For instance, nowhere is it mentioned that one should include a "mail.sender" property in the system.properties file, and that it is "notify.emails" that is used for the recipient list (whereas in the documentation it says "success.emails" and "failure.emails"). These type of static property names SHOULD NOT have to be found via digging through the code. Without setting the mail.sender property is what causes this specific exception, but from the documentation I didn't know I even needed to set that property. 10/12/22 10:17:04 ERROR pages.IndexServlet: Exception while attempting to cancel flow 'long-running'. java.lang.NullPointerException at javax.mail.internet.InternetAddress.parse(InternetAddress.java:609) at javax.mail.internet.InternetAddress.parse(InternetAddress.java:569) at javax.mail.internet.InternetAddress.<init>(InternetAddress.java:105) at javax.mail.internet.InternetAddress.<init>(InternetAddress.java:133) at azkaban.app.Mailman.sendEmail(Mailman.java:63) at azkaban.app.Mailman.sendEmailIfPossible(Mailman.java:78) at azkaban.app.Scheduler.sendErrorEmail(Scheduler.java:549) at azkaban.app.Scheduler.access$1000(Scheduler.java:67) at azkaban.app.Scheduler$ScheduledRunnable$1.completed(Scheduler.java:733) at azkaban.flow.IndividualJobExecutableFlow.cancel(IndividualJobExecutableFlow.java:232) at azkaban.flow.WrappingExecutableFlow.cancel(WrappingExecutableFlow.java:38) at azkaban.web.pages.IndexServlet.cancelJob(IndexServlet.java:174) at azkaban.web.pages.IndexServlet.doPost(IndexServlet.java:106) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Thread.java:636)

    JIRA | 6 years ago | Josh Reed
    java.lang.NullPointerException
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.NullPointerException

      No message provided

      at javax.mail.internet.InternetAddress.parse()
    2. JavaMail API
      InternetAddress.<init>
      1. javax.mail.internet.InternetAddress.parse(InternetAddress.java:609)
      2. javax.mail.internet.InternetAddress.parse(InternetAddress.java:569)
      3. javax.mail.internet.InternetAddress.<init>(InternetAddress.java:105)
      4. javax.mail.internet.InternetAddress.<init>(InternetAddress.java:133)
      4 frames
    3. azkaban.app
      Scheduler$ScheduledRunnable$1.completed
      1. azkaban.app.Mailman.sendEmail(Mailman.java:63)
      2. azkaban.app.Mailman.sendEmailIfPossible(Mailman.java:78)
      3. azkaban.app.Scheduler.sendErrorEmail(Scheduler.java:549)
      4. azkaban.app.Scheduler.access$1000(Scheduler.java:67)
      5. azkaban.app.Scheduler$ScheduledRunnable$1.completed(Scheduler.java:733)
      5 frames
    4. Azkaban
      WrappingExecutableFlow.cancel
      1. azkaban.flow.IndividualJobExecutableFlow.cancel(IndividualJobExecutableFlow.java:232)
      2. azkaban.flow.WrappingExecutableFlow.cancel(WrappingExecutableFlow.java:38)
      2 frames
    5. azkaban.web.pages
      IndexServlet.doPost
      1. azkaban.web.pages.IndexServlet.cancelJob(IndexServlet.java:174)
      2. azkaban.web.pages.IndexServlet.doPost(IndexServlet.java:106)
      2 frames
    6. JavaServlet
      HttpServlet.service
      1. javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
      2. javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      2 frames
    7. Glassfish Core
      CoyoteAdapter.service
      1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      3. org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
      4. org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
      5. org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
      6. org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      7. org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      8. org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
      8 frames
    8. Grizzly HTTP
      JIoEndpoint$Worker.run
      1. org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
      2. org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
      3. org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
      3 frames
    9. Java RT
      Thread.run
      1. java.lang.Thread.run(Thread.java:636)
      1 frame