title: Why can't my airflow webserver initialize properly?
body: <p>When I create a dummy DAG following the <a href="https://airflow.apache.org/docs/apache-airflow/stable/start/docker.html" rel="nofollow noreferrer">Apache guide to airflow in Docker</a> and run <code>docker-compose up</code>, the <code>webserver</code> container repeatedly fails and restarts with errors that look like this:</p>
  <pre><code>webserver_1  | [2021-07-26 18:44:42,905] {cli_action_loggers.py:105} WARNING - Failed to log action with (psycopg2.errors.UndefinedTable) relation &quot;log&quot; does not exist
  webserver_1  | LINE 1: INSERT INTO log (dttm, dag_id, task_id, event, execution_dat...
  </code></pre>
  <p>This error suggests to me that the webserver is unable to initialize the airflow db. This dummy DAG uses Airflow 2 and <code>CeleryExecutor</code>. I have run into the same issue following <a href="https://towardsdatascience.com/apache-airflow-and-postgresql-with-docker-and-docker-compose-5651766dfa96" rel="nofollow noreferrer">this example</a> using Airflow 2 and <code>LocalExecutor</code>, as well as my team's current setup, which uses Airflow 1 and <code>CeleryExecutor</code>.</p>
  <p>What confuses me is that my teammates can run DAGs based on our docker-compose without issue (and presumably, others can run Apache's official quickstart successfully). So something is wrong with my machine (likely related to Postgres) that is somehow affecting my Docker images. What could cause this error across several different <code>docker-compose</code> airflow setups?</p>
  <p>What I have tried so far:</p>
  <ul>
  <li>Restarting my computer</li>
  <li>Killing, removing, and rebuilding my Docker images</li>
  <li>Reinstalling Docker for Mac</li>
  <li>Uninstalling and reinstalling <code>libpq</code>, <code>postgres</code>, and <code>psycopg2</code> on my local machine (though in theory this shouldn't matter for the Docker environment?)</li>
  </ul>
  <p>I am on Docker version 20.10.7, and docker-compose version 1.29.2.</p>