title: Android WorkManager doesn't trigger one of the two scheduled workers
body: <p>I have two periodic workers scheduled in my app where one worker repeats after 24 hours and another in 15 minutes.</p>
  
  <p>Initially on fresh install things work as expected, but after some days I got an issue on 2 devices(out of 5). 
  The 24 hour worker is triggered properly but the 15 minute one isn't triggered at all. I have been monitoring this for 24 hours now. </p>
  
  <p>I viewed the databse of workmanager via Stetho and saw some entries for 24-hour worker and 0 entries for 15 minute worker. I'm looking in the <code>WorkSpec</code> table.</p>
  
  <p>I debugged via Android studio and after querying WorkManager using <code>getWorkInfosByTag()</code> I got a list of 80 objects for the 15-minute worker where 79 were in <code>CANCELED</code> state and one was in <code>ENQUEUED</code> state.</p>
  
  <p>So apparently, canceled workers are not added to the DB?</p>
  
  <p>I did not find any document from Google which explains the scenarios in which worker is canceled.</p>
  
  <p>I am using <code>1.0.0-beta03</code> version of the work runtime.
  Also, I am not killing the app or doing anything funny. The app is running in the background and not being killed.
  Devices are Mi A2 (Android 9), Redmi Note 4(Android 7).</p>
  
  <p>I need to understand why is the worker being canceled and is there any better way to debug this? Any pointers will be helpful and upvoted!</p>
  
  <p>Thanks. </p>
  
  <p>Edit1: Posting the code to schedule both workers.</p>
  
  <p>24-hour periodic worker:</p>
  
  <pre><code>public static synchronized void scheduleWork() {
      checkPreviousWorkerStatus();
      if (isWorking()) {
          Log.i("AppDataCleanupWorker", "Did not schedule data cleanup work; already running.");
          return;
      }
  
      if (lastWorkId != null) {
          WorkManager.getInstance().cancelAllWorkByTag("AppDataCleanupWorker");
          lastWorkId = null;
      }
  
      Constraints constraints = new Constraints.Builder()
              .setRequiresCharging(true)
              .build();
  
      PeriodicWorkRequest.Builder builder = new PeriodicWorkRequest
              .Builder(AppDataCleanupWorker.class, 24, TimeUnit.HOURS)
              .addTag("AppDataCleanupWorker")
              .setConstraints(constraints);
  
      PeriodicWorkRequest workRequest = builder.build();
      lastWorkId = workRequest.getId();
      WorkManager.getInstance().enqueue(workRequest);
  
      List&lt;WorkInfo&gt; workInfos = WorkManager.getInstance()
              .getWorkInfosByTagLiveData("AppDataCleanupWorker")
              .getValue();
      if (workInfos != null &amp;&amp; workInfos.size() &gt; 1) {
          throw new RuntimeException("Multiple workers scheduled. Only one schedule is expected.");
      }
  }
  </code></pre>
  
  <p>15-minute periodic worker:</p>
  
  <pre><code>public static synchronized void scheduleWork() {
      checkPreviousWorkerStatus();
      if (isWorking) {
          Log.i("ImageUploadWorker", "Did not schedule image upload work; already running.");
          return;
      }
  
      if (lastWorkId != null) {
          WorkManager.getInstance().cancelAllWorkByTag("ImageUploadWorker");
          lastWorkId = null;
      }
  
      Constraints constraints = new Constraints.Builder()
              .setRequiresBatteryNotLow(true)
              .setRequiredNetworkType(NetworkType.CONNECTED)
              .build();
      PeriodicWorkRequest.Builder builder =
              new PeriodicWorkRequest.Builder(ImageUploadWorker.class, 15,
                      TimeUnit.MINUTES)
                      .addTag("ImageUploadWorker")
                      .setConstraints(constraints);
      PeriodicWorkRequest workRequest = builder.build();
      lastWorkId = workRequest.getId();
      WorkManager.getInstance().enqueue(workRequest);
  
      List&lt;WorkInfo&gt; workInfos = WorkManager.getInstance()
              .getWorkInfosByTagLiveData("ImageUploadWorker").getValue();
      if (workInfos != null &amp;&amp; workInfos.size() &gt; 1) {
          throw new RuntimeException("Multiple workers scheduled. Only one schedule is expected.");
      }
  }
  </code></pre>
  
  <p>Note: The device is connected to the Internet &amp; network speed is pretty good.</p>