<h3 dir="auto">Apache Airflow version</h3>
<p dir="auto">Other Airflow 2 version (please specify below)</p>
<h3 dir="auto">What happened</h3>
<p dir="auto">On Airflow 2.4.3</p>
<p dir="auto">When using a deferrable operator the log disappears from the webpage while the operator is deferred and appears when it is running/finished. This doesn't happen consistently over all DAG runs.</p>
<p dir="auto">The error has been reproduced in the new log panel on the grid page &amp; the "standalone" log page.</p>
<p dir="auto">As an example, I've tried running a simple DAG (just executes <code class="notranslate">sleep 10</code>). The logs are for the 3rd retry and I am using the "Auto-refresh" button on the grid page.</p>
<p dir="auto">There are no visible errors on the web console when this happens, but the web server logs look like Airflow doesn't know it is the 3rd try while the operator is deferred and gets the 2nd try.</p>
<h3 dir="auto">What you think should happen instead</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">How to reproduce</h3>
<p dir="auto">Use a deferrable operator. We use this custom one: <a href="https://gist.github.com/ecodina/157b5dc44b79b13fe296b1275b4f0967">https://gist.github.com/ecodina/157b5dc44b79b13fe296b1275b4f0967</a></p>
<p dir="auto">Trigger it from the webpage and see how the log appears intermittently.</p>
<h3 dir="auto">Operating System</h3>
<p dir="auto">CentOS Linux 8</p>
<h3 dir="auto">Versions of Apache Airflow Providers</h3>
<p dir="auto">apache-airflow-providers-cncf-kubernetes | 4.4.0 | Kubernetes<br>
apache-airflow-providers-common-sql | 1.2.0 | Common SQL Provider<br>
apache-airflow-providers-ftp | 3.1.0 | File Transfer Protocol (FTP)<br>
apache-airflow-providers-http | 4.0.0 | Hypertext Transfer Protocol (HTTP)<br>
apache-airflow-providers-imap | 3.0.0 | Internet Message Access Protocol (IMAP)<br>
apache-airflow-providers-postgres | 5.2.2 | PostgreSQL<br>
apache-airflow-providers-sqlite | 3.2.1 | SQLite<br>
apache-airflow-providers-ssh | 3.2.0 | Secure Shell (SSH)</p>
<h3 dir="auto">Deployment</h3>
<p dir="auto">Other</p>
<h3 dir="auto">Deployment details</h3>
<p dir="auto">Installed using PIP in a conda environment (as if it was a virtualenv).</p>
<p dir="auto">Using postgresql .</p>
<h3 dir="auto">Anything else</h3>
<p dir="auto">Relevant lines of the webserver's log:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="--&gt; the log doesn't appear
Dec 30 08:53:52 bright01 webserver.sh[1915713]: 192.168.253.76 - - [30/Dec/2022:08:53:52 +0000] &quot;GET /object/grid_data?dag_id=dag.testing&amp;num_runs=25 HTTP/1.1&quot; 200 1800 &quot;http://airflow.local/dags/dag.testing/grid?root=&amp;dag_run_id=scheduled__2022-12-30T07%3A00%3A00%2B00%3A00&amp;task_id=prova&quot; &quot;Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0&quot;
Dec 30 08:53:52 bright01 webserver.sh[1915713]: 192.168.253.76 - - [30/Dec/2022:08:53:52 +0000] &quot;GET /api/v1/dags/dag.testing/dagRuns/scheduled__2022-12-30T07:00:00+00:00/taskInstances/prova/logs/2?full_content=false HTTP/1.1&quot; 200 14349 &quot;http://airflow.local/dags/dag.testing/grid?root=&amp;dag_run_id=scheduled__2022-12-30T07%3A00%3A00%2B00%3A00&amp;task_id=prova&quot; &quot;Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0&quot;
Dec 30 08:53:55 bright01 webserver.sh[1915713]: 192.168.253.76 - - [30/Dec/2022:08:53:55 +0000] &quot;GET /object/grid_data?dag_id=dag.testing&amp;num_runs=25 HTTP/1.1&quot; 200 1800 &quot;http://airflow.local/dags/dag.testing/grid?root=&amp;dag_run_id=scheduled__2022-12-30T07%3A00%3A00%2B00%3A00&amp;task_id=prova&quot; &quot;Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0&quot;
Dec 30 08:53:55 bright01 webserver.sh[1915713]: 192.168.253.76 - - [30/Dec/2022:08:53:55 +0000] &quot;GET /api/v1/dags/dag.testing/dagRuns/scheduled__2022-12-30T07:00:00+00:00/taskInstances/prova/logs/2?full_content=false HTTP/1.1&quot; 200 14349 &quot;http://airflow.local/dags/dag.testing/grid?root=&amp;dag_run_id=scheduled__2022-12-30T07%3A00%3A00%2B00%3A00&amp;task_id=prova&quot; &quot;Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0&quot;
Dec 30 08:53:58 bright01 webserver.sh[1915713]: 192.168.253.76 - - [30/Dec/2022:08:53:58 +0000] &quot;GET /object/grid_data?dag_id=dag.testing&amp;num_runs=25 HTTP/1.1&quot; 200 1801 &quot;http://airflow.local/dags/dag.testing/grid?root=&amp;dag_run_id=scheduled__2022-12-30T07%3A00%3A00%2B00%3A00&amp;task_id=prova&quot; &quot;Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0&quot;
Dec 30 08:53:58 bright01 webserver.sh[1915713]: 192.168.253.76 - - [30/Dec/2022:08:53:58 +0000] &quot;GET /api/v1/dags/dag.testing/dagRuns/scheduled__2022-12-30T07:00:00+00:00/taskInstances/prova/logs/2?full_content=false HTTP/1.1&quot; 200 14349 &quot;http://airflow.local/dags/dag.testing/grid?root=&amp;dag_run_id=scheduled__2022-12-30T07%3A00%3A00%2B00%3A00&amp;task_id=prova&quot; &quot;Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0&quot;
Dec 30 08:53:58 bright01 webserver.sh[1915713]: 192.168.253.76 - - [30/Dec/2022:08:53:58 +0000] &quot;GET /api/v1/dags/dag.testing/dagRuns/scheduled__2022-12-30T07:00:00+00:00/taskInstances/prova/logs/3?full_content=false HTTP/1.1&quot; 200 7804 &quot;http://airflow.local/dags/dag.testing/grid?root=&amp;dag_run_id=scheduled__2022-12-30T07%3A00%3A00%2B00%3A00&amp;task_id=prova&quot; &quot;Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0&quot;

-&gt; the log starts appearing
Dec 30 08:54:01 bright01 webserver.sh[1915713]: 192.168.253.76 - - [30/Dec/2022:08:54:01 +0000] &quot;GET /object/grid_data?dag_id=dag.testing&amp;num_runs=25 HTTP/1.1&quot; 200 1802 &quot;http://airflow.local/dags/dag.testing/grid?root=&amp;dag_run_id=scheduled__2022-12-30T07%3A00%3A00%2B00%3A00&amp;task_id=prova&quot; &quot;Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0&quot;
Dec 30 08:54:02 bright01 webserver.sh[1915713]: 192.168.253.76 - - [30/Dec/2022:08:54:02 +0000] &quot;GET /api/v1/dags/dag.testing/dagRuns/scheduled__2022-12-30T07:00:00+00:00/taskInstances/prova/logs/3?full_content=false HTTP/1.1&quot; 200 8198 &quot;http://airflow.local/dags/dag.testing/grid?root=&amp;dag_run_id=scheduled__2022-12-30T07%3A00%3A00%2B00%3A00&amp;task_id=prova&quot; &quot;Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0&quot;"><pre class="notranslate"><code class="notranslate">--&gt; the log doesn't appear
Dec 30 08:53:52 bright01 webserver.sh[1915713]: 192.168.253.76 - - [30/Dec/2022:08:53:52 +0000] "GET /object/grid_data?dag_id=dag.testing&amp;num_runs=25 HTTP/1.1" 200 1800 "http://airflow.local/dags/dag.testing/grid?root=&amp;dag_run_id=scheduled__2022-12-30T07%3A00%3A00%2B00%3A00&amp;task_id=prova" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0"
Dec 30 08:53:52 bright01 webserver.sh[1915713]: 192.168.253.76 - - [30/Dec/2022:08:53:52 +0000] "GET /api/v1/dags/dag.testing/dagRuns/scheduled__2022-12-30T07:00:00+00:00/taskInstances/prova/logs/2?full_content=false HTTP/1.1" 200 14349 "http://airflow.local/dags/dag.testing/grid?root=&amp;dag_run_id=scheduled__2022-12-30T07%3A00%3A00%2B00%3A00&amp;task_id=prova" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0"
Dec 30 08:53:55 bright01 webserver.sh[1915713]: 192.168.253.76 - - [30/Dec/2022:08:53:55 +0000] "GET /object/grid_data?dag_id=dag.testing&amp;num_runs=25 HTTP/1.1" 200 1800 "http://airflow.local/dags/dag.testing/grid?root=&amp;dag_run_id=scheduled__2022-12-30T07%3A00%3A00%2B00%3A00&amp;task_id=prova" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0"
Dec 30 08:53:55 bright01 webserver.sh[1915713]: 192.168.253.76 - - [30/Dec/2022:08:53:55 +0000] "GET /api/v1/dags/dag.testing/dagRuns/scheduled__2022-12-30T07:00:00+00:00/taskInstances/prova/logs/2?full_content=false HTTP/1.1" 200 14349 "http://airflow.local/dags/dag.testing/grid?root=&amp;dag_run_id=scheduled__2022-12-30T07%3A00%3A00%2B00%3A00&amp;task_id=prova" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0"
Dec 30 08:53:58 bright01 webserver.sh[1915713]: 192.168.253.76 - - [30/Dec/2022:08:53:58 +0000] "GET /object/grid_data?dag_id=dag.testing&amp;num_runs=25 HTTP/1.1" 200 1801 "http://airflow.local/dags/dag.testing/grid?root=&amp;dag_run_id=scheduled__2022-12-30T07%3A00%3A00%2B00%3A00&amp;task_id=prova" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0"
Dec 30 08:53:58 bright01 webserver.sh[1915713]: 192.168.253.76 - - [30/Dec/2022:08:53:58 +0000] "GET /api/v1/dags/dag.testing/dagRuns/scheduled__2022-12-30T07:00:00+00:00/taskInstances/prova/logs/2?full_content=false HTTP/1.1" 200 14349 "http://airflow.local/dags/dag.testing/grid?root=&amp;dag_run_id=scheduled__2022-12-30T07%3A00%3A00%2B00%3A00&amp;task_id=prova" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0"
Dec 30 08:53:58 bright01 webserver.sh[1915713]: 192.168.253.76 - - [30/Dec/2022:08:53:58 +0000] "GET /api/v1/dags/dag.testing/dagRuns/scheduled__2022-12-30T07:00:00+00:00/taskInstances/prova/logs/3?full_content=false HTTP/1.1" 200 7804 "http://airflow.local/dags/dag.testing/grid?root=&amp;dag_run_id=scheduled__2022-12-30T07%3A00%3A00%2B00%3A00&amp;task_id=prova" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0"

-&gt; the log starts appearing
Dec 30 08:54:01 bright01 webserver.sh[1915713]: 192.168.253.76 - - [30/Dec/2022:08:54:01 +0000] "GET /object/grid_data?dag_id=dag.testing&amp;num_runs=25 HTTP/1.1" 200 1802 "http://airflow.local/dags/dag.testing/grid?root=&amp;dag_run_id=scheduled__2022-12-30T07%3A00%3A00%2B00%3A00&amp;task_id=prova" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0"
Dec 30 08:54:02 bright01 webserver.sh[1915713]: 192.168.253.76 - - [30/Dec/2022:08:54:02 +0000] "GET /api/v1/dags/dag.testing/dagRuns/scheduled__2022-12-30T07:00:00+00:00/taskInstances/prova/logs/3?full_content=false HTTP/1.1" 200 8198 "http://airflow.local/dags/dag.testing/grid?root=&amp;dag_run_id=scheduled__2022-12-30T07%3A00%3A00%2B00%3A00&amp;task_id=prova" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0"
</code></pre></div>
<h3 dir="auto">Are you willing to submit PR?</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Yes I am willing to submit a PR!</li>
</ul>
<h3 dir="auto">Code of Conduct</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I agree to follow this project's <a href="https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md">Code of Conduct</a></li>
</ul>
<h3 dir="auto">Apache Airflow version</h3>
<p dir="auto">2.4.3</p>
<h3 dir="auto">What happened</h3>
<p dir="auto">In the grid view I do not see the logs for the latest try number if the task is in deferred state. I do see it in the "old" log view.</p>
<p dir="auto">Grid view:<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/3342974/204215464-989e70e3-9dfc-490b-908c-f47f491316d5.png"><img src="https://user-images.githubusercontent.com/3342974/204215464-989e70e3-9dfc-490b-908c-f47f491316d5.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">"Old" view:<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/3342974/204215513-05a6b0ac-f3da-44fa-b8c2-e31013e2467c.png"><img src="https://user-images.githubusercontent.com/3342974/204215513-05a6b0ac-f3da-44fa-b8c2-e31013e2467c.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">It could have something to do with the deferred task getting its try_number reduced by 1 - in my example try_number=1 and next_try_number=2.</p>
<p dir="auto"></p><div class="Box Box--condensed my-2">
  <div class="Box-header f6">
    <p class="mb-0 text-bold">
      <a href="https://github.com/apache/airflow/blob/3e288abd0bc3e5788dcd7f6d9f6bef26ec4c7281/airflow/models/taskinstance.py#L1617-L1618">airflow/airflow/models/taskinstance.py</a>
    </p>
    <p class="mb-0 color-fg-muted">
        Lines 1617 to 1618
      in
      <a data-pjax="true" class="commit-tease-sha" href="/apache/airflow/commit/3e288abd0bc3e5788dcd7f6d9f6bef26ec4c7281">3e288ab</a>
    </p>
  </div>
  <div itemprop="text" class="Box-body p-0 blob-wrapper blob-wrapper-embedded data">
    <table class="highlight tab-size mb-0 js-file-line-container" data-tab-size="8" data-paste-markdown-skip="">

        <tbody><tr class="border-0">
          <td id="L1617" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="1617"></td>
          <td id="LC1617" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-c"># Decrement try number so the next one is the same try</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L1618" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="1618"></td>
          <td id="LC1618" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s1">self</span>.<span class="pl-s1">_try_number</span> <span class="pl-c1">-=</span> <span class="pl-c1">1</span> </td>
        </tr>
    </tbody></table>
  </div>
</div>
<p></p>
<h3 dir="auto">What you think should happen instead</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">How to reproduce</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Operating System</h3>
<p dir="auto">Red Hat</p>
<h3 dir="auto">Versions of Apache Airflow Providers</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Deployment</h3>
<p dir="auto">Virtualenv installation</p>
<h3 dir="auto">Deployment details</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Anything else</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Are you willing to submit PR?</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Yes I am willing to submit a PR!</li>
</ul>
<h3 dir="auto">Code of Conduct</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I agree to follow this project's <a href="https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md">Code of Conduct</a></li>
</ul>