<p dir="auto"><strong>Apache Airflow version</strong>:<br>
2.2.0.dev0 (possible older versions too)</p>
<p dir="auto"><strong>OS</strong>:<br>
Linux Debian 11</p>
<p dir="auto">(BTW Here we have a typo in comment inside bug report template in <code class="notranslate">.github/ISSUE_TEMPLATE/bug_report.md</code>: <code class="notranslate">cat /etc/oss-release</code> &lt;- double 's'.)</p>
<p dir="auto"><strong>Apache Airflow Provider versions</strong>: -</p>
<p dir="auto"><strong>Deployment</strong>:<br>
Docker-compose 1.25.0</p>
<p dir="auto"><strong>What happened</strong>:<br>
The issue is related to Airflow UI and it shows duplicated notifications when removing all the tags from the input after filtering DAGs.</p>
<p dir="auto"><strong>What you expected to happen</strong>:<br>
The notifications should not be duplicated.</p>
<p dir="auto"><strong>How to reproduce it</strong>:<br>
In the main view, above the list of the DAGs (just below the top bar menu), there is a place where notifications appear. Suppose that there are 2 notifications (no matter which). Now try to search DAGs by tag using 'Filter DAGs by tag' input and use a valid tag. After the filtering is done, clear the input either by clicking on 'x' next to the tag or on the 'x' near the right side of the input. Notice that the notifications are duplicated and now you have 4 instead of 2 (each one is displayed twice). The input id is <code class="notranslate">s2id_autogen1</code>.<br>
This bug happens only if all the tags are removed from the filtering input. If you remove the tag while there is still another one in the input, the bug will not appear. Also, it is not present while searching DAGs by name using the input 'Search DAGs'.</p>
<p dir="auto">After search, before removing tags from input:<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/7412964/130072185-ca2b3bd4-023d-4574-9d28-71061bf55db6.png"><img src="https://user-images.githubusercontent.com/7412964/130072185-ca2b3bd4-023d-4574-9d28-71061bf55db6.png" alt="notif" style="max-width: 100%;"></a><br>
Duplicated notifications after removing tag from input:<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/7412964/130072195-1d1e0eec-c10a-42d8-b75c-1904e05d44fc.png"><img src="https://user-images.githubusercontent.com/7412964/130072195-1d1e0eec-c10a-42d8-b75c-1904e05d44fc.png" alt="notif_dup" style="max-width: 100%;"></a></p>
<p dir="auto"><strong>Are you willing to submit a PR?</strong><br>
I can try.</p>
<p dir="auto"><strong>Apache Airflow version</strong>: 2.0.0</p>
<p dir="auto"><strong>Environment</strong>:</p>
<ul dir="auto">
<li><strong>OS</strong> (e.g. from /etc/os-release): RHEL7</li>
<li><strong>Python</strong>: 3.8.6</li>
<li><strong>Executor</strong>: CeleryExecutor</li>
<li><strong>Workers</strong>: 4 worker nodes</li>
<li><strong>logs dir</strong>: /opt/airflow/logs/</li>
</ul>
<p dir="auto"><strong>What happened</strong>:</p>
<p dir="auto">Scenario: Assume there are four workers labeled <code class="notranslate">host_a</code>, <code class="notranslate">host_b</code>, <code class="notranslate">host_c</code>, and <code class="notranslate">host_d</code>. The webserver and scheduler are running on another host <code class="notranslate">host_z</code>. When a task is ran for the first time it executes on <code class="notranslate">host_a</code> and the log file is created locally on that host. If the same task is cleared and ran again, it may execute on another host such as <code class="notranslate">host_b</code>. When navigating back to <code class="notranslate">1.log</code> after looking at <code class="notranslate">2.log</code> the webserver replaces hostname from <code class="notranslate">host_a</code> to <code class="notranslate">host_b</code> leading to the log file not being found.</p>
<ol dir="auto">
<li>Task runs for first time <code class="notranslate">1.log</code> is created on <code class="notranslate">host_a</code></li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="*** Log file does not exist: /opt/airflow/logs/dag_foo/task_bar/2021-05-10T15:54:44.662671+00:00/1.log
*** Fetching from: http://hosta.domain.com:8793/log/dag_foo/task_bar/2021-05-10T15:54:44.662671+00:00/1.log
...."><pre class="notranslate"><code class="notranslate">*** Log file does not exist: /opt/airflow/logs/dag_foo/task_bar/2021-05-10T15:54:44.662671+00:00/1.log
*** Fetching from: http://hosta.domain.com:8793/log/dag_foo/task_bar/2021-05-10T15:54:44.662671+00:00/1.log
....
</code></pre></div>
<ol start="2" dir="auto">
<li>Manually clear and run task again <code class="notranslate">2.log</code> created on <code class="notranslate">host_b</code></li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="*** Log file does not exist: /opt/airflow/logs/dag_foo/task_bar/2021-05-10T15:54:44.662671+00:00/2.log
*** Fetching from: http://hostb.domain.com:8793/log/dag_foo/task_bar/2021-05-10T15:54:44.662671+00:00/2.log
.... rest of log"><pre class="notranslate"><code class="notranslate">*** Log file does not exist: /opt/airflow/logs/dag_foo/task_bar/2021-05-10T15:54:44.662671+00:00/2.log
*** Fetching from: http://hostb.domain.com:8793/log/dag_foo/task_bar/2021-05-10T15:54:44.662671+00:00/2.log
.... rest of log
</code></pre></div>
<ol start="3" dir="auto">
<li>Navigate back to <code class="notranslate">1.log</code>. Host has been replaced from <code class="notranslate">host_a</code> to <code class="notranslate">host_b</code> <strong>hostb.domain.com:8793</strong></li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="*** Log file does not exist: /opt/airflow/logs/dag_foo/task_bar/2021-05-10T15:54:44.662671+00:00/1.log
*** Fetching from: http://hostb.domain.com:8793/log/dag_foo/task_bar/2021-05-10T15:54:44.662671+00:00/1.log
*** Failed to fetch log file from worker. 404 Client Error: NOT FOUND for url: http://hosta.domain.com:8793/log/dag_foo/task_bar/2021-05-10T15:54:44.662671+00:00/1.log"><pre class="notranslate"><code class="notranslate">*** Log file does not exist: /opt/airflow/logs/dag_foo/task_bar/2021-05-10T15:54:44.662671+00:00/1.log
*** Fetching from: http://hostb.domain.com:8793/log/dag_foo/task_bar/2021-05-10T15:54:44.662671+00:00/1.log
*** Failed to fetch log file from worker. 404 Client Error: NOT FOUND for url: http://hosta.domain.com:8793/log/dag_foo/task_bar/2021-05-10T15:54:44.662671+00:00/1.log
</code></pre></div>
<p dir="auto"><strong>What you expected to happen</strong>:<br>
Webserver should remember where a task ran.</p>