Airflow 2.2.2 remote worker logging getting 403 Forbidden #26624
Replies: 2 comments 5 replies
-
Thanks for opening your first issue here! Be sure to follow the issue template! |
Beta Was this translation helpful? Give feedback.
-
re: Curl : Logs can only be retrieved by webserver that is authenticated using secret key. That's why you get "forbidden". Airflow webserver passes signed JWT tokens that authenticate requests to read logs and this is internal API of Airflow - not meant to be used by external clients. You might want to take a look at the sources of Airfflow to see the details on how it is done and replicate it, but be warned - it might (and will) change - for example in airlfow 2.4 this authentication mechanism is changed. If you want to access logs, I recommend you to use persistent storage shared between your workers where the logs are placed and access them via this persistent storage. It's much more stable and "public" approach. Re: webserver - make sure you have the same version of airflow and the same secret key and that your time is synchronized for all your machines. If it does not work Upgrade to latest version of Airflow - and look at worker logs. In the latest (2.3.4 I think but 2.4.0 for sure) version of airflow we have much more detailed information in the worker logs on why Forbidden was returned. |
Beta Was this translation helpful? Give feedback.
-
Apache Airflow version
Other Airflow 2 version
What happened
I have a setup where airflow is running in kubernetes (EKS) and remote worker running in docker-compose in a VM behind a firewall in a different location.
Problem
Airflow Web server in EKS is getting 403 forbidden error when trying to get logs on remote worker.
Build Version
Kubernetes
Airflow ENV config setup
Airflow is using CeleryExecutor
Setup Test
Description
Airflow is able to execute the DAG in remote worker, the logs can be seen in the remote worker. I have tried all combinations of setting but still keep getting 403.
Another test which was done was just normal curl with webserver auth
This curl was done both from EKS and remote server which hosts docker-compose. Results are the same on all the server.
I might have miss configured it, but I doubt that is the case.
Any tips on what I am missing here? Many thanks in advance.
What you think should happen instead
Airflow web-server in EKS should be able to access the remote logs from remote worker as the port is accessible and all the secret key, fernet key matches and all the env matches.
How to reproduce
Use K3S, minikube or kubernetes of your choice. to replicate remote-worker run docker-compose setup for the installation.
Build Version
Kubernetes
Airflow ENV config setup
Operating System
Ubuntu 20.04 LTS
Versions of Apache Airflow Providers
No response
Deployment
Docker-Compose
Deployment details
Airflow ENV config setup
Anything else
This has been failing to fetch logs even there is there complete access to the port and remote worker. 403 Forbidden keeps saying secret key when it is the same across the whole environment.
Are you willing to submit PR?
Code of Conduct
Beta Was this translation helpful? Give feedback.
All reactions