https://meltano.com/ logo
#announcements
Title
# announcements
b

bland-parrot-93687

12/17/2020, 6:51 AM
Hi, I am trying to up the docker-compose.prod.yml file in the docker-compose bundle with Airflow orchestration but it cannot start. This is the log:
Copy code
airflow-webserver_1    | [2020-12-17 06:44:11,773] [1|MainThread|meltano.cli.invoke] [ERROR] Traceback (most recent call last):
airflow-webserver_1    |   File "/project/.meltano/orchestrators/airflow/venv/bin/airflow", line 25, in <module>
airflow-webserver_1    |     from airflow.configuration import conf
airflow-webserver_1    |   File "/project/.meltano/orchestrators/airflow/venv/lib/python3.6/site-packages/airflow/__init__.py", line 47, in <module>
airflow-webserver_1    |     settings.initialize()
airflow-webserver_1    |   File "/project/.meltano/orchestrators/airflow/venv/lib/python3.6/site-packages/airflow/settings.py", line 405, in initialize
airflow-webserver_1    |     configure_orm()
airflow-webserver_1    |   File "/project/.meltano/orchestrators/airflow/venv/lib/python3.6/site-packages/airflow/settings.py", line 294, in configure_orm
airflow-webserver_1    |     engine = create_engine(SQL_ALCHEMY_CONN, connect_args=connect_args, **engine_args)
airflow-webserver_1    |   File "/project/.meltano/orchestrators/airflow/venv/lib/python3.6/site-packages/sqlalchemy/engine/__init__.py", line 500, in create_engine
airflow-webserver_1    |     return strategy.create(*args, **kwargs)
airflow-webserver_1    |   File "/project/.meltano/orchestrators/airflow/venv/lib/python3.6/site-packages/sqlalchemy/engine/strategies.py", line 87, in create
airflow-webserver_1    |     dbapi = dialect_cls.dbapi(**dbapi_args)
airflow-webserver_1    |   File "/project/.meltano/orchestrators/airflow/venv/lib/python3.6/site-packages/sqlalchemy/dialects/postgresql/psycopg2.py", line 753, in dbapi
airflow-webserver_1    |     import psycopg2
airflow-webserver_1    | ModuleNotFoundError: No module named 'psycopg2'
airflow-webserver_1    | 
airflow-webserver_1    | Airflow metadata database could not be initialized: `airflow initdb` failed
I just un-comment the code related to Airflow. Any help?
2
r

ripe-musician-59933

12/17/2020, 3:43 PM
@bland-parrot-93687 Hi Ngu! It looks like you're trying to use Airflow with a Postgres metadata database, but Airflow can't find the psycopg2 package. Did you see this final recommendation under https://meltano.com/docs/production.html#airflow-orchestrator?
For this to work, the `psycopg2` package will also need to be installed alongside `apache-airflow` , which you can realize by adding
psycopg2
to `airflow`'s
pip_url
in your `meltano.yml` project file (e.g.
pip_url: psycopg2 apache-airflow
) and running
meltano install orchestrator airflow
.