You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/06/14 07:36:49 UTC

[GitHub] [airflow] streetmapp opened a new issue #10080: Kubernetes Executor: Logs in UI doesn't work with Elasticsearch stdout config

streetmapp opened a new issue #10080:
URL: https://github.com/apache/airflow/issues/10080


   **Summary**: In trying to troubleshoot why exactly my tasks weren't firing correctly in my Airflow Cluster running on Kubernetes with the Kubernetes Executor and KubernetesPodOperator, was trying to get insight to the logs. By default in the chart in this repo, they get logged locally and not to stdout. I managed to initially view the logs when I configured remote logging to GCS, but that wasn't satisfactory for my use case. I did manage to find documentation for getting my desired behavior for some reason under the Elasticsearch logging configuration. However, in getting this working, it in turn broke the Logs tab in the UI.
   
   **Apache Airflow version**: 1.10.11
   
   **Kubernetes version**: 1.16.9
   
   **Cloud provider or hardware configuration**: GKE
   
   **What happened**:
   Trying to view the logs for a task in the UI, the Logs UI just displays a loading wheel persistently. No errors seem to appear in the logs for the webserver when I access the page.
   
   **What you expected to happen**:
   To be able to view the logs that are available in the pod in the UI. I think the issue is with how the configuration for getting these logs to show up in stdout is. In order to get this to work, I had to effectively configure Elasticsearch logging, but with different values in place so it would go to stdout of the pod. This then allows me to use my own Kubernetes logging mechanism to view the logs, but this in turn causes the Airflow UI to not be able to display the logs.
   
   
   **How to reproduce it**:
   1. Setup Airflow to run with Kubernetes Executor
   2. Follow the configuration steps [here](https://airflow.apache.org/docs/stable/howto/write-logs.html#writing-logs-to-elasticsearch) to configure elasticsearch logging to stdout.
   
   With the configuration from the link above, this wasn't enough so I had added the `host` key to the configuration and that got me the results I wanted. The `json_format` was too noisy so I had turned that off as well.
   ```
   [core]
   # Airflow can store logs remotely in AWS S3, Google Cloud Storage or Elastic Search.
   # Users must supply an Airflow connection id that provides access to the storage
   # location. If remote_logging is set to true, see UPDATING.md for additional
   # configuration requirements.
   remote_logging = True
   
   [elasticsearch]
   host = localhost
   log_id_template = {{dag_id}}-{{task_id}}-{{execution_date}}-{{try_number}}
   end_of_log_mark = end_of_log
   write_stdout = True
   ```
   3. Execute a DAG with KubernetesPodOperator
   4. In the UI go to a task and try to view its logs. Upon doing so, get this in the UI.
   
   ![image](https://user-images.githubusercontent.com/2141830/89043991-5ad77680-d317-11ea-8003-1a078aa9ae94.png)
   
   **Anything else we need to know**:
   This issue happens with every task logs that I try to view. I would expect to be able to view the logs in the UI despite me configuring them to go somewhere else. When I did this with GCS remote logging, the UI was working. So would expect to see similar here. Though I'm not entirely surprised given that the configuration to get this to work at all seems rather backwards. I wouldn't expect to have to configure Elasticsearch logging to get logs to show up in stdout when I have no intent on using Elasticsearch. So one of the big takeaways is that more work needs to be done to improve the integration of Airflow with Kubernetes.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] kaxil commented on issue #10080: Kubernetes Executor: Logs in UI doesn't work with Elasticsearch stdout config

Posted by GitBox <gi...@apache.org>.
kaxil commented on issue #10080:
URL: https://github.com/apache/airflow/issues/10080#issuecomment-737337788


   Can you also try it with latest elastic search provider (https://pypi.org/project/apache-airflow-backport-providers-elasticsearch/):
   
   ```
   pip install apache-airflow-backport-providers-elasticsearch
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] gvisniuc commented on issue #10080: Kubernetes Executor: Logs in UI doesn't work with Elasticsearch stdout config

Posted by GitBox <gi...@apache.org>.
gvisniuc commented on issue #10080:
URL: https://github.com/apache/airflow/issues/10080#issuecomment-725598112


   I've seen this behaviour as well recently.
   Only after the task has finished do you see the logs, but if you do ssh into the running container you will find a folder in 
   $AIRFLOW_HOME
   
   for me it looks something like 
   
   `/usr/local/airflow/s3\:/my_bucket_name/my_bucket_path/datetime.log`


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] dimberman commented on issue #10080: Kubernetes Executor: Logs in UI doesn't work with Elasticsearch stdout config

Posted by GitBox <gi...@apache.org>.
dimberman commented on issue #10080:
URL: https://github.com/apache/airflow/issues/10080#issuecomment-692879020


   Hi @streetmapp, a few questions:
   
   1. Do you have a log scraper in your cluster (like fluentd, loststashe, etc.)?
   2. Are you saying that the logs are being put into a local file?
   3. Is this only happening with the K8sPodOperator?
   4. did you try setting the `get_logs` option on the K8sPodOperator?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] boring-cyborg[bot] commented on issue #10080: Kubernetes Executor: Logs in UI doesn't work with Elasticsearch stdout config

Posted by GitBox <gi...@apache.org>.
boring-cyborg[bot] commented on issue #10080:
URL: https://github.com/apache/airflow/issues/10080#issuecomment-667156281


   Thanks for opening your first issue here! Be sure to follow the issue template!
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] gvisniuc edited a comment on issue #10080: Kubernetes Executor: Logs in UI doesn't work with Elasticsearch stdout config

Posted by GitBox <gi...@apache.org>.
gvisniuc edited a comment on issue #10080:
URL: https://github.com/apache/airflow/issues/10080#issuecomment-725598112


   I've seen this behaviour as well recently.
   Only after the task has finished do you see the logs, but if you do ssh into the running container you will find a folder in 
   $AIRFLOW_HOME
   
   for me it looks something like 
   
   `/usr/local/airflow/s3\:/my_bucket_name/my_bucket_path/datetime.log`
   
   You can tail this log if you really need to check the status until there's a fix for this.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] ashb commented on issue #10080: Kubernetes Executor: Logs in UI doesn't work with Elasticsearch stdout config

Posted by GitBox <gi...@apache.org>.
ashb commented on issue #10080:
URL: https://github.com/apache/airflow/issues/10080#issuecomment-737337674


   Can someone please give us a concrete reproduction step here?
   
   Additionally is someone able to test with the backported elastic search provider?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] jhtimmins commented on issue #10080: Kubernetes Executor: Logs in UI doesn't work with Elasticsearch stdout config

Posted by GitBox <gi...@apache.org>.
jhtimmins commented on issue #10080:
URL: https://github.com/apache/airflow/issues/10080#issuecomment-859693088


   @streetmapp Is this still a problem? Are you able to give more complete reproduction steps? We'd like to get the fix in for the next release, but need additional info to reproduce this.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] kaxil edited a comment on issue #10080: Kubernetes Executor: Logs in UI doesn't work with Elasticsearch stdout config

Posted by GitBox <gi...@apache.org>.
kaxil edited a comment on issue #10080:
URL: https://github.com/apache/airflow/issues/10080#issuecomment-737337788


   Can you also try it with latest ElasticSearch backport provider (https://pypi.org/project/apache-airflow-backport-providers-elasticsearch/):
   
   ```
   pip install apache-airflow-backport-providers-elasticsearch
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] github-actions[bot] commented on issue #10080: Kubernetes Executor: Logs in UI doesn't work with Elasticsearch stdout config

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on issue #10080:
URL: https://github.com/apache/airflow/issues/10080#issuecomment-859165220


   This issue has been closed because it has not received response from the issue author.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] github-actions[bot] commented on issue #10080: Kubernetes Executor: Logs in UI doesn't work with Elasticsearch stdout config

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on issue #10080:
URL: https://github.com/apache/airflow/issues/10080#issuecomment-822092384


   This issue has been automatically marked as stale because it has been open for 30 days with no response from the author. It will be closed in next 7 days if no further activity occurs from the issue author.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] gvisniuc edited a comment on issue #10080: Kubernetes Executor: Logs in UI doesn't work with Elasticsearch stdout config

Posted by GitBox <gi...@apache.org>.
gvisniuc edited a comment on issue #10080:
URL: https://github.com/apache/airflow/issues/10080#issuecomment-725598112


   I've seen this behaviour as well recently.
   Only after the task has finished do you see the logs, but if you do ssh into the running container you will find a folder in 
   $AIRFLOW_HOME
   
   for me it looks something like ( noticed the `s3:\` directory )
   
   `/usr/local/airflow/s3\:/my_bucket_name/my_bucket_path/datetime.log`
   
   You can tail this log if you really need to check the status until there's a fix for this.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] github-actions[bot] closed issue #10080: Kubernetes Executor: Logs in UI doesn't work with Elasticsearch stdout config

Posted by GitBox <gi...@apache.org>.
github-actions[bot] closed issue #10080:
URL: https://github.com/apache/airflow/issues/10080


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on issue #10080: Kubernetes Executor: Logs in UI doesn't work with Elasticsearch stdout config

Posted by GitBox <gi...@apache.org>.
potiuk commented on issue #10080:
URL: https://github.com/apache/airflow/issues/10080#issuecomment-739787857


   Shall we remove it from 2.0.0rc1 @dimberman ?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] github-actions[bot] closed issue #10080: Kubernetes Executor: Logs in UI doesn't work with Elasticsearch stdout config

Posted by GitBox <gi...@apache.org>.
github-actions[bot] closed issue #10080:
URL: https://github.com/apache/airflow/issues/10080


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] github-actions[bot] commented on issue #10080: Kubernetes Executor: Logs in UI doesn't work with Elasticsearch stdout config

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on issue #10080:
URL: https://github.com/apache/airflow/issues/10080#issuecomment-864325761


   This issue has been closed because it has not received response from the issue author.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] vikramkoka commented on issue #10080: Kubernetes Executor: Logs in UI doesn't work with Elasticsearch stdout config

Posted by GitBox <gi...@apache.org>.
vikramkoka commented on issue #10080:
URL: https://github.com/apache/airflow/issues/10080#issuecomment-721279921


   @dimberman and @streetmapp , Is this reproducible? If it is still to be for 2.0.0, it would be good to have some next steps on this. 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org