title: Job has been attempted too many times or run too long
body: <p>I have a job that works flawless locally, but in production I run into issues where it doesn't work.  I've encompassed the entire <code>handle()</code> with a <code>try/catch</code> and am not seeing anything logged to Bugsnag, despite many other exceptions elsewhere from being deployed.  </p>
  
  <pre class="lang-php prettyprint-override"><code>public function handle() {
      try {
  
          // do stuff
  
      } catch (\Exception $e) {
          Bugsnag::notifyException($e);
  
          throw $e;
      }
  }
  </code></pre>
  
  <p>According to <a href="https://laravel.com/docs/horizon" rel="noreferrer">Laravel Horizon</a> this queue job runs for <code>0.0026001930236816406</code> seconds and I never see it work and never see any other errors in the <code>failed_jobs</code> table as it relates to this job.</p>
  
  <p><strong>config/queue.php</strong></p>
  
  <pre class="lang-php prettyprint-override"><code>    'redis' =&gt; [
          'driver' =&gt; 'redis',
          'connection' =&gt; 'default',
          'queue' =&gt; 'default',
          'retry_after' =&gt; (60 * 10), // 10 minutes
          'block_for' =&gt; null,
      ],
  </code></pre>
  
  <p><strong>config/horizon.php</strong></p>
  
  <pre class="lang-php prettyprint-override"><code>'environments' =&gt; [
      'production' =&gt; [
          'supervisor'        =&gt; [
              'connection'    =&gt; 'redis',
              'queue'         =&gt; [
                  'default',
              ],
              'balance'       =&gt; 'auto',
              'processes'     =&gt; 10,
              'tries'         =&gt; 3,
  
              // 10 seconds under the queue's retry_after to avoid overlap
              'timeout'       =&gt; (60 * 10) - 10, // Just under 10 mins
          ],
  </code></pre>
  
  <p>If something is causing this job to retry over and over, how can I find out how?  I'm at a loss.</p>
  
  <p><strong>Investigation thus far</strong></p>
  
  <ul>
  <li>My expectation is I should be able to run the query:</li>
  </ul>
  
  <pre class="lang-sql prettyprint-override"><code>SELECT DISTINCT exception, COUNT(id) as errors
  FROM failed_jobs 
  WHERE payload LIKE '%[TAG-JOB-HAS]%' 
  GROUP BY exception;
  </code></pre>
  
  <p>To see more than this error message:</p>
  
  <blockquote>
    <p>Job has been attempted too many times or run too long</p>
  </blockquote>
  
  <p>but that's all I see.</p>
  
  <ul>
  <li><a href="https://laravel.com/docs/horizon" rel="noreferrer">Laravel Horizon</a>'s dashboard shows the job in question is running for &lt; 1 second, so I know it's not actually timing out.</li>
  </ul>