<p dir="auto"><strong>Apache Airflow version</strong>:<br>
1.10.10</p>
<p dir="auto"><strong>What happened</strong>:</p>
<p dir="auto">Hi All,<br>
when trying to trigger my dag which has a two-level nested subdags from another dag</p>
<p dir="auto">the task is failing with an error that one of the subdags key already exist although the dag is eventually get triggered,</p>
<p dir="auto">from the airflow code, I saw that when calling main_dag.subdags it returns all the subdags inside including the ones that are nested on its subdags,</p>
<p dir="auto">so when I run the TriggerDagRunOperator it tries to trigger the second level subdags twice due to this airflow code:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="    while dags_to_trigger:
        dag = dags_to_trigger.pop()
        trigger = dag.create_dagrun(
            run_id=run_id,
            execution_date=execution_date,
            state=State.RUNNING,
            conf=run_conf,
            external_trigger=True,
        )
        triggers.append(trigger)
        if dag.subdags:
            dags_to_trigger.extend(dag.subdags)"><pre class="notranslate">    <span class="pl-k">while</span> <span class="pl-s1">dags_to_trigger</span>:
        <span class="pl-s1">dag</span> <span class="pl-c1">=</span> <span class="pl-s1">dags_to_trigger</span>.<span class="pl-en">pop</span>()
        <span class="pl-s1">trigger</span> <span class="pl-c1">=</span> <span class="pl-s1">dag</span>.<span class="pl-en">create_dagrun</span>(
            <span class="pl-s1">run_id</span><span class="pl-c1">=</span><span class="pl-s1">run_id</span>,
            <span class="pl-s1">execution_date</span><span class="pl-c1">=</span><span class="pl-s1">execution_date</span>,
            <span class="pl-s1">state</span><span class="pl-c1">=</span><span class="pl-v">State</span>.<span class="pl-v">RUNNING</span>,
            <span class="pl-s1">conf</span><span class="pl-c1">=</span><span class="pl-s1">run_conf</span>,
            <span class="pl-s1">external_trigger</span><span class="pl-c1">=</span><span class="pl-c1">True</span>,
        )
        <span class="pl-s1">triggers</span>.<span class="pl-en">append</span>(<span class="pl-s1">trigger</span>)
        <span class="pl-k">if</span> <span class="pl-s1">dag</span>.<span class="pl-s1">subdags</span>:
            <span class="pl-s1">dags_to_trigger</span>.<span class="pl-en">extend</span>(<span class="pl-s1">dag</span>.<span class="pl-s1">subdags</span>)</pre></div>
<p dir="auto">under airflow/api/common/experimental/trigger_dag.py:91</p>
<p dir="auto"><strong>What you expected to happen</strong>:</p>
<p dir="auto">the TriggerDagRunOperator should finish with success state</p>
<p dir="auto"><strong>How to reproduce it</strong>:</p>
<p dir="auto">Trigger Dag code:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="from airflow import DAG
from airflow.operators.dagrun_operator import TriggerDagRunOperator
from airflow.utils.dates import days_ago

interval = '30 8 * * *'

default_args = {
    'owner': 'airflow',
    &quot;depends_on_past&quot;: False,
    &quot;start_date&quot;: days_ago(1),
    &quot;catchup&quot;: False,
}

with DAG(&quot;TriggerExample&quot;,
         default_args=default_args,
         catchup=False,
         schedule_interval=interval,
         max_active_runs=1,
         ) as dag:
    dag_trigger_task = TriggerDagRunOperator(
        task_id='trigger_dag',
        trigger_dag_id='TriggeredDag',
        execution_date='{{ ds }}')"><pre class="notranslate"><span class="pl-k">from</span> <span class="pl-s1">airflow</span> <span class="pl-k">import</span> <span class="pl-v">DAG</span>
<span class="pl-k">from</span> <span class="pl-s1">airflow</span>.<span class="pl-s1">operators</span>.<span class="pl-s1">dagrun_operator</span> <span class="pl-k">import</span> <span class="pl-v">TriggerDagRunOperator</span>
<span class="pl-k">from</span> <span class="pl-s1">airflow</span>.<span class="pl-s1">utils</span>.<span class="pl-s1">dates</span> <span class="pl-k">import</span> <span class="pl-s1">days_ago</span>

<span class="pl-s1">interval</span> <span class="pl-c1">=</span> <span class="pl-s">'30 8 * * *'</span>

<span class="pl-s1">default_args</span> <span class="pl-c1">=</span> {
    <span class="pl-s">'owner'</span>: <span class="pl-s">'airflow'</span>,
    <span class="pl-s">"depends_on_past"</span>: <span class="pl-c1">False</span>,
    <span class="pl-s">"start_date"</span>: <span class="pl-en">days_ago</span>(<span class="pl-c1">1</span>),
    <span class="pl-s">"catchup"</span>: <span class="pl-c1">False</span>,
}

<span class="pl-k">with</span> <span class="pl-v">DAG</span>(<span class="pl-s">"TriggerExample"</span>,
         <span class="pl-s1">default_args</span><span class="pl-c1">=</span><span class="pl-s1">default_args</span>,
         <span class="pl-s1">catchup</span><span class="pl-c1">=</span><span class="pl-c1">False</span>,
         <span class="pl-s1">schedule_interval</span><span class="pl-c1">=</span><span class="pl-s1">interval</span>,
         <span class="pl-s1">max_active_runs</span><span class="pl-c1">=</span><span class="pl-c1">1</span>,
         ) <span class="pl-k">as</span> <span class="pl-s1">dag</span>:
    <span class="pl-s1">dag_trigger_task</span> <span class="pl-c1">=</span> <span class="pl-v">TriggerDagRunOperator</span>(
        <span class="pl-s1">task_id</span><span class="pl-c1">=</span><span class="pl-s">'trigger_dag'</span>,
        <span class="pl-s1">trigger_dag_id</span><span class="pl-c1">=</span><span class="pl-s">'TriggeredDag'</span>,
        <span class="pl-s1">execution_date</span><span class="pl-c1">=</span><span class="pl-s">'{{ ds }}'</span>)</pre></div>
<p dir="auto">Triggered Dag code:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="from airflow import DAG
from airflow.operators.bash_operator import BashOperator
from airflow.operators.subdag_operator import SubDagOperator
from airflow.utils.dates import days_ago

default_args = {
    'owner': 'airflow',
    &quot;depends_on_past&quot;: False,
    &quot;start_date&quot;: days_ago(1),
    &quot;catchup&quot;: False,
}


def create_sub_dag2(parent_dag, name):
    dag_name = &quot;{}.{}&quot;.format(parent_dag.dag_id, name)
    with DAG(dag_name,
             default_args=default_args,
             catchup=False,
             schedule_interval=None,
             max_active_runs=1,
             ) as dag:

        BashOperator(
            task_id='print_date',
            bash_command='date',
        )

    return SubDagOperator(
        subdag=dag,
        task_id=name)


def create_sub_dag(parent_dag, name):
    dag_name = &quot;{}.{}&quot;.format(parent_dag.dag_id, name)
    with DAG(dag_name,
             default_args=default_args,
             catchup=False,
             schedule_interval=None,
             max_active_runs=1,
             ) as dag:
        t1 = BashOperator(
            task_id='print_date',
            bash_command='date',
        )

        t2 = create_sub_dag2(dag, &quot;sub2&quot;)

        t1 &gt;&gt; t2

    return SubDagOperator(
        subdag=dag,
        task_id=name)


with DAG(&quot;TriggeredDag&quot;,
         default_args=default_args,
         catchup=False,
         schedule_interval=None,
         max_active_runs=1,
         ) as dag:
    t1 = BashOperator(
        task_id='print_date',
        bash_command='date',
    )

    t2 = create_sub_dag(dag, &quot;sub1&quot;)

    t1 &gt;&gt; t2"><pre class="notranslate"><span class="pl-k">from</span> <span class="pl-s1">airflow</span> <span class="pl-k">import</span> <span class="pl-v">DAG</span>
<span class="pl-k">from</span> <span class="pl-s1">airflow</span>.<span class="pl-s1">operators</span>.<span class="pl-s1">bash_operator</span> <span class="pl-k">import</span> <span class="pl-v">BashOperator</span>
<span class="pl-k">from</span> <span class="pl-s1">airflow</span>.<span class="pl-s1">operators</span>.<span class="pl-s1">subdag_operator</span> <span class="pl-k">import</span> <span class="pl-v">SubDagOperator</span>
<span class="pl-k">from</span> <span class="pl-s1">airflow</span>.<span class="pl-s1">utils</span>.<span class="pl-s1">dates</span> <span class="pl-k">import</span> <span class="pl-s1">days_ago</span>

<span class="pl-s1">default_args</span> <span class="pl-c1">=</span> {
    <span class="pl-s">'owner'</span>: <span class="pl-s">'airflow'</span>,
    <span class="pl-s">"depends_on_past"</span>: <span class="pl-c1">False</span>,
    <span class="pl-s">"start_date"</span>: <span class="pl-en">days_ago</span>(<span class="pl-c1">1</span>),
    <span class="pl-s">"catchup"</span>: <span class="pl-c1">False</span>,
}


<span class="pl-k">def</span> <span class="pl-en">create_sub_dag2</span>(<span class="pl-s1">parent_dag</span>, <span class="pl-s1">name</span>):
    <span class="pl-s1">dag_name</span> <span class="pl-c1">=</span> <span class="pl-s">"{}.{}"</span>.<span class="pl-en">format</span>(<span class="pl-s1">parent_dag</span>.<span class="pl-s1">dag_id</span>, <span class="pl-s1">name</span>)
    <span class="pl-k">with</span> <span class="pl-v">DAG</span>(<span class="pl-s1">dag_name</span>,
             <span class="pl-s1">default_args</span><span class="pl-c1">=</span><span class="pl-s1">default_args</span>,
             <span class="pl-s1">catchup</span><span class="pl-c1">=</span><span class="pl-c1">False</span>,
             <span class="pl-s1">schedule_interval</span><span class="pl-c1">=</span><span class="pl-c1">None</span>,
             <span class="pl-s1">max_active_runs</span><span class="pl-c1">=</span><span class="pl-c1">1</span>,
             ) <span class="pl-k">as</span> <span class="pl-s1">dag</span>:

        <span class="pl-v">BashOperator</span>(
            <span class="pl-s1">task_id</span><span class="pl-c1">=</span><span class="pl-s">'print_date'</span>,
            <span class="pl-s1">bash_command</span><span class="pl-c1">=</span><span class="pl-s">'date'</span>,
        )

    <span class="pl-k">return</span> <span class="pl-v">SubDagOperator</span>(
        <span class="pl-s1">subdag</span><span class="pl-c1">=</span><span class="pl-s1">dag</span>,
        <span class="pl-s1">task_id</span><span class="pl-c1">=</span><span class="pl-s1">name</span>)


<span class="pl-k">def</span> <span class="pl-en">create_sub_dag</span>(<span class="pl-s1">parent_dag</span>, <span class="pl-s1">name</span>):
    <span class="pl-s1">dag_name</span> <span class="pl-c1">=</span> <span class="pl-s">"{}.{}"</span>.<span class="pl-en">format</span>(<span class="pl-s1">parent_dag</span>.<span class="pl-s1">dag_id</span>, <span class="pl-s1">name</span>)
    <span class="pl-k">with</span> <span class="pl-v">DAG</span>(<span class="pl-s1">dag_name</span>,
             <span class="pl-s1">default_args</span><span class="pl-c1">=</span><span class="pl-s1">default_args</span>,
             <span class="pl-s1">catchup</span><span class="pl-c1">=</span><span class="pl-c1">False</span>,
             <span class="pl-s1">schedule_interval</span><span class="pl-c1">=</span><span class="pl-c1">None</span>,
             <span class="pl-s1">max_active_runs</span><span class="pl-c1">=</span><span class="pl-c1">1</span>,
             ) <span class="pl-k">as</span> <span class="pl-s1">dag</span>:
        <span class="pl-s1">t1</span> <span class="pl-c1">=</span> <span class="pl-v">BashOperator</span>(
            <span class="pl-s1">task_id</span><span class="pl-c1">=</span><span class="pl-s">'print_date'</span>,
            <span class="pl-s1">bash_command</span><span class="pl-c1">=</span><span class="pl-s">'date'</span>,
        )

        <span class="pl-s1">t2</span> <span class="pl-c1">=</span> <span class="pl-en">create_sub_dag2</span>(<span class="pl-s1">dag</span>, <span class="pl-s">"sub2"</span>)

        <span class="pl-s1">t1</span> <span class="pl-c1">&gt;&gt;</span> <span class="pl-s1">t2</span>

    <span class="pl-k">return</span> <span class="pl-v">SubDagOperator</span>(
        <span class="pl-s1">subdag</span><span class="pl-c1">=</span><span class="pl-s1">dag</span>,
        <span class="pl-s1">task_id</span><span class="pl-c1">=</span><span class="pl-s1">name</span>)


<span class="pl-k">with</span> <span class="pl-v">DAG</span>(<span class="pl-s">"TriggeredDag"</span>,
         <span class="pl-s1">default_args</span><span class="pl-c1">=</span><span class="pl-s1">default_args</span>,
         <span class="pl-s1">catchup</span><span class="pl-c1">=</span><span class="pl-c1">False</span>,
         <span class="pl-s1">schedule_interval</span><span class="pl-c1">=</span><span class="pl-c1">None</span>,
         <span class="pl-s1">max_active_runs</span><span class="pl-c1">=</span><span class="pl-c1">1</span>,
         ) <span class="pl-k">as</span> <span class="pl-s1">dag</span>:
    <span class="pl-s1">t1</span> <span class="pl-c1">=</span> <span class="pl-v">BashOperator</span>(
        <span class="pl-s1">task_id</span><span class="pl-c1">=</span><span class="pl-s">'print_date'</span>,
        <span class="pl-s1">bash_command</span><span class="pl-c1">=</span><span class="pl-s">'date'</span>,
    )

    <span class="pl-s1">t2</span> <span class="pl-c1">=</span> <span class="pl-en">create_sub_dag</span>(<span class="pl-s1">dag</span>, <span class="pl-s">"sub1"</span>)

    <span class="pl-s1">t1</span> <span class="pl-c1">&gt;&gt;</span> <span class="pl-s1">t2</span></pre></div>
<p dir="auto"><strong>Failed operator log</strong>:</p>
<p dir="auto">[2021-04-20 20:11:18,501] {taskinstance.py:900} INFO - Executing &lt;Task(TriggerDagRunOperator): trigger_dag&gt; on 2021-04-19T08:30:00+00:00<br>
[2021-04-20 20:11:18,503] {standard_task_runner.py:53} INFO - Started process 62669 to run task<br>
[2021-04-20 20:11:18,633] {logging_mixin.py:112} INFO - Running %s on host %s &lt;TaskInstance: TriggerExample.trigger_dag 2021-04-19T08:30:00+00:00 [running]&gt; ip-192-168-1-10.ec2.internal<br>
[2021-04-20 20:11:18,692] {logging_mixin.py:112} INFO - [2021-04-20 20:11:18,691] {dagbag.py:396} INFO - Filling up the DagBag from /*****/airflow/dags/triggeredDag.py<br>
[2021-04-20 20:11:18,880] {taskinstance.py:1145} ERROR - (psycopg2.errors.UniqueViolation) duplicate key value violates unique constraint "dag_run_dag_id_run_id_key"<br>
DETAIL:  Key (dag_id, run_id)=(TriggeredDag.sub1.sub2, trig__2021-04-19) already exists.</p>
<p dir="auto">[SQL: INSERT INTO dag_run (dag_id, execution_date, start_date, end_date, state, run_id, external_trigger, conf) VALUES (%(dag_id)s, %(execution_date)s, %(start_date)s, %(end_date)s, %(state)s, %(run_id)s, %(external_trigger)s, %(conf)s) RETURNING dag_run.id]<br>
[parameters: {'dag_id': 'TriggeredDag.sub1.sub2', 'execution_date': &lt;Pendulum [2021-04-19T00:00:00+00:00]&gt;, 'start_date': datetime.datetime(2021, 4, 20, 17, 11, 18, 875681, tzinfo=&lt;Timezone [UTC]&gt;), 'end_date': None, 'state': 'running', 'run_id': 'trig__2021-04-19', 'external_trigger': True, 'conf': None}]</p>
<p dir="auto">am I missing something? or is this a real bug?</p>
<p dir="auto"><strong>Apache Airflow version</strong>: 2.0.0<br>
<strong>Environment</strong>: Ubuntu 20.04 LTS, Python 3.8.6 via pyenv, in a virtual env via Poetry</p>
<ul dir="auto">
<li><strong>OS</strong> (e.g. from /etc/os-release): 20.04.1 LTS (Focal Fossa)</li>
<li><strong>Kernel</strong> (e.g. <code class="notranslate">uname -a</code>): Linux DESKTOP-QBFDUA0 4.19.104-microsoft-standard <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="69689814" data-permission-text="Title is private" data-url="https://github.com/apache/airflow/issues/1" data-hovercard-type="pull_request" data-hovercard-url="/apache/airflow/pull/1/hovercard" href="https://github.com/apache/airflow/pull/1">#1</a> SMP Wed Feb 19 06:37:35 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux</li>
<li><strong>Install tools</strong>: Following steps in <a href="https://airflow.apache.org/docs/apache-airflow/stable/start.html" rel="nofollow">https://airflow.apache.org/docs/apache-airflow/stable/start.html</a></li>
</ul>
<p dir="auto"><strong>What happened</strong>:</p>
<p dir="auto">Following the quick start (<a href="https://airflow.apache.org/docs/apache-airflow/stable/start.html" rel="nofollow">https://airflow.apache.org/docs/apache-airflow/stable/start.html</a>), I encountered an error. My steps:</p>
<ul dir="auto">
<li>Run <code class="notranslate">pyenv global 3.8.6</code> to set my Python version to 3.8.6, since I see that Airflow doesn't yet support 3.9 explicitly.</li>
<li>Create an empty directory to hold a test project for Airflow. I intend to keep my Poetry config, DAGs, and any files the quickstart creates here.</li>
<li>cd into that directory.</li>
<li>Run <code class="notranslate">poetry init</code> to begin the project. During the interactive prompt, add <code class="notranslate">apache-airflow</code> as a dependency.</li>
<li>Run <code class="notranslate">poetry install</code> to install the Airflow dependency.</li>
<li>Run <code class="notranslate">poetry run airflow db init</code> to run the Airflow init command in a new virtual env managed by Poetry.</li>
</ul>
<p dir="auto">I saw the following error at the end:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="TypeError: object of type 'map' has no len()"><pre class="notranslate"><code class="notranslate">TypeError: object of type 'map' has no len()
</code></pre></div>
<p dir="auto">The error was at the end of a long stack trace. The complete output of running that command was:</p>
<details>
DB: sqlite:///./airflow.db
[2021-01-15 19:51:32,719] {db.py:678} INFO - Creating tables
INFO  [alembic.runtime.migration] Context impl SQLiteImpl.
INFO  [alembic.runtime.migration] Will assume non-transactional DDL.
INFO  [alembic.runtime.migration] Running upgrade 849da589634d -&gt; 2c6edca13270, Resource based permissions.
Traceback (most recent call last):
  File "/home/matt/.cache/pypoetry/virtualenvs/airflow-test-nj8CH3s_-py3.8/bin/airflow", line 8, in 
    sys.exit(main())
  File "/home/matt/.cache/pypoetry/virtualenvs/airflow-test-nj8CH3s_-py3.8/lib/python3.8/site-packages/airflow/__main__.py", line 40, in main
    args.func(args)
  File "/home/matt/.cache/pypoetry/virtualenvs/airflow-test-nj8CH3s_-py3.8/lib/python3.8/site-packages/airflow/cli/cli_parser.py", line 48, in command
    return func(*args, **kwargs)
  File "/home/matt/.cache/pypoetry/virtualenvs/airflow-test-nj8CH3s_-py3.8/lib/python3.8/site-packages/airflow/cli/commands/db_command.py", line 31, in initdb
    db.initdb()
  File "/home/matt/.cache/pypoetry/virtualenvs/airflow-test-nj8CH3s_-py3.8/lib/python3.8/site-packages/airflow/utils/db.py", line 549, in initdb
    upgradedb()
  File "/home/matt/.cache/pypoetry/virtualenvs/airflow-test-nj8CH3s_-py3.8/lib/python3.8/site-packages/airflow/utils/db.py", line 688, in upgradedb
    command.upgrade(config, 'heads')
  File "/home/matt/.cache/pypoetry/virtualenvs/airflow-test-nj8CH3s_-py3.8/lib/python3.8/site-packages/alembic/command.py", line 298, in upgrade
    script.run_env()
  File "/home/matt/.cache/pypoetry/virtualenvs/airflow-test-nj8CH3s_-py3.8/lib/python3.8/site-packages/alembic/script/base.py", line 489, in run_env
    util.load_python_file(self.dir, "env.py")
  File "/home/matt/.cache/pypoetry/virtualenvs/airflow-test-nj8CH3s_-py3.8/lib/python3.8/site-packages/alembic/util/pyfiles.py", line 98, in load_python_file
    module = load_module_py(module_id, path)
  File "/home/matt/.cache/pypoetry/virtualenvs/airflow-test-nj8CH3s_-py3.8/lib/python3.8/site-packages/alembic/util/compat.py", line 184, in load_module_py
    spec.loader.exec_module(module)
  File "", line 783, in exec_module
  File "", line 219, in _call_with_frames_removed
  File "/home/matt/.cache/pypoetry/virtualenvs/airflow-test-nj8CH3s_-py3.8/lib/python3.8/site-packages/airflow/migrations/env.py", line 108, in 
    run_migrations_online()
  File "/home/matt/.cache/pypoetry/virtualenvs/airflow-test-nj8CH3s_-py3.8/lib/python3.8/site-packages/airflow/migrations/env.py", line 102, in run_migrations_online
    context.run_migrations()
  File "", line 8, in run_migrations
  File "/home/matt/.cache/pypoetry/virtualenvs/airflow-test-nj8CH3s_-py3.8/lib/python3.8/site-packages/alembic/runtime/environment.py", line 846, in run_migrations
    self.get_context().run_migrations(**kw)
  File "/home/matt/.cache/pypoetry/virtualenvs/airflow-test-nj8CH3s_-py3.8/lib/python3.8/site-packages/alembic/runtime/migration.py", line 522, in run_migrations
    step.migration_fn(**kw)
  File "/home/matt/.cache/pypoetry/virtualenvs/airflow-test-nj8CH3s_-py3.8/lib/python3.8/site-packages/airflow/migrations/versions/2c6edca13270_resource_based_permissions.py", line 310, in upgrade
    remap_permissions()
  File "/home/matt/.cache/pypoetry/virtualenvs/airflow-test-nj8CH3s_-py3.8/lib/python3.8/site-packages/airflow/migrations/versions/2c6edca13270_resource_based_permissions.py", line 287, in remap_permissions
    appbuilder = create_app(config={'FAB_UPDATE_PERMS': False}).appbuilder
  File "/home/matt/.cache/pypoetry/virtualenvs/airflow-test-nj8CH3s_-py3.8/lib/python3.8/site-packages/airflow/www/app.py", line 113, in create_app
    init_appbuilder(flask_app)
  File "/home/matt/.cache/pypoetry/virtualenvs/airflow-test-nj8CH3s_-py3.8/lib/python3.8/site-packages/airflow/www/extensions/init_appbuilder.py", line 26, in init_appbuilder
    from airflow.www.security import AirflowSecurityManager
  File "/home/matt/.cache/pypoetry/virtualenvs/airflow-test-nj8CH3s_-py3.8/lib/python3.8/site-packages/airflow/www/security.py", line 24, in 
    from flask_appbuilder.security.sqla.manager import SecurityManager
  File "/home/matt/.cache/pypoetry/virtualenvs/airflow-test-nj8CH3s_-py3.8/lib/python3.8/site-packages/flask_appbuilder/security/sqla/manager.py", line 19, in 
    from ..manager import BaseSecurityManager
  File "/home/matt/.cache/pypoetry/virtualenvs/airflow-test-nj8CH3s_-py3.8/lib/python3.8/site-packages/flask_appbuilder/security/manager.py", line 13, in 
    from flask_openid import OpenID
  File "/home/matt/.cache/pypoetry/virtualenvs/airflow-test-nj8CH3s_-py3.8/lib/python3.8/site-packages/flask_openid.py", line 26, in 
    from openid.store.filestore import FileOpenIDStore
  File "/home/matt/.cache/pypoetry/virtualenvs/airflow-test-nj8CH3s_-py3.8/lib/python3.8/site-packages/openid/__init__.py", line 52, in 
    if len(version_info) != 3:
TypeError: object of type 'map' has no len()
</details>
<p dir="auto">(sorry, code formatting doesn't appear to work with <code class="notranslate">&lt;details&gt;</code>)</p>
<p dir="auto">Notably, if I repeat the above steps except that instead of using pyenv to control my Python version and Poetry to control a virtual environment, I use pyenv to control my Python version <em>but do not</em> use a virtual environment, instead installing the Airflow dependency to my Python 3.8.6 shim managed by pyenv, it works. I can run <code class="notranslate">airflow db init</code> successfully:</p>
<details>
~ &gt; mkdir airflow-test-no-virtual-env
~ &gt; export AIRFLOW_HOME=~/airflow-test-no-virtual-env/
~ &gt; pip install apache-airflow
Collecting apache-airflow
  Downloading apache_airflow-2.0.0-py3-none-any.whl (4.5 MB)
     |████████████████████████████████| 4.5 MB 3.9 MB/s
Collecting jsonschema~=3.0
  Downloading jsonschema-3.2.0-py2.py3-none-any.whl (56 kB)
     |████████████████████████████████| 56 kB 6.2 MB/s
Collecting dill&lt;0.4,&gt;=0.2.2
  Downloading dill-0.3.3-py2.py3-none-any.whl (81 kB)
     |████████████████████████████████| 81 kB 13.4 MB/s
Collecting connexion[flask,swagger-ui]&lt;3,&gt;=2.6.0
  Downloading connexion-2.7.0-py2.py3-none-any.whl (77 kB)
     |████████████████████████████████| 77 kB 9.6 MB/s
Collecting gunicorn&lt;20.0,&gt;=19.5.0
  Downloading gunicorn-19.10.0-py2.py3-none-any.whl (113 kB)
     |████████████████████████████████| 113 kB 80.3 MB/s
Collecting python-nvd3~=0.15.0
  Downloading python-nvd3-0.15.0.tar.gz (31 kB)
Collecting flask-caching&lt;2.0.0,&gt;=1.5.0
  Downloading Flask_Caching-1.9.0-py2.py3-none-any.whl (33 kB)
Collecting funcsigs&lt;2.0.0,&gt;=1.0.0
  Downloading funcsigs-1.0.2-py2.py3-none-any.whl (17 kB)
Collecting flask-appbuilder~=3.1.1
  Downloading Flask_AppBuilder-3.1.1-py3-none-any.whl (1.7 MB)
     |████████████████████████████████| 1.7 MB 62.0 MB/s
Collecting setproctitle&lt;2,&gt;=1.1.8
  Downloading setproctitle-1.2.1-cp38-cp38-manylinux1_x86_64.whl (36 kB)
Collecting tzlocal&lt;2.0.0,&gt;=1.4
  Downloading tzlocal-1.5.1.tar.gz (16 kB)
Collecting apache-airflow-providers-sqlite
  Downloading apache_airflow_providers_sqlite-1.0.0-py3-none-any.whl (15 kB)
Collecting thrift&gt;=0.9.2
  Downloading thrift-0.13.0.tar.gz (59 kB)
     |████████████████████████████████| 59 kB 11.2 MB/s
Collecting apache-airflow-providers-ftp
  Downloading apache_airflow_providers_ftp-1.0.0-py3-none-any.whl (17 kB)
Collecting python-daemon&gt;=2.1.1
  Downloading python_daemon-2.2.4-py2.py3-none-any.whl (35 kB)
Collecting rich==9.2.0
  Downloading rich-9.2.0-py3-none-any.whl (164 kB)
     |████████████████████████████████| 164 kB 68.3 MB/s
Collecting apache-airflow-providers-http
  Downloading apache_airflow_providers_http-1.0.0-py3-none-any.whl (24 kB)
Collecting psutil&lt;6.0.0,&gt;=4.2.0
  Downloading psutil-5.8.0-cp38-cp38-manylinux2010_x86_64.whl (296 kB)
     |████████████████████████████████| 296 kB 66.5 MB/s
Collecting werkzeug&gt;=1.0.1,~=1.0
  Downloading Werkzeug-1.0.1-py2.py3-none-any.whl (298 kB)
     |████████████████████████████████| 298 kB 94.3 MB/s
Collecting croniter&lt;0.4,&gt;=0.3.17
  Downloading croniter-0.3.37-py2.py3-none-any.whl (13 kB)
Collecting colorlog==4.0.2
  Downloading colorlog-4.0.2-py2.py3-none-any.whl (17 kB)
Collecting python-dateutil&lt;3,&gt;=2.3
  Using cached python_dateutil-2.8.1-py2.py3-none-any.whl (227 kB)
Collecting termcolor&gt;=1.1.0
  Downloading termcolor-1.1.0.tar.gz (3.9 kB)
Collecting argcomplete~=1.10
  Downloading argcomplete-1.12.2-py2.py3-none-any.whl (38 kB)
Collecting importlib-resources~=1.4
  Downloading importlib_resources-1.5.0-py2.py3-none-any.whl (21 kB)
Collecting flask&lt;2.0,&gt;=1.1.0
  Downloading Flask-1.1.2-py2.py3-none-any.whl (94 kB)
     |████████████████████████████████| 94 kB 4.3 MB/s
Collecting sqlalchemy-jsonfield~=1.0
  Downloading SQLAlchemy_JSONField-1.0.0-py3-none-any.whl (10 kB)
Collecting iso8601&gt;=0.1.12
  Downloading iso8601-0.1.13-py2.py3-none-any.whl (9.3 kB)
Collecting cattrs&lt;2.0,&gt;=1.0; python_version &gt; "3.6"
  Downloading cattrs-1.1.2-py3-none-any.whl (17 kB)
Collecting flask-wtf&lt;0.15,&gt;=0.14.3
  Downloading Flask_WTF-0.14.3-py2.py3-none-any.whl (13 kB)
Collecting marshmallow-oneofschema&gt;=2.0.1
  Downloading marshmallow_oneofschema-2.1.0-py2.py3-none-any.whl (5.7 kB)
Collecting tenacity~=6.2.0
  Downloading tenacity-6.2.0-py2.py3-none-any.whl (24 kB)
Collecting requests&lt;2.24.0,&gt;=2.20.0
  Downloading requests-2.23.0-py2.py3-none-any.whl (58 kB)
     |████████████████████████████████| 58 kB 8.7 MB/s
Collecting graphviz&gt;=0.12
  Downloading graphviz-0.16-py2.py3-none-any.whl (19 kB)
Collecting json-merge-patch==0.2
  Downloading json-merge-patch-0.2.tar.gz (3.1 kB)
Collecting lazy-object-proxy&lt;1.5.0
  Downloading lazy_object_proxy-1.4.3-cp38-cp38-manylinux1_x86_64.whl (58 kB)
     |████████████████████████████████| 58 kB 8.1 MB/s
Collecting python-slugify&lt;5.0,&gt;=3.0.0
  Downloading python-slugify-4.0.1.tar.gz (11 kB)
Collecting importlib-metadata~=1.7; python_version &lt; "3.9"
  Downloading importlib_metadata-1.7.0-py2.py3-none-any.whl (31 kB)
Collecting pendulum~=2.0
  Downloading pendulum-2.1.2-cp38-cp38-manylinux1_x86_64.whl (155 kB)
     |████████████████████████████████| 155 kB 71.0 MB/s
Collecting cryptography&gt;=0.9.3
  Downloading cryptography-3.3.1-cp36-abi3-manylinux2010_x86_64.whl (2.6 MB)
     |████████████████████████████████| 2.6 MB 73.6 MB/s
Collecting attrs&lt;21.0,&gt;=20.0
  Downloading attrs-20.3.0-py2.py3-none-any.whl (49 kB)
     |████████████████████████████████| 49 kB 9.4 MB/s
Collecting flask-login&lt;0.5,&gt;=0.3
  Downloading Flask-Login-0.4.1.tar.gz (14 kB)
Collecting markupsafe&lt;2.0,&gt;=1.1.1
  Downloading MarkupSafe-1.1.1-cp38-cp38-manylinux1_x86_64.whl (32 kB)
Collecting lockfile&gt;=0.12.2
  Downloading lockfile-0.12.2-py2.py3-none-any.whl (13 kB)
Collecting urllib3&lt;1.26
  Downloading urllib3-1.25.11-py2.py3-none-any.whl (127 kB)
     |████████████████████████████████| 127 kB 89.0 MB/s
Collecting itsdangerous&gt;=1.1.0
  Downloading itsdangerous-1.1.0-py2.py3-none-any.whl (16 kB)
Collecting unicodecsv&gt;=0.14.1
  Downloading unicodecsv-0.14.1.tar.gz (10 kB)
Collecting alembic&lt;2.0,&gt;=1.2
  Downloading alembic-1.4.3-py2.py3-none-any.whl (159 kB)
     |████████████████████████████████| 159 kB 82.1 MB/s
Collecting tabulate&lt;0.9,&gt;=0.7.5
  Downloading tabulate-0.8.7-py3-none-any.whl (24 kB)
Collecting pygments&lt;3.0,&gt;=2.0.1
  Downloading Pygments-2.7.4-py3-none-any.whl (950 kB)
     |████████████████████████████████| 950 kB 62.8 MB/s
Collecting cached-property~=1.5
  Downloading cached_property-1.5.2-py2.py3-none-any.whl (7.6 kB)
Collecting pandas&lt;2.0,&gt;=0.17.1
  Downloading pandas-1.2.0-cp38-cp38-manylinux1_x86_64.whl (9.7 MB)
     |████████████████████████████████| 9.7 MB 45.8 MB/s
Collecting apache-airflow-providers-imap
  Downloading apache_airflow_providers_imap-1.0.0-py3-none-any.whl (18 kB)
Collecting flask-swagger==0.2.13
  Downloading flask-swagger-0.2.13.tar.gz (8.0 kB)
Collecting jinja2&lt;2.12.0,&gt;=2.10.1
  Downloading Jinja2-2.11.2-py2.py3-none-any.whl (125 kB)
     |████████████████████████████████| 125 kB 37.4 MB/s
Collecting sqlalchemy&lt;2,&gt;=1.3.18
  Downloading SQLAlchemy-1.3.22-cp38-cp38-manylinux2010_x86_64.whl (1.3 MB)
     |████████████████████████████████| 1.3 MB 80.4 MB/s
Collecting markdown&lt;4.0,&gt;=2.5.2
  Downloading Markdown-3.3.3-py3-none-any.whl (96 kB)
     |████████████████████████████████| 96 kB 9.9 MB/s
Collecting six&gt;=1.11.0
  Using cached six-1.15.0-py2.py3-none-any.whl (10 kB)
Collecting pyrsistent&gt;=0.14.0
  Downloading pyrsistent-0.17.3.tar.gz (106 kB)
     |████████████████████████████████| 106 kB 66.7 MB/s
Requirement already satisfied: setuptools in ./.pyenv/versions/3.8.6/lib/python3.8/site-packages (from jsonschema~=3.0-&gt;apache-airflow) (49.2.1)
Collecting PyYAML&gt;=5.1
  Downloading PyYAML-5.3.1.tar.gz (269 kB)
     |████████████████████████████████| 269 kB 87.8 MB/s
Collecting openapi-spec-validator&gt;=0.2.4
  Downloading openapi_spec_validator-0.2.9-py3-none-any.whl (25 kB)
Collecting inflection&gt;=0.3.1
  Downloading inflection-0.5.1-py2.py3-none-any.whl (9.5 kB)
Collecting clickclick&gt;=1.2
  Downloading clickclick-20.10.2-py2.py3-none-any.whl (7.4 kB)
Collecting swagger-ui-bundle&gt;=0.0.2; extra == "swagger-ui"
  Downloading swagger_ui_bundle-0.0.8-py3-none-any.whl (3.8 MB)
     |████████████████████████████████| 3.8 MB 87.2 MB/s
Collecting Flask-SQLAlchemy&lt;3,&gt;=2.4
  Downloading Flask_SQLAlchemy-2.4.4-py2.py3-none-any.whl (17 kB)
Collecting marshmallow&lt;4,&gt;=3
  Downloading marshmallow-3.10.0-py2.py3-none-any.whl (46 kB)
     |████████████████████████████████| 46 kB 7.3 MB/s
Collecting colorama&lt;1,&gt;=0.3.9
  Downloading colorama-0.4.4-py2.py3-none-any.whl (16 kB)
Collecting Flask-OpenID&lt;2,&gt;=1.2.5
  Downloading Flask-OpenID-1.2.5.tar.gz (43 kB)
     |████████████████████████████████| 43 kB 3.9 MB/s
Collecting click&lt;8,&gt;=6.7
  Downloading click-7.1.2-py2.py3-none-any.whl (82 kB)
     |████████████████████████████████| 82 kB 1.6 MB/s
Collecting email-validator&lt;2,&gt;=1.0.5
  Downloading email_validator-1.1.2-py2.py3-none-any.whl (17 kB)
Collecting Flask-JWT-Extended&lt;4,&gt;=3.18
  Downloading Flask-JWT-Extended-3.25.0.tar.gz (31 kB)
Collecting sqlalchemy-utils&lt;1,&gt;=0.32.21
  Downloading SQLAlchemy-Utils-0.36.8.tar.gz (138 kB)
     |████████████████████████████████| 138 kB 82.3 MB/s
Collecting marshmallow-sqlalchemy&lt;0.24.0,&gt;=0.22.0
  Downloading marshmallow_sqlalchemy-0.23.1-py2.py3-none-any.whl (18 kB)
Collecting Flask-Babel&lt;2,&gt;=1
  Downloading Flask_Babel-1.0.0-py3-none-any.whl (9.5 kB)
Collecting PyJWT&gt;=1.7.1
  Downloading PyJWT-2.0.0-py3-none-any.whl (15 kB)
Collecting apispec[yaml]&lt;4,&gt;=3.3
  Downloading apispec-3.3.2-py2.py3-none-any.whl (27 kB)
Collecting prison&lt;1.0.0,&gt;=0.1.3
  Downloading prison-0.1.3-py2.py3-none-any.whl (5.8 kB)
Collecting marshmallow-enum&lt;2,&gt;=1.5.1
  Downloading marshmallow_enum-1.5.1-py2.py3-none-any.whl (4.2 kB)
Collecting pytz
  Downloading pytz-2020.5-py2.py3-none-any.whl (510 kB)
     |████████████████████████████████| 510 kB 81.7 MB/s
Collecting docutils
  Downloading docutils-0.16-py2.py3-none-any.whl (548 kB)
     |████████████████████████████████| 548 kB 84.0 MB/s
Collecting commonmark&lt;0.10.0,&gt;=0.9.0
  Downloading commonmark-0.9.1-py2.py3-none-any.whl (51 kB)
     |████████████████████████████████| 51 kB 12.8 MB/s
Collecting typing-extensions&lt;4.0.0,&gt;=3.7.4
  Downloading typing_extensions-3.7.4.3-py3-none-any.whl (22 kB)
Collecting natsort
  Downloading natsort-7.1.0-py3-none-any.whl (35 kB)
Collecting WTForms
  Downloading WTForms-2.3.3-py2.py3-none-any.whl (169 kB)
     |████████████████████████████████| 169 kB 45.0 MB/s
Collecting certifi&gt;=2017.4.17
  Downloading certifi-2020.12.5-py2.py3-none-any.whl (147 kB)
     |████████████████████████████████| 147 kB 87.2 MB/s
Collecting idna&lt;3,&gt;=2.5
  Downloading idna-2.10-py2.py3-none-any.whl (58 kB)
     |████████████████████████████████| 58 kB 9.9 MB/s
Collecting chardet&lt;4,&gt;=3.0.2
  Downloading chardet-3.0.4-py2.py3-none-any.whl (133 kB)
     |████████████████████████████████| 133 kB 95.4 MB/s
Collecting text-unidecode&gt;=1.3
  Using cached text_unidecode-1.3-py2.py3-none-any.whl (78 kB)
Collecting zipp&gt;=0.5
  Downloading zipp-3.4.0-py3-none-any.whl (5.2 kB)
Collecting pytzdata&gt;=2020.1
  Downloading pytzdata-2020.1-py2.py3-none-any.whl (489 kB)
     |████████████████████████████████| 489 kB 58.1 MB/s
Collecting cffi&gt;=1.12
  Downloading cffi-1.14.4-cp38-cp38-manylinux1_x86_64.whl (411 kB)
     |████████████████████████████████| 411 kB 63.6 MB/s
Collecting python-editor&gt;=0.3
  Downloading python_editor-1.0.4-py3-none-any.whl (4.9 kB)
Collecting Mako
  Downloading Mako-1.1.4.tar.gz (479 kB)
     |████████████████████████████████| 479 kB 58.4 MB/s
Collecting numpy&gt;=1.16.5
  Downloading numpy-1.19.5-cp38-cp38-manylinux2010_x86_64.whl (14.9 MB)
     |████████████████████████████████| 14.9 MB 51.5 MB/s
Collecting python3-openid&gt;=2.0
  Downloading python3_openid-3.2.0-py3-none-any.whl (133 kB)
     |████████████████████████████████| 133 kB 67.0 MB/s
Collecting dnspython&gt;=1.15.0
  Downloading dnspython-2.1.0-py3-none-any.whl (241 kB)
     |████████████████████████████████| 241 kB 63.7 MB/s
Collecting Babel&gt;=2.3
  Downloading Babel-2.9.0-py2.py3-none-any.whl (8.8 MB)
     |████████████████████████████████| 8.8 MB 62.1 MB/s
Collecting pycparser
  Downloading pycparser-2.20-py2.py3-none-any.whl (112 kB)
     |████████████████████████████████| 112 kB 92.8 MB/s
Collecting defusedxml
  Downloading defusedxml-0.6.0-py2.py3-none-any.whl (23 kB)
Using legacy 'setup.py install' for python-nvd3, since package 'wheel' is not installed.
Using legacy 'setup.py install' for tzlocal, since package 'wheel' is not installed.
Using legacy 'setup.py install' for thrift, since package 'wheel' is not installed.
Using legacy 'setup.py install' for termcolor, since package 'wheel' is not installed.
Using legacy 'setup.py install' for json-merge-patch, since package 'wheel' is not installed.
Using legacy 'setup.py install' for python-slugify, since package 'wheel' is not installed.
Using legacy 'setup.py install' for flask-login, since package 'wheel' is not installed.
Using legacy 'setup.py install' for unicodecsv, since package 'wheel' is not installed.
Using legacy 'setup.py install' for flask-swagger, since package 'wheel' is not installed.
Using legacy 'setup.py install' for pyrsistent, since package 'wheel' is not installed.
Using legacy 'setup.py install' for PyYAML, since package 'wheel' is not installed.
Using legacy 'setup.py install' for Flask-OpenID, since package 'wheel' is not installed.
Using legacy 'setup.py install' for Flask-JWT-Extended, since package 'wheel' is not installed.
Using legacy 'setup.py install' for sqlalchemy-utils, since package 'wheel' is not installed.
Using legacy 'setup.py install' for Mako, since package 'wheel' is not installed.
Installing collected packages: attrs, six, pyrsistent, jsonschema, dill, PyYAML, openapi-spec-validator, inflection, click, clickclick, werkzeug, itsdangerous, markupsafe, jinja2, flask, certifi, idna, chardet, urllib3, requests, swagger-ui-bundle, connexion, gunicorn, text-unidecode, python-slugify, python-nvd3, flask-caching, funcsigs, sqlalchemy, Flask-SQLAlchemy, marshmallow, colorama, WTForms, flask-wtf, defusedxml, python3-openid, Flask-OpenID, dnspython, email-validator, python-dateutil, PyJWT, Flask-JWT-Extended, sqlalchemy-utils, marshmallow-sqlalchemy, pytz, Babel, Flask-Babel, flask-login, apispec, prison, marshmallow-enum, flask-appbuilder, setproctitle, tzlocal, apache-airflow-providers-sqlite, thrift, apache-airflow-providers-ftp, lockfile, docutils, python-daemon, commonmark, pygments, typing-extensions, rich, apache-airflow-providers-http, psutil, natsort, croniter, colorlog, termcolor, argcomplete, importlib-resources, sqlalchemy-jsonfield, iso8601, cattrs, marshmallow-oneofschema, tenacity, graphviz, json-merge-patch, lazy-object-proxy, zipp, importlib-metadata, pytzdata, pendulum, pycparser, cffi, cryptography, unicodecsv, python-editor, Mako, alembic, tabulate, cached-property, numpy, pandas, apache-airflow-providers-imap, flask-swagger, markdown, apache-airflow
    Running setup.py install for pyrsistent ... done
    Running setup.py install for PyYAML ... done
    Running setup.py install for python-slugify ... done
    Running setup.py install for python-nvd3 ... done
    Running setup.py install for Flask-OpenID ... done
    Running setup.py install for Flask-JWT-Extended ... done
    Running setup.py install for sqlalchemy-utils ... done
    Running setup.py install for flask-login ... done
    Running setup.py install for tzlocal ... done
    Running setup.py install for thrift ... done
    Running setup.py install for termcolor ... done
    Running setup.py install for json-merge-patch ... done
    Running setup.py install for unicodecsv ... done
    Running setup.py install for Mako ... done
    Running setup.py install for flask-swagger ... done
ERROR: After October 2020 you may experience errors when installing or updating packages. This is because pip will change the way that it resolves dependency conflicts.
<p dir="auto">We recommend you use --use-feature=2020-resolver to test your packages with the new resolver before it becomes the default.</p>
<p dir="auto">flask-jwt-extended 3.25.0 requires PyJWT&lt;2.0,&gt;=1.6.4, but you'll have pyjwt 2.0.0 which is incompatible.<br>
Successfully installed Babel-2.9.0 Flask-Babel-1.0.0 Flask-JWT-Extended-3.25.0 Flask-OpenID-1.2.5 Flask-SQLAlchemy-2.4.4 Mako-1.1.4 PyJWT-2.0.0 PyYAML-5.3.1 WTForms-2.3.3 alembic-1.4.3 apache-<a class="issue-link js-issue-link notranslate" rel="noopener noreferrer nofollow" href="https://issues.apache.org/jira/browse/AIRFLOW-2">airflow-2</a>.0.0 apache-airflow-providers-ftp-1.0.0 apache-airflow-providers-http-1.0.0 apache-airflow-providers-imap-1.0.0 apache-airflow-providers-sqlite-1.0.0 apispec-3.3.2 argcomplete-1.12.2 attrs-20.3.0 cached-property-1.5.2 cattrs-1.1.2 certifi-2020.12.5 cffi-1.14.4 chardet-3.0.4 click-7.1.2 clickclick-20.10.2 colorama-0.4.4 colorlog-4.0.2 commonmark-0.9.1 connexion-2.7.0 croniter-0.3.37 cryptography-3.3.1 defusedxml-0.6.0 dill-0.3.3 dnspython-2.1.0 docutils-0.16 email-validator-1.1.2 flask-1.1.2 flask-appbuilder-3.1.1 flask-caching-1.9.0 flask-login-0.4.1 flask-swagger-0.2.13 flask-wtf-0.14.3 funcsigs-1.0.2 graphviz-0.16 gunicorn-19.10.0 idna-2.10 importlib-metadata-1.7.0 importlib-resources-1.5.0 inflection-0.5.1 iso8601-0.1.13 itsdangerous-1.1.0 jinja2-2.11.2 json-merge-patch-0.2 jsonschema-3.2.0 lazy-object-proxy-1.4.3 lockfile-0.12.2 markdown-3.3.3 markupsafe-1.1.1 marshmallow-3.10.0 marshmallow-enum-1.5.1 marshmallow-oneofschema-2.1.0 marshmallow-sqlalchemy-0.23.1 natsort-7.1.0 numpy-1.19.5 openapi-spec-validator-0.2.9 pandas-1.2.0 pendulum-2.1.2 prison-0.1.3 psutil-5.8.0 pycparser-2.20 pygments-2.7.4 pyrsistent-0.17.3 python-daemon-2.2.4 python-dateutil-2.8.1 python-editor-1.0.4 python-nvd3-0.15.0 python-slugify-4.0.1 python3-openid-3.2.0 pytz-2020.5 pytzdata-2020.1 requests-2.23.0 rich-9.2.0 setproctitle-1.2.1 six-1.15.0 sqlalchemy-1.3.22 sqlalchemy-jsonfield-1.0.0 sqlalchemy-utils-0.36.8 swagger-ui-bundle-0.0.8 tabulate-0.8.7 tenacity-6.2.0 termcolor-1.1.0 text-unidecode-1.3 thrift-0.13.0 typing-extensions-3.7.4.3 tzlocal-1.5.1 unicodecsv-0.14.1 urllib3-1.25.11 werkzeug-1.0.1 zipp-3.4.0<br>
WARNING: You are using pip version 20.2.1; however, version 20.3.3 is available.<br>
You should consider upgrading via the '/home/matt/.pyenv/versions/3.8.6/bin/python3.8 -m pip install --upgrade pip' command.<br>
~ &gt; which airflow<br>
/home/matt/.pyenv/shims/airflow<br>
~ &gt; cd airflow-test-no-virtual-env/<br>
~/airflow-test-no-virtual-env &gt; airflow db init<br>
DB: sqlite:////home/matt/airflow-test-no-virtual-env//airflow.db<br>
[2021-01-15 19:46:59,757] {db.py:678} INFO - Creating tables<br>
INFO  [alembic.runtime.migration] Context impl SQLiteImpl.<br>
INFO  [alembic.runtime.migration] Will assume non-transactional DDL.<br>
INFO  [alembic.runtime.migration] Running upgrade  -&gt; e3a246e0dc1, current schema<br>
INFO  [alembic.runtime.migration] Running upgrade e3a246e0dc1 -&gt; 1507a7289a2f, create is_encrypted<br>
/home/matt/.pyenv/versions/3.8.6/lib/python3.8/site-packages/alembic/ddl/sqlite.py:43 UserWarning: Skipping unsupported ALTER for creation of implicit constraintPlease refer to the batch mode feature which allows for SQLite migrations using a copy-and-move strategy.<br>
INFO  [alembic.runtime.migration] Running upgrade 1507a7289a2f -&gt; 13eb55f81627, maintain history for compatibility with earlier migrations<br>
INFO  [alembic.runtime.migration] Running upgrade 13eb55f81627 -&gt; 338e90f54d61, More logging into task_instance<br>
INFO  [alembic.runtime.migration] Running upgrade 338e90f54d61 -&gt; 52d714495f0, job_id indices<br>
INFO  [alembic.runtime.migration] Running upgrade 52d714495f0 -&gt; 502898887f84, Adding extra to Log<br>
INFO  [alembic.runtime.migration] Running upgrade 502898887f84 -&gt; 1b38cef5b76e, add dagrun<br>
INFO  [alembic.runtime.migration] Running upgrade 1b38cef5b76e -&gt; 2e541a1dcfed, task_duration<br>
INFO  [alembic.runtime.migration] Running upgrade 2e541a1dcfed -&gt; 40e67319e3a9, dagrun_config<br>
INFO  [alembic.runtime.migration] Running upgrade 40e67319e3a9 -&gt; 561833c1c74b, add password column to user<br>
INFO  [alembic.runtime.migration] Running upgrade 561833c1c74b -&gt; 4446e08588, dagrun start end<br>
INFO  [alembic.runtime.migration] Running upgrade 4446e08588 -&gt; bbc73705a13e, Add notification_sent column to sla_miss<br>
INFO  [alembic.runtime.migration] Running upgrade bbc73705a13e -&gt; bba5a7cfc896, Add a column to track the encryption state of the 'Extra' field in connection<br>
INFO  [alembic.runtime.migration] Running upgrade bba5a7cfc896 -&gt; 1968acfc09e3, add is_encrypted column to variable table<br>
INFO  [alembic.runtime.migration] Running upgrade 1968acfc09e3 -&gt; 2e82aab8ef20, rename user table<br>
INFO  [alembic.runtime.migration] Running upgrade 2e82aab8ef20 -&gt; 211e584da130, add TI state index<br>
INFO  [alembic.runtime.migration] Running upgrade 211e584da130 -&gt; 64de9cddf6c9, add task fails journal table<br>
INFO  [alembic.runtime.migration] Running upgrade 64de9cddf6c9 -&gt; f2ca10b85618, add dag_stats table<br>
INFO  [alembic.runtime.migration] Running upgrade f2ca10b85618 -&gt; 4addfa1236f1, Add fractional seconds to mysql tables<br>
INFO  [alembic.runtime.migration] Running upgrade 4addfa1236f1 -&gt; 8504051e801b, xcom dag task indices<br>
INFO  [alembic.runtime.migration] Running upgrade 8504051e801b -&gt; 5e7d17757c7a, add pid field to TaskInstance<br>
INFO  [alembic.runtime.migration] Running upgrade 5e7d17757c7a -&gt; 127d2bf2dfa7, Add dag_id/state index on dag_run table<br>
INFO  [alembic.runtime.migration] Running upgrade 127d2bf2dfa7 -&gt; cc1e65623dc7, add max tries column to task instance<br>
WARNI [unusual_prefix_7c969f2cbb12c110385be97d88cb24052dba3ae5_example_kubernetes_executor_config] Could not import DAGs in example_kubernetes_executor_config.py: No module named 'kubernetes'<br>
WARNI [unusual_prefix_7c969f2cbb12c110385be97d88cb24052dba3ae5_example_kubernetes_executor_config] Install kubernetes dependencies with: pip install apache-airflow['cncf.kubernetes']<br>
INFO  [alembic.runtime.migration] Running upgrade cc1e65623dc7 -&gt; bdaa763e6c56, Make xcom value column a large binary<br>
INFO  [alembic.runtime.migration] Running upgrade bdaa763e6c56 -&gt; 947454bf1dff, add ti job_id index<br>
INFO  [alembic.runtime.migration] Running upgrade 947454bf1dff -&gt; d2ae31099d61, Increase text size for MySQL (not relevant for other DBs' text types)<br>
INFO  [alembic.runtime.migration] Running upgrade d2ae31099d61 -&gt; 0e2a74e0fc9f, Add time zone awareness<br>
INFO  [alembic.runtime.migration] Running upgrade d2ae31099d61 -&gt; 33ae817a1ff4, kubernetes_resource_checkpointing<br>
INFO  [alembic.runtime.migration] Running upgrade 33ae817a1ff4 -&gt; 27c6a30d7c24, kubernetes_resource_checkpointing<br>
INFO  [alembic.runtime.migration] Running upgrade 27c6a30d7c24 -&gt; 86770d1215c0, add kubernetes scheduler uniqueness<br>
INFO  [alembic.runtime.migration] Running upgrade 86770d1215c0, 0e2a74e0fc9f -&gt; 05f30312d566, merge heads<br>
INFO  [alembic.runtime.migration] Running upgrade 05f30312d566 -&gt; f23433877c24, fix mysql not null constraint<br>
INFO  [alembic.runtime.migration] Running upgrade f23433877c24 -&gt; 856955da8476, fix sqlite foreign key<br>
INFO  [alembic.runtime.migration] Running upgrade 856955da8476 -&gt; 9635ae0956e7, index-faskfail<br>
INFO  [alembic.runtime.migration] Running upgrade 9635ae0956e7 -&gt; dd25f486b8ea, add idx_log_dag<br>
INFO  [alembic.runtime.migration] Running upgrade dd25f486b8ea -&gt; bf00311e1990, add index to taskinstance<br>
INFO  [alembic.runtime.migration] Running upgrade 9635ae0956e7 -&gt; 0a2a5b66e19d, add task_reschedule table<br>
INFO  [alembic.runtime.migration] Running upgrade 0a2a5b66e19d, bf00311e1990 -&gt; 03bc53e68815, merge_heads_2<br>
INFO  [alembic.runtime.migration] Running upgrade 03bc53e68815 -&gt; 41f5f12752f8, add superuser field<br>
INFO  [alembic.runtime.migration] Running upgrade 41f5f12752f8 -&gt; c8ffec048a3b, add fields to dag<br>
INFO  [alembic.runtime.migration] Running upgrade c8ffec048a3b -&gt; dd4ecb8fbee3, Add schedule interval to dag<br>
INFO  [alembic.runtime.migration] Running upgrade dd4ecb8fbee3 -&gt; 939bb1e647c8, task reschedule fk on cascade delete<br>
INFO  [alembic.runtime.migration] Running upgrade 939bb1e647c8 -&gt; 6e96a59344a4, Make TaskInstance.pool not nullable<br>
INFO  [alembic.runtime.migration] Running upgrade 6e96a59344a4 -&gt; d38e04c12aa2, add serialized_dag table<br>
INFO  [alembic.runtime.migration] Running upgrade d38e04c12aa2 -&gt; b3b105409875, add root_dag_id to DAG<br>
INFO  [alembic.runtime.migration] Running upgrade 6e96a59344a4 -&gt; 74effc47d867, change datetime to datetime2(6) on MSSQL tables<br>
INFO  [alembic.runtime.migration] Running upgrade 939bb1e647c8 -&gt; 004c1210f153, increase queue name size limit<br>
INFO  [alembic.runtime.migration] Running upgrade c8ffec048a3b -&gt; a56c9515abdc, Remove dag_stat table<br>
INFO  [alembic.runtime.migration] Running upgrade a56c9515abdc, 004c1210f153, 74effc47d867, b3b105409875 -&gt; 08364691d074, Merge the four heads back together<br>
INFO  [alembic.runtime.migration] Running upgrade 08364691d074 -&gt; fe461863935f, increase_length_for_connection_password<br>
INFO  [alembic.runtime.migration] Running upgrade fe461863935f -&gt; 7939bcff74ba, Add DagTags table<br>
INFO  [alembic.runtime.migration] Running upgrade 7939bcff74ba -&gt; a4c2fd67d16b, add pool_slots field to task_instance<br>
INFO  [alembic.runtime.migration] Running upgrade a4c2fd67d16b -&gt; 852ae6c715af, Add RenderedTaskInstanceFields table<br>
INFO  [alembic.runtime.migration] Running upgrade 852ae6c715af -&gt; 952da73b5eff, add dag_code table<br>
INFO  [alembic.runtime.migration] Running upgrade 952da73b5eff -&gt; a66efa278eea, Add Precision to execution_date in RenderedTaskInstanceFields table<br>
INFO  [alembic.runtime.migration] Running upgrade a66efa278eea -&gt; da3f683c3a5a, Add dag_hash Column to serialized_dag table<br>
INFO  [alembic.runtime.migration] Running upgrade da3f683c3a5a -&gt; 92c57b58940d, Create FAB Tables<br>
INFO  [alembic.runtime.migration] Running upgrade 92c57b58940d -&gt; 03afc6b6f902, Increase length of FAB ab_view_menu.name column<br>
INFO  [alembic.runtime.migration] Running upgrade 03afc6b6f902 -&gt; cf5dc11e79ad, drop_user_and_chart<br>
INFO  [alembic.runtime.migration] Running upgrade cf5dc11e79ad -&gt; bbf4a7ad0465, Remove id column from xcom<br>
INFO  [alembic.runtime.migration] Running upgrade bbf4a7ad0465 -&gt; b25a55525161, Increase length of pool name<br>
INFO  [alembic.runtime.migration] Running upgrade b25a55525161 -&gt; 3c20cacc0044, Add DagRun run_type<br>
INFO  [alembic.runtime.migration] Running upgrade 3c20cacc0044 -&gt; 8f966b9c467a, Set conn_type as non-nullable<br>
INFO  [alembic.runtime.migration] Running upgrade 8f966b9c467a -&gt; 8d48763f6d53, add unique constraint to conn_id<br>
INFO  [alembic.runtime.migration] Running upgrade 8d48763f6d53 -&gt; e38be357a868, Add sensor_instance table<br>
INFO  [alembic.runtime.migration] Running upgrade e38be357a868 -&gt; b247b1e3d1ed, Add queued by Job ID to TI<br>
INFO  [alembic.runtime.migration] Running upgrade b247b1e3d1ed -&gt; e1a11ece99cc, Add external executor ID to TI<br>
INFO  [alembic.runtime.migration] Running upgrade e1a11ece99cc -&gt; bef4f3d11e8b, Drop KubeResourceVersion and KubeWorkerId<br>
INFO  [alembic.runtime.migration] Running upgrade bef4f3d11e8b -&gt; 98271e7606e2, Add scheduling_decision to DagRun and DAG<br>
INFO  [alembic.runtime.migration] Running upgrade 98271e7606e2 -&gt; 52d53670a240, fix_mssql_exec_date_rendered_task_instance_fields_for_MSSQL<br>
INFO  [alembic.runtime.migration] Running upgrade 52d53670a240 -&gt; 364159666cbd, Add creating_job_id to DagRun table<br>
INFO  [alembic.runtime.migration] Running upgrade 364159666cbd -&gt; 45ba3f1493b9, add-k8s-yaml-to-rendered-templates<br>
INFO  [alembic.runtime.migration] Running upgrade 45ba3f1493b9 -&gt; 849da589634d, Prefix DAG permissions.<br>
INFO  [alembic.runtime.migration] Running upgrade 849da589634d -&gt; 2c6edca13270, Resource based permissions.<br>
[2021-01-15 19:47:01,953] {manager.py:727} WARNING - No user yet created, use flask fab command to do it.<br>
[2021-01-15 19:47:04,784] {migration.py:517} INFO - Running upgrade 2c6edca13270 -&gt; 61ec73d9401f, Add description field to connection<br>
[2021-01-15 19:47:04,793] {migration.py:517} INFO - Running upgrade 61ec73d9401f -&gt; 64a7d6477aae, fix description field in connection to be text<br>
[2021-01-15 19:47:04,798] {migration.py:517} INFO - Running upgrade 64a7d6477aae -&gt; e959f08ac86c, Change field in DagCode to MEDIUMTEXT for MySql<br>
[2021-01-15 19:47:05,097] {dagbag.py:440} INFO - Filling up the DagBag from /home/matt/airflow-test-no-virtual-env//dags<br>
[2021-01-15 19:47:05,116] {example_kubernetes_executor_config.py:174} WARNING - Could not import DAGs in example_kubernetes_executor_config.py: No module named 'kubernetes'<br>
[2021-01-15 19:47:05,117] {example_kubernetes_executor_config.py:175} WARNING - Install kubernetes dependencies with: pip install apache-airflow['cncf.kubernetes']<br>
[2021-01-15 19:47:05,133] {dag.py:1813} INFO - Sync 28 DAGs<br>
[2021-01-15 19:47:05,136] {dag.py:1832} INFO - Creating ORM DAG for example_subdag_operator.section-1<br>
[2021-01-15 19:47:05,136] {dag.py:1832} INFO - Creating ORM DAG for example_branch_dop_operator_v3<br>
[2021-01-15 19:47:05,136] {dag.py:1832} INFO - Creating ORM DAG for example_xcom_args<br>
[2021-01-15 19:47:05,136] {dag.py:1832} INFO - Creating ORM DAG for example_external_task_marker_parent<br>
[2021-01-15 19:47:05,137] {dag.py:1832} INFO - Creating ORM DAG for tutorial_taskflow_api_etl<br>
[2021-01-15 19:47:05,137] {dag.py:1832} INFO - Creating ORM DAG for example_xcom<br>
[2021-01-15 19:47:05,137] {dag.py:1832} INFO - Creating ORM DAG for example_xcom_args_with_operators<br>
[2021-01-15 19:47:05,137] {dag.py:1832} INFO - Creating ORM DAG for example_kubernetes_executor<br>
[2021-01-15 19:47:05,137] {dag.py:1832} INFO - Creating ORM DAG for example_python_operator<br>
[2021-01-15 19:47:05,138] {dag.py:1832} INFO - Creating ORM DAG for example_branch_operator<br>
[2021-01-15 19:47:05,138] {dag.py:1832} INFO - Creating ORM DAG for tutorial<br>
[2021-01-15 19:47:05,138] {dag.py:1832} INFO - Creating ORM DAG for test_utils<br>
[2021-01-15 19:47:05,138] {dag.py:1832} INFO - Creating ORM DAG for example_passing_params_via_test_command<br>
[2021-01-15 19:47:05,138] {dag.py:1832} INFO - Creating ORM DAG for latest_only_with_trigger<br>
[2021-01-15 19:47:05,138] {dag.py:1832} INFO - Creating ORM DAG for example_short_circuit_operator<br>
[2021-01-15 19:47:05,139] {dag.py:1832} INFO - Creating ORM DAG for example_dag_decorator<br>
[2021-01-15 19:47:05,139] {dag.py:1832} INFO - Creating ORM DAG for example_skip_dag<br>
[2021-01-15 19:47:05,139] {dag.py:1832} INFO - Creating ORM DAG for example_subdag_operator.section-2<br>
[2021-01-15 19:47:05,139] {dag.py:1832} INFO - Creating ORM DAG for example_bash_operator<br>
[2021-01-15 19:47:05,139] {dag.py:1832} INFO - Creating ORM DAG for example_subdag_operator<br>
[2021-01-15 19:47:05,140] {dag.py:1832} INFO - Creating ORM DAG for example_task_group<br>
[2021-01-15 19:47:05,140] {dag.py:1832} INFO - Creating ORM DAG for latest_only<br>
[2021-01-15 19:47:05,140] {dag.py:1832} INFO - Creating ORM DAG for example_nested_branch_dag<br>
[2021-01-15 19:47:05,140] {dag.py:1832} INFO - Creating ORM DAG for example_external_task_marker_child<br>
[2021-01-15 19:47:05,140] {dag.py:1832} INFO - Creating ORM DAG for example_trigger_controller_dag<br>
[2021-01-15 19:47:05,141] {dag.py:1832} INFO - Creating ORM DAG for tutorial_etl_dag<br>
[2021-01-15 19:47:05,141] {dag.py:1832} INFO - Creating ORM DAG for example_complex<br>
[2021-01-15 19:47:05,141] {dag.py:1832} INFO - Creating ORM DAG for example_trigger_target_dag<br>
[2021-01-15 19:47:05,146] {dag.py:2266} INFO - Setting next_dagrun for example_bash_operator to 2021-01-14 00:00:00+00:00<br>
[2021-01-15 19:47:05,156] {dag.py:2266} INFO - Setting next_dagrun for example_branch_dop_operator_v3 to 2021-01-14 00:00:00+00:00<br>
[2021-01-15 19:47:05,159] {dag.py:2266} INFO - Setting next_dagrun for example_branch_operator to 2021-01-14 00:00:00+00:00<br>
[2021-01-15 19:47:05,160] {dag.py:2266} INFO - Setting next_dagrun for example_complex to None<br>
[2021-01-15 19:47:05,160] {dag.py:2266} INFO - Setting next_dagrun for example_dag_decorator to None<br>
[2021-01-15 19:47:05,160] {dag.py:2266} INFO - Setting next_dagrun for example_external_task_marker_child to None<br>
[2021-01-15 19:47:05,160] {dag.py:2266} INFO - Setting next_dagrun for example_external_task_marker_parent to None<br>
[2021-01-15 19:47:05,160] {dag.py:2266} INFO - Setting next_dagrun for example_kubernetes_executor to None<br>
[2021-01-15 19:47:05,164] {dag.py:2266} INFO - Setting next_dagrun for example_nested_branch_dag to 2021-01-14 00:00:00+00:00<br>
[2021-01-15 19:47:05,174] {dag.py:2266} INFO - Setting next_dagrun for example_passing_params_via_test_command to 2021-01-15 00:00:00+00:00<br>
[2021-01-15 19:47:05,174] {dag.py:2266} INFO - Setting next_dagrun for example_python_operator to None<br>
[2021-01-15 19:47:05,174] {dag.py:2266} INFO - Setting next_dagrun for example_short_circuit_operator to 2021-01-14 00:00:00+00:00<br>
[2021-01-15 19:47:05,174] {dag.py:2266} INFO - Setting next_dagrun for example_skip_dag to 2021-01-14 00:00:00+00:00<br>
[2021-01-15 19:47:05,174] {dag.py:2266} INFO - Setting next_dagrun for example_subdag_operator to 2021-01-14 00:00:00+00:00<br>
[2021-01-15 19:47:05,174] {dag.py:2266} INFO - Setting next_dagrun for example_subdag_operator.section-1 to None<br>
[2021-01-15 19:47:05,175] {dag.py:2266} INFO - Setting next_dagrun for example_subdag_operator.section-2 to None<br>
[2021-01-15 19:47:05,175] {dag.py:2266} INFO - Setting next_dagrun for example_task_group to 2021-01-14 00:00:00+00:00<br>
[2021-01-15 19:47:05,175] {dag.py:2266} INFO - Setting next_dagrun for example_trigger_controller_dag to 2021-01-14 00:00:00+00:00<br>
[2021-01-15 19:47:05,175] {dag.py:2266} INFO - Setting next_dagrun for example_trigger_target_dag to None<br>
[2021-01-15 19:47:05,175] {dag.py:2266} INFO - Setting next_dagrun for example_xcom to 2021-01-14 00:00:00+00:00<br>
[2021-01-15 19:47:05,175] {dag.py:2266} INFO - Setting next_dagrun for example_xcom_args to None<br>
[2021-01-15 19:47:05,176] {dag.py:2266} INFO - Setting next_dagrun for example_xcom_args_with_operators to None<br>
[2021-01-15 19:47:05,176] {dag.py:2266} INFO - Setting next_dagrun for latest_only to 2021-01-14 00:00:00+00:00<br>
[2021-01-15 19:47:05,176] {dag.py:2266} INFO - Setting next_dagrun for latest_only_with_trigger to 2021-01-14 00:00:00+00:00<br>
[2021-01-15 19:47:05,176] {dag.py:2266} INFO - Setting next_dagrun for test_utils to None<br>
[2021-01-15 19:47:05,176] {dag.py:2266} INFO - Setting next_dagrun for tutorial to 2021-01-14 00:00:00+00:00<br>
[2021-01-15 19:47:05,177] {dag.py:2266} INFO - Setting next_dagrun for tutorial_etl_dag to None<br>
[2021-01-15 19:47:05,177] {dag.py:2266} INFO - Setting next_dagrun for tutorial_taskflow_api_etl to None<br>
[2021-01-15 19:47:05,192] {dag.py:1813} INFO - Sync 2 DAGs<br>
[2021-01-15 19:47:05,195] {dag.py:2266} INFO - Setting next_dagrun for example_subdag_operator.section-1 to None<br>
[2021-01-15 19:47:05,195] {dag.py:2266} INFO - Setting next_dagrun for example_subdag_operator.section-2 to None<br>
Initialization done</p>
</details>
<p dir="auto"><strong>What you expected to happen</strong>: The <code class="notranslate">airflow db init</code> command succeeds when run within my virtual env (using the command <code class="notranslate">poetry run airflow db init</code>).</p>
<p dir="auto"><strong>What do you think went wrong?</strong></p>
<p dir="auto">Googling the error let me to find a Stack Overflow page that describes it as ultimately an error related to Python 2 vs. Python 3. Something to do with something called "map". I looked at Airflow supported versions though and found that it supports Python 3, so I found it strange since I was using Python 3. I also tried using the command <code class="notranslate">pyenv local 3.8.6</code> to try to be extra thorough in locking in a particular supported Python version.</p>
<p dir="auto">Because it doesn't work inside my virtual environment, but works outside it, I think there's something wrong with how all the tooling is working together. I could just stop using a virtual environment to continue. However, what I've learned so far as I learn how to develop in Python is that using virtual environments is a good idea to make my code portable and keep it separate from other stuff on my machine. For example, as I learn Airflow, I might want to bounce back and forth between Airflow 1 and Airflow 2 to see how the installation methods (non-modular vs. modular) work.</p>
<p dir="auto"><strong>How to reproduce it</strong>: Run the steps I described above on Ubuntu 20.04 LTS or a similar Linux operating system, using Python 3.</p>
<p dir="auto"><strong>How often does this problem occur? Once? Every time etc?</strong><br>
Every time I try to run the <code class="notranslate">airflow db init</code> command to finish the quickstart.</p>