<p dir="auto"><strong>Apache Airflow version</strong>: 2.0.0</p>
<p dir="auto"><strong>Kubernetes version</strong>: -</p>
<p dir="auto"><strong>Environment</strong>:</p>
<ul dir="auto">
<li>Two servers running docker</li>
<li>Docker image:<code class="notranslate"> apache/airflow:2.0.0-python3.7</code></li>
<li>Each server contains:
<ul dir="auto">
<li>webserver</li>
<li>scheduler</li>
<li>celeny worker 1</li>
<li>celeny worker 2</li>
<li>celeny flower</li>
</ul>
</li>
<li>Broker- redis version <code class="notranslate">6.0.5</code></li>
<li>DB backend - MySQL version <code class="notranslate">8.0.20</code></li>
</ul>
<p dir="auto"><strong>What happened</strong>:</p>
<p dir="auto">Error message:</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="[...] {taskinstance.py:1038} INFO - Executing &lt;Task(BashOperator): xxx.yyy&gt; on ...
[...] {standard_task_runner.py:51} INFO - Started process 4245 to run task
[...] {standard_task_runner.py:75} INFO - Running: ['airflow', 'tasks', 'run', 'zzz', 'xxx.yyy', '...', '--job-id', '8039', '--pool', 'default_pool', '--raw', '--subdir', 'DAGS_FOLDER/ccc/ccc.zip', '--cfg-path', '/tmp/tmpq2aaznri']
[...] {standard_task_runner.py:76} INFO - Job 8039: Subtask xxx.yyy
[...] {logging_mixin.py:103} INFO - Running &lt;TaskInstance: zzz.xxx.yyy ... [running]&gt; on host HOST
[...] {taskinstance.py:1396} ERROR - (_mysql_exceptions.IntegrityError) (1062, &quot;Duplicate entry 'zzz-xxx.can_run_tasks_loca' for key 'rendered_task_instance_fields.PRIMARY'&quot;)
[SQL: INSERT INTO rendered_task_instance_fields (dag_id, task_id, execution_date, rendered_fields, k8s_pod_yaml) VALUES (%s, %s, %s, %s, %s)]
[parameters: ('zzz', 'xxx.yyy', datetime.datetime(..., ..., ..., ..., ...), '{&quot;bash_command&quot;: &quot;mkdir -p ~/eee &amp;&amp; rm -rf ~/eee&quot;, &quot;env&quot;: null}', 'null')]
(Background on this error at: http://sqlalche.me/e/13/gkpj)
Traceback (most recent call last):
  File &quot;/home/airflow/.local/lib/python3.7/site-packages/sqlalchemy/engine/base.py&quot;, line 1277, in _execute_context
    cursor, statement, parameters, context
  File &quot;/home/airflow/.local/lib/python3.7/site-packages/sqlalchemy/engine/default.py&quot;, line 593, in do_execute
    cursor.execute(statement, parameters)
  File &quot;/home/airflow/.local/lib/python3.7/site-packages/MySQLdb/cursors.py&quot;, line 255, in execute
    self.errorhandler(self, exc, value)
  File &quot;/home/airflow/.local/lib/python3.7/site-packages/MySQLdb/connections.py&quot;, line 50, in defaulterrorhandler
    raise errorvalue
  File &quot;/home/airflow/.local/lib/python3.7/site-packages/MySQLdb/cursors.py&quot;, line 252, in execute
    res = self._query(query)
  File &quot;/home/airflow/.local/lib/python3.7/site-packages/MySQLdb/cursors.py&quot;, line 378, in _query
    db.query(q)
  File &quot;/home/airflow/.local/lib/python3.7/site-packages/MySQLdb/connections.py&quot;, line 280, in query
    _mysql.connection.query(self, query)
_mysql_exceptions.IntegrityError: (1062, &quot;Duplicate entry 'zzz-xxx.yyy' for key 'rendered_task_instance_fields.PRIMARY'&quot;)"><pre class="notranslate">[...] {taskinstance.py:1038} INFO - Executing <span class="pl-k">&lt;</span>Task(BashOperator): xxx.yyy<span class="pl-k">&gt;</span> on ...
[...] {standard_task_runner.py:51} INFO - Started process 4245 to run task
[...] {standard_task_runner.py:75} INFO - Running: [<span class="pl-s"><span class="pl-pds">'</span>airflow<span class="pl-pds">'</span></span>, <span class="pl-s"><span class="pl-pds">'</span>tasks<span class="pl-pds">'</span></span>, <span class="pl-s"><span class="pl-pds">'</span>run<span class="pl-pds">'</span></span>, <span class="pl-s"><span class="pl-pds">'</span>zzz<span class="pl-pds">'</span></span>, <span class="pl-s"><span class="pl-pds">'</span>xxx.yyy<span class="pl-pds">'</span></span>, <span class="pl-s"><span class="pl-pds">'</span>...<span class="pl-pds">'</span></span>, <span class="pl-s"><span class="pl-pds">'</span>--job-id<span class="pl-pds">'</span></span>, <span class="pl-s"><span class="pl-pds">'</span>8039<span class="pl-pds">'</span></span>, <span class="pl-s"><span class="pl-pds">'</span>--pool<span class="pl-pds">'</span></span>, <span class="pl-s"><span class="pl-pds">'</span>default_pool<span class="pl-pds">'</span></span>, <span class="pl-s"><span class="pl-pds">'</span>--raw<span class="pl-pds">'</span></span>, <span class="pl-s"><span class="pl-pds">'</span>--subdir<span class="pl-pds">'</span></span>, <span class="pl-s"><span class="pl-pds">'</span>DAGS_FOLDER/ccc/ccc.zip<span class="pl-pds">'</span></span>, <span class="pl-s"><span class="pl-pds">'</span>--cfg-path<span class="pl-pds">'</span></span>, <span class="pl-s"><span class="pl-pds">'</span>/tmp/tmpq2aaznri<span class="pl-pds">'</span></span>]
[...] {standard_task_runner.py:76} INFO - Job 8039: Subtask xxx.yyy
[...] {logging_mixin.py:103} INFO - Running <span class="pl-k">&lt;</span>TaskInstance: zzz.xxx.yyy ... [running]<span class="pl-k">&gt;</span> on host HOST
[...] {taskinstance.py:1396} ERROR - (_mysql_exceptions.IntegrityError) (1062, <span class="pl-s"><span class="pl-pds">"</span>Duplicate entry 'zzz-xxx.can_run_tasks_loca' for key 'rendered_task_instance_fields.PRIMARY'<span class="pl-pds">"</span></span>)
[SQL: INSERT INTO rendered_task_instance_fields (dag_id, task_id, execution_date, rendered_fields, k8s_pod_yaml) VALUES (%s, %s, %s, %s, %s)]
[parameters: (<span class="pl-s"><span class="pl-pds">'</span>zzz<span class="pl-pds">'</span></span>, <span class="pl-s"><span class="pl-pds">'</span>xxx.yyy<span class="pl-pds">'</span></span>, datetime.datetime(..., ..., ..., ..., ...), <span class="pl-s"><span class="pl-pds">'</span>{"bash_command": "mkdir -p ~/eee &amp;&amp; rm -rf ~/eee", "env": null}<span class="pl-pds">'</span></span>, <span class="pl-s"><span class="pl-pds">'</span>null<span class="pl-pds">'</span></span>)]
(Background on this error at: http://sqlalche.me/e/13/gkpj)
Traceback (most recent call last):
  File <span class="pl-s"><span class="pl-pds">"</span>/home/airflow/.local/lib/python3.7/site-packages/sqlalchemy/engine/base.py<span class="pl-pds">"</span></span>, line 1277, <span class="pl-k">in</span> _execute_context
    cursor, statement, parameters, context
  File <span class="pl-s"><span class="pl-pds">"</span>/home/airflow/.local/lib/python3.7/site-packages/sqlalchemy/engine/default.py<span class="pl-pds">"</span></span>, line 593, <span class="pl-k">in</span> do_execute
    cursor.execute(statement, parameters)
  File <span class="pl-s"><span class="pl-pds">"</span>/home/airflow/.local/lib/python3.7/site-packages/MySQLdb/cursors.py<span class="pl-pds">"</span></span>, line 255, <span class="pl-k">in</span> execute
    self.errorhandler(self, exc, value)
  File <span class="pl-s"><span class="pl-pds">"</span>/home/airflow/.local/lib/python3.7/site-packages/MySQLdb/connections.py<span class="pl-pds">"</span></span>, line 50, <span class="pl-k">in</span> defaulterrorhandler
    raise errorvalue
  File <span class="pl-s"><span class="pl-pds">"</span>/home/airflow/.local/lib/python3.7/site-packages/MySQLdb/cursors.py<span class="pl-pds">"</span></span>, line 252, <span class="pl-k">in</span> execute
    res = self._query(query)
  File <span class="pl-s"><span class="pl-pds">"</span>/home/airflow/.local/lib/python3.7/site-packages/MySQLdb/cursors.py<span class="pl-pds">"</span></span>, line 378, <span class="pl-k">in</span> _query
    db.query(q)
  File <span class="pl-s"><span class="pl-pds">"</span>/home/airflow/.local/lib/python3.7/site-packages/MySQLdb/connections.py<span class="pl-pds">"</span></span>, line 280, <span class="pl-k">in</span> query
    _mysql.connection.query(self, query)
_mysql_exceptions.IntegrityError: (1062, <span class="pl-s"><span class="pl-pds">"</span>Duplicate entry 'zzz-xxx.yyy' for key 'rendered_task_instance_fields.PRIMARY'<span class="pl-pds">"</span></span>)</pre></div>
<p dir="auto"><strong>What you expected to happen</strong>:</p>
<p dir="auto">Run DAG without failing</p>
<p dir="auto"><strong>How to reproduce it</strong>:</p>
<p dir="auto">Use MySQL backend?</p>
<p dir="auto"><strong>Anything else we need to know</strong>:</p>
<p dir="auto">This problem occurs once in a while. I haven't found any pattern.</p>
<p dir="auto">Maybe this related to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="631215427" data-permission-text="Title is private" data-url="https://github.com/apache/airflow/issues/9148" data-hovercard-type="issue" data-hovercard-url="/apache/airflow/issues/9148/hovercard" href="https://github.com/apache/airflow/issues/9148">#9148</a> issue</p>
<h3 dir="auto">Apache Airflow version</h3>
<p dir="auto">2.3.1 (latest released)</p>
<h3 dir="auto">What happened</h3>
<p dir="auto">I have a DAG with several dag_runs which rendered fine in the Grid view.<br>
After adding new task Grid view failed to load getting blank view .<br>
There is an error in browser console.<br>
<code class="notranslate">TypeError: Cannot read properties of null (reading 'runId')</code><br>
This Error comes from  <code class="notranslate">grid.jsx</code></p>
<h3 dir="auto">What you think should happen instead</h3>
<p dir="auto">dag should be rendered and new task state in previous dag run should be <code class="notranslate">no_status</code></p>
<h3 dir="auto">How to reproduce</h3>
<p dir="auto">As described above create DAG with one task (you can use for example <code class="notranslate">BashOperator</code> with <code class="notranslate">echo</code> command) and run it.<br>
After you have at least one dag run add new task to your dag and try to reload Grid view</p>
<h3 dir="auto">Operating System</h3>
<p dir="auto">Debian GNU/Linux</p>
<h3 dir="auto">Versions of Apache Airflow Providers</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="apache-airflow-providers-amazon==3.4.0
apache-airflow-providers-celery==2.1.4
apache-airflow-providers-cncf-kubernetes==4.0.2
apache-airflow-providers-docker==2.7.0
apache-airflow-providers-elasticsearch==3.0.3
apache-airflow-providers-ftp==2.1.2
apache-airflow-providers-google==7.0.0
apache-airflow-providers-grpc==2.0.4
apache-airflow-providers-hashicorp==2.2.0
apache-airflow-providers-http==2.1.2
apache-airflow-providers-imap==2.2.3
apache-airflow-providers-microsoft-azure==3.9.0
apache-airflow-providers-mysql==2.2.3
apache-airflow-providers-odbc==2.0.4
apache-airflow-providers-postgres==4.1.0
apache-airflow-providers-redis==2.0.4
apache-airflow-providers-sendgrid==2.0.4
apache-airflow-providers-sftp==2.6.0
apache-airflow-providers-slack==4.2.3
apache-airflow-providers-sqlite==2.1.3
apache-airflow-providers-ssh==2.4.4"><pre class="notranslate"><code class="notranslate">apache-airflow-providers-amazon==3.4.0
apache-airflow-providers-celery==2.1.4
apache-airflow-providers-cncf-kubernetes==4.0.2
apache-airflow-providers-docker==2.7.0
apache-airflow-providers-elasticsearch==3.0.3
apache-airflow-providers-ftp==2.1.2
apache-airflow-providers-google==7.0.0
apache-airflow-providers-grpc==2.0.4
apache-airflow-providers-hashicorp==2.2.0
apache-airflow-providers-http==2.1.2
apache-airflow-providers-imap==2.2.3
apache-airflow-providers-microsoft-azure==3.9.0
apache-airflow-providers-mysql==2.2.3
apache-airflow-providers-odbc==2.0.4
apache-airflow-providers-postgres==4.1.0
apache-airflow-providers-redis==2.0.4
apache-airflow-providers-sendgrid==2.0.4
apache-airflow-providers-sftp==2.6.0
apache-airflow-providers-slack==4.2.3
apache-airflow-providers-sqlite==2.1.3
apache-airflow-providers-ssh==2.4.4
</code></pre></div>
<h3 dir="auto">Deployment</h3>
<p dir="auto">Official Apache Airflow Helm Chart</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">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>