Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-7523

Database inconsistency: quartz triggers referring to nonexistent filtersubscriptions, leads to JobExecutionException error in logs

    XMLWordPrintable

Details

    Description

      The qrtz_triggers table contains a row for every subscribed-to filter subscription:

      10410 | SUBSCRIPTION_10360 | SEND_SUBSCRIPTION | 10000 | 2005-08-01 00:55:42.887-05 | WAITING | SIMPLE | 2005-02-16 23:55:42.887-06 |
      ...

      The numeric part of the second field ('10360') is a reference to the id of a filtersubscription row (see DefaultSubscriptionManager#getSubscription where this is called).

      In many JIRA databases though, I have found quartz triggers referring to nonexistent filtersubscriptions, as shown by this query (here on jira.atlassian.com data):

      atlassian-jira=# select TRIGGER_NAME FROM qrtz_triggers LEFT JOIN filtersubscription ON filtersubscription.id=SUBSTRING(TRIGGER_NAME, 14) WHERE filtersubscription.id IS NULL;
      trigger_name
      --------------------
      SUBSCRIPTION_10340
      SUBSCRIPTION_10170
      SUBSCRIPTION_10280
      SUBSCRIPTION_10050
      SUBSCRIPTION_10060
      SUBSCRIPTION_10040
      SUBSCRIPTION_10410
      SUBSCRIPTION_10400
      SUBSCRIPTION_10080
      SUBSCRIPTION_10380

      When these quartz jobs run, the following error appears in the logs (from JIRA 3.2):

      INFO: Job SEND_SUBSCRIPTION.SEND_SUBSCRIPTION threw a JobExecutionException:
      org.quartz.JobExecutionException: Error retrieving schedule entry for this job. [See nested exception: java.lang.NullPointerException: ]
      at com.atlassian.jira.issue.subscription.SendFilterJob.execute(SendFilterJob.java:27)
      at org.quartz.core.JobRunShell.run(JobRunShell.java:191)
      at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:516)

      • Nested Exception (Underlying Cause) ---------------
        java.lang.NullPointerException:
        at com.atlassian.jira.issue.subscription.DefaultSubscriptionManager.runSubscription(DefaultSubscriptionManager.java:140)
        at com.atlassian.jira.issue.subscription.SendFilterJob.execute(SendFilterJob.java:23)
        at org.quartz.core.JobRunShell.run(JobRunShell.java:191)
        at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:516)

      Attachments

        Activity

          People

            Unassigned Unassigned
            7ee5c68a815f Jeff Turner
            Votes:
            6 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: