Home > Blockchain >  can't connect to google cloud using airflow 2.0 in docker with json key file
can't connect to google cloud using airflow 2.0 in docker with json key file

Time:01-01

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?

CodePudding user response:

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 is

CodePudding user response:

The most likely issue is that it's missing the volume mapping in your docker-compose.yaml

  volumes:
    ...
    - /Users/my_user/PycharmProjects/airflow_docker/plugins/:/opt/airflow/plugins
  • Related