<p dir="auto">I'm encountering the same bug reported in <a href="https://issues.apache.org/jira/browse/AIRFLOW-3534" rel="nofollow">https://issues.apache.org/jira/browse/AIRFLOW-3534</a>, with airflow 1.10.12.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[2020-11-06 13:03:29,672] {pod_launcher.py:173} INFO - Event: fetcher-56104d81c54946a88ce3cd1cf4273477 had an event of type Pending
[2020-11-06 13:03:29,673] {pod_launcher.py:139} WARNING - Pod not yet started: fetcher-56104d81c54946a88ce3cd1cf4273477
[2020-11-06 13:03:30,681] {pod_launcher.py:173} INFO - Event: fetcher-56104d81c54946a88ce3cd1cf4273477 had an event of type Pending
[2020-11-06 13:03:30,681] {pod_launcher.py:139} WARNING - Pod not yet started: fetcher-56104d81c54946a88ce3cd1cf4273477
[2020-11-06 13:03:31,692] {pod_launcher.py:173} INFO - Event: fetcher-56104d81c54946a88ce3cd1cf4273477 had an event of type Pending
[2020-11-06 13:03:31,692] {pod_launcher.py:139} WARNING - Pod not yet started: fetcher-56104d81c54946a88ce3cd1cf4273477
[2020-11-06 13:03:32,702] {pod_launcher.py:173} INFO - Event: fetcher-56104d81c54946a88ce3cd1cf4273477 had an event of type Running
[2020-11-06 13:04:32,740] {taskinstance.py:1150} ERROR - ('Connection broken: IncompleteRead(0 bytes read)', IncompleteRead(0 bytes read))
Traceback (most recent call last):
  File &quot;/opt/bitnami/airflow/venv/lib/python3.6/site-packages/urllib3/response.py&quot;, line 696, in _update_chunk_length
    self.chunk_left = int(line, 16)
ValueError: invalid literal for int() with base 16: b''

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File &quot;/opt/bitnami/airflow/venv/lib/python3.6/site-packages/urllib3/response.py&quot;, line 436, in _error_catcher
    yield
  File &quot;/opt/bitnami/airflow/venv/lib/python3.6/site-packages/urllib3/response.py&quot;, line 763, in read_chunked
    self._update_chunk_length()
  File &quot;/opt/bitnami/airflow/venv/lib/python3.6/site-packages/urllib3/response.py&quot;, line 700, in _update_chunk_length
    raise httplib.IncompleteRead(line)
http.client.IncompleteRead: IncompleteRead(0 bytes read)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File &quot;/opt/bitnami/airflow/venv/lib/python3.6/site-packages/airflow/models/taskinstance.py&quot;, line 979, in _run_raw_task
    result = task_copy.execute(context=context)
  File &quot;/opt/bitnami/airflow/venv/lib/python3.6/site-packages/airflow/contrib/operators/kubernetes_pod_operator.py&quot;, line 284, in execute
    final_state, _, result = self.create_new_pod_for_operator(labels, launcher)
  File &quot;/opt/bitnami/airflow/venv/lib/python3.6/site-packages/airflow/contrib/operators/kubernetes_pod_operator.py&quot;, line 403, in create_new_pod_for_operator
    final_state, result = launcher.monitor_pod(pod=pod, get_logs=self.get_logs)
  File &quot;/opt/bitnami/airflow/venv/lib/python3.6/site-packages/airflow/kubernetes/pod_launcher.py&quot;, line 155, in monitor_pod
    for line in logs:
  File &quot;/opt/bitnami/airflow/venv/lib/python3.6/site-packages/urllib3/response.py&quot;, line 807, in __iter__
    for chunk in self.stream(decode_content=True):
  File &quot;/opt/bitnami/airflow/venv/lib/python3.6/site-packages/urllib3/response.py&quot;, line 571, in stream
    for line in self.read_chunked(amt, decode_content=decode_content):
  File &quot;/opt/bitnami/airflow/venv/lib/python3.6/site-packages/urllib3/response.py&quot;, line 792, in read_chunked
    self._original_response.close()
  File &quot;/opt/bitnami/python/lib/python3.6/contextlib.py&quot;, line 99, in __exit__
    self.gen.throw(type, value, traceback)
  File &quot;/opt/bitnami/airflow/venv/lib/python3.6/site-packages/urllib3/response.py&quot;, line 454, in _error_catcher
    raise ProtocolError(&quot;Connection broken: %r&quot; % e, e)
urllib3.exceptions.ProtocolError: ('Connection broken: IncompleteRead(0 bytes read)', IncompleteRead(0 bytes read))
[2020-11-06 13:04:32,743] {taskinstance.py:1194} INFO - Marking task as UP_FOR_RETRY. dag_id=..., task_id=..., execution_date=20201106T120000, start_date=20201106T130329, end_date=20201106T130432
[2020-11-06 13:04:34,641] {local_task_job.py:102} INFO - Task exited with return code 1"><pre class="notranslate"><code class="notranslate">[2020-11-06 13:03:29,672] {pod_launcher.py:173} INFO - Event: fetcher-56104d81c54946a88ce3cd1cf4273477 had an event of type Pending
[2020-11-06 13:03:29,673] {pod_launcher.py:139} WARNING - Pod not yet started: fetcher-56104d81c54946a88ce3cd1cf4273477
[2020-11-06 13:03:30,681] {pod_launcher.py:173} INFO - Event: fetcher-56104d81c54946a88ce3cd1cf4273477 had an event of type Pending
[2020-11-06 13:03:30,681] {pod_launcher.py:139} WARNING - Pod not yet started: fetcher-56104d81c54946a88ce3cd1cf4273477
[2020-11-06 13:03:31,692] {pod_launcher.py:173} INFO - Event: fetcher-56104d81c54946a88ce3cd1cf4273477 had an event of type Pending
[2020-11-06 13:03:31,692] {pod_launcher.py:139} WARNING - Pod not yet started: fetcher-56104d81c54946a88ce3cd1cf4273477
[2020-11-06 13:03:32,702] {pod_launcher.py:173} INFO - Event: fetcher-56104d81c54946a88ce3cd1cf4273477 had an event of type Running
[2020-11-06 13:04:32,740] {taskinstance.py:1150} ERROR - ('Connection broken: IncompleteRead(0 bytes read)', IncompleteRead(0 bytes read))
Traceback (most recent call last):
  File "/opt/bitnami/airflow/venv/lib/python3.6/site-packages/urllib3/response.py", line 696, in _update_chunk_length
    self.chunk_left = int(line, 16)
ValueError: invalid literal for int() with base 16: b''

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/bitnami/airflow/venv/lib/python3.6/site-packages/urllib3/response.py", line 436, in _error_catcher
    yield
  File "/opt/bitnami/airflow/venv/lib/python3.6/site-packages/urllib3/response.py", line 763, in read_chunked
    self._update_chunk_length()
  File "/opt/bitnami/airflow/venv/lib/python3.6/site-packages/urllib3/response.py", line 700, in _update_chunk_length
    raise httplib.IncompleteRead(line)
http.client.IncompleteRead: IncompleteRead(0 bytes read)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/bitnami/airflow/venv/lib/python3.6/site-packages/airflow/models/taskinstance.py", line 979, in _run_raw_task
    result = task_copy.execute(context=context)
  File "/opt/bitnami/airflow/venv/lib/python3.6/site-packages/airflow/contrib/operators/kubernetes_pod_operator.py", line 284, in execute
    final_state, _, result = self.create_new_pod_for_operator(labels, launcher)
  File "/opt/bitnami/airflow/venv/lib/python3.6/site-packages/airflow/contrib/operators/kubernetes_pod_operator.py", line 403, in create_new_pod_for_operator
    final_state, result = launcher.monitor_pod(pod=pod, get_logs=self.get_logs)
  File "/opt/bitnami/airflow/venv/lib/python3.6/site-packages/airflow/kubernetes/pod_launcher.py", line 155, in monitor_pod
    for line in logs:
  File "/opt/bitnami/airflow/venv/lib/python3.6/site-packages/urllib3/response.py", line 807, in __iter__
    for chunk in self.stream(decode_content=True):
  File "/opt/bitnami/airflow/venv/lib/python3.6/site-packages/urllib3/response.py", line 571, in stream
    for line in self.read_chunked(amt, decode_content=decode_content):
  File "/opt/bitnami/airflow/venv/lib/python3.6/site-packages/urllib3/response.py", line 792, in read_chunked
    self._original_response.close()
  File "/opt/bitnami/python/lib/python3.6/contextlib.py", line 99, in __exit__
    self.gen.throw(type, value, traceback)
  File "/opt/bitnami/airflow/venv/lib/python3.6/site-packages/urllib3/response.py", line 454, in _error_catcher
    raise ProtocolError("Connection broken: %r" % e, e)
urllib3.exceptions.ProtocolError: ('Connection broken: IncompleteRead(0 bytes read)', IncompleteRead(0 bytes read))
[2020-11-06 13:04:32,743] {taskinstance.py:1194} INFO - Marking task as UP_FOR_RETRY. dag_id=..., task_id=..., execution_date=20201106T120000, start_date=20201106T130329, end_date=20201106T130432
[2020-11-06 13:04:34,641] {local_task_job.py:102} INFO - Task exited with return code 1
</code></pre></div>
<p dir="auto">The bug goes away by setting <code class="notranslate">get_logs=False</code> in the KubernetesPodOperator. Reproduced with multiple dags and tasks.</p>
<h3 dir="auto">Apache Airflow version</h3>
<p dir="auto">2.2.3 (latest released)</p>
<h3 dir="auto">What happened</h3>
<p dir="auto">In the configuration file, we specified a <code class="notranslate">sql_alchemy_conn_cmd</code> so that the main sql alchemy connection is loaded from a command.  However, when using such a configuration and running any dag / task, we get the following error:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[2022-02-16, 06:14:09 UTC] {base_task_runner.py:117} INFO - Job 366: Subtask greet Traceback (most recent call last):
[2022-02-16, 06:14:09 UTC] {base_task_runner.py:117} INFO - Job 366: Subtask greet   File &quot;/u/peep/lib/python3.8/site-packages/sqlalchemy/engine/base.py&quot;, line 1276, in _execute_context
[2022-02-16, 06:14:09 UTC] {base_task_runner.py:117} INFO - Job 366: Subtask greet     self.dialect.do_execute(
[2022-02-16, 06:14:09 UTC] {base_task_runner.py:117} INFO - Job 366: Subtask greet   File &quot;/u/peep/lib/python3.8/site-packages/sqlalchemy/engine/default.py&quot;, line 608, in do_execute
[2022-02-16, 06:14:09 UTC] {base_task_runner.py:117} INFO - Job 366: Subtask greet     cursor.execute(statement, parameters)
[2022-02-16, 06:14:09 UTC] {base_task_runner.py:117} INFO - Job 366: Subtask greet sqlite3.OperationalError: no such table: dag_run"><pre class="notranslate"><code class="notranslate">[2022-02-16, 06:14:09 UTC] {base_task_runner.py:117} INFO - Job 366: Subtask greet Traceback (most recent call last):
[2022-02-16, 06:14:09 UTC] {base_task_runner.py:117} INFO - Job 366: Subtask greet   File "/u/peep/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1276, in _execute_context
[2022-02-16, 06:14:09 UTC] {base_task_runner.py:117} INFO - Job 366: Subtask greet     self.dialect.do_execute(
[2022-02-16, 06:14:09 UTC] {base_task_runner.py:117} INFO - Job 366: Subtask greet   File "/u/peep/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 608, in do_execute
[2022-02-16, 06:14:09 UTC] {base_task_runner.py:117} INFO - Job 366: Subtask greet     cursor.execute(statement, parameters)
[2022-02-16, 06:14:09 UTC] {base_task_runner.py:117} INFO - Job 366: Subtask greet sqlite3.OperationalError: no such table: dag_run
</code></pre></div>
<h3 dir="auto">What you expected to happen</h3>
<p dir="auto">Tasks should run without error when using <code class="notranslate">sql_alchemy_conn_cmd</code></p>
<h3 dir="auto">How to reproduce</h3>
<p dir="auto">Use a sql_alchemy_conn_cmd file, and any task that you run will try to use sqlite instead of the configured database connection and cause all sorts of havoc.</p>
<h3 dir="auto">Operating System</h3>
<p dir="auto">focal 20.04.3</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-celery==2.1.0
apache-airflow-providers-docker==2.3.0
apache-airflow-providers-ftp==2.0.1
apache-airflow-providers-http==2.0.1
apache-airflow-providers-imap==2.0.1
apache-airflow-providers-jdbc==2.0.1
apache-airflow-providers-mysql==2.1.1
apache-airflow-providers-odbc==2.0.1
apache-airflow-providers-oracle==2.0.1
apache-airflow-providers-redis==2.0.1
apache-airflow-providers-slack==4.1.0
apache-airflow-providers-sqlite==2.0.1
apache-airflow-providers-vertica==2.0.1```

### Deployment

Virtualenv installation

### Deployment details

apache installed on a four ec2 instances in aws (2 master, 2 worker).

### Anything else

This problem occurs because of commit a90878cf660ffe73973b4e4487c1e691cc212925 where the `include_cmds` flag is set to `False`.  

### Are you willing to submit PR?

- [X] Yes I am willing to submit a PR!

### Code of Conduct

- [X] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)"><pre lang="apache-airflow-providers-amazon==2.2.0" class="notranslate"><code class="notranslate">apache-airflow-providers-celery==2.1.0
apache-airflow-providers-docker==2.3.0
apache-airflow-providers-ftp==2.0.1
apache-airflow-providers-http==2.0.1
apache-airflow-providers-imap==2.0.1
apache-airflow-providers-jdbc==2.0.1
apache-airflow-providers-mysql==2.1.1
apache-airflow-providers-odbc==2.0.1
apache-airflow-providers-oracle==2.0.1
apache-airflow-providers-redis==2.0.1
apache-airflow-providers-slack==4.1.0
apache-airflow-providers-sqlite==2.0.1
apache-airflow-providers-vertica==2.0.1```

### Deployment

Virtualenv installation

### Deployment details

apache installed on a four ec2 instances in aws (2 master, 2 worker).

### Anything else

This problem occurs because of commit a90878cf660ffe73973b4e4487c1e691cc212925 where the `include_cmds` flag is set to `False`.  

### Are you willing to submit PR?

- [X] Yes I am willing to submit a PR!

### Code of Conduct

- [X] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
</code></pre></div>