pankaj_saini
02/09/2021, 8:39 PM[Errno 2] No such file or directory: '/project/.meltano/run/airflow/airflow.cfg'
I tried the following options, but all of them give the same error:
1. Using docker-compose.yml generated by meltano add files docker-compose
: The meltano-ui service starts okay but both airflow-scheduler and airflow-webserver fail with the above error (missing airflow.cfg
)
2. docker pull meltano/meltano:latest
then docker run -v $(pwd):/project -w /project meltano/meltano invoke airflow webserver
3. Halting the container by using a custom entrypoint (docker run -it --entrypoint /bin/bash -v $(pwd):/project -w /project meltano/meltano:latest
) and then running meltano invoke airflow webserver
on docker terminal.
I tried this with multiple docker images (e.g. latest-python3.8, v1.67.0, v1.65.0, v1.63.0 etc.), but all of them give me the same error, so suspect I am not doing something right, but I don’t know what. I would expect the docker image to read my meltano.yml file and install everything by running meltano install
, and also creating necessary airflow.cfg file. (I know that meltano invoke airflow <param>
should automatically create airflow.cfg file, but not sure why it is not doing)
The airflow webserver and scheduler start okay if I run them on my machine directly (i.e. not on docker).douwe_maan
02/09/2021, 9:18 PMmeltano invoke airflow webserver
again, but with debug logging and share the result?
meltano --log-level=debug invoke airflow webserver
That should tell us some more about how airflow.cfg
is (supposed to be) constructed and how it is passed to Airflowpankaj_saini
02/09/2021, 9:33 PMmeltano --log-level=debug invoke airflow webserver
directly on docker terminal (option 3 in my main post above). Here is the output:pankaj_saini
02/09/2021, 9:33 PMdouwe_maan
02/09/2021, 9:39 PMNo such file or directory: '/project/.meltano/run/airflow/airflow.cfg'
is just a red herring; the real underlying error is buried in those logs:
meltano.core.plugin_invoker.ExecutableNotFoundError: Executable 'airflow' could not be found. Orchestrator 'airflow' may not have been installed yet using `meltano install orchestrator airflow`, or the executable name may be incorrect.
douwe_maan
02/09/2021, 9:40 PMFileNotFoundError: [Errno 2] No such file or directory: '/project/.meltano/orchestrators/airflow/venv/bin/airflow': '/project/.meltano/orchestrators/airflow/venv/bin/airflow'
douwe_maan
02/09/2021, 9:41 PMcat
that file and look at the first line, which points at the executable to run it with, that path won't exist from the perspective of the Docker container.douwe_maan
02/09/2021, 9:42 PMmeltano install
inside your containerdouwe_maan
02/09/2021, 9:42 PMdocker-compose exec meltano-ui meltano install
douwe_maan
02/09/2021, 9:42 PMmeltano invoke
will no longer work outside Docker. You really have to choose either Docker or non-Docker and stick with it 🙂douwe_maan
02/09/2021, 9:43 PMdouwe_maan
02/09/2021, 9:43 PMpankaj_saini
02/09/2021, 10:05 PMdocker-compose exec meltano-ui meltano install
installed all the plugins (for docker container) , and airflow-webserver and airflow-scheduler are able to use this .meltano/orchestrators/airflow/venv/bin/airflow
file to correctly launch airflow.
While this worked okay for me. But should the docker image entrypoint not have meltano install
first, which can use the projects meltano.yml file (from the mounted volume) and install all the plugins before launching meltano-ui, airflow-webserver or airflow-scheduler?
If you think this is something which has to be fixed, I can temporarily pass a custom entrypoint to do a meltano install
on the meltano-ui
service and make both airflow-scheduler
and airflow-webserver
dependent upon meltano-ui
service.douwe_maan
02/09/2021, 11:06 PMmeltano install
will be part of the `Dockerfile`: https://gitlab.com/meltano/files-docker/-/blob/master/bundle/Dockerfile#L12.
Generally, it's something you'd explicitly run to prepare the environment before running meltano elt
or meltano invoke
, not something to be run every time those commands are run, since re-installing all plugins every time would unnecessarily slow things down significantly.douwe_maan
02/09/2021, 11:08 PMmeltano install
when you make changes to meltano.yml
, or when you know no plugins have been installed yet. It's just that when you're using the docker-compose file and a mounted project directory, those installed plugins won't be valid inside the container, so we should document that explicitly or raise a more useful error.douwe_maan
02/09/2021, 11:08 PMpankaj_saini
02/10/2021, 12:34 AMdouwe_maan
02/10/2021, 5:43 PMdouwe_maan
02/10/2021, 5:47 PM