I am trying to setup a GCP connection with apache airflow 2.0 in docker from MAC OS using JSON key file, I got this error when I trigger the DAG:
ERROR – [Errno 2] No such file or directory:
‘/Users/my_user/PycharmProjects/airflow_docker/plugins/key.json’
is there some configuration I need to set up in docker?
2
Answers
Check if the file
key.json
is really located at that place because it seems it isn’t. You can do that by "debugging" your docker image like this:docker run -it --rm --entrypoint sh <name-of-image>
this command allows you to access the image through the shell. That way you’ll be able to see if the file is really located in that path. Do some
ls
operations in that path and others to locate where the key.json file really isThe most likely issue is that it’s missing the volume mapping in your docker-compose.yaml