bhavaniravi opened a new issue #21605:
URL: https://github.com/apache/airflow/issues/21605


   ### Apache Airflow Provider(s)
   
   cncf-kubernetes
   
   ### Versions of Apache Airflow Providers
   
   apache-airflow-providers-cncf-kubernetes==1!2.1.0
   
   ### Apache Airflow version
   
   2.2.3 (latest released)
   
   ### Operating System
   
   Debian GNU/Linux 10 (buster)
   
   ### Deployment
   
   Astronomer
   
   ### Deployment details
   
   _No response_
   
   ### What happened
   
   Some `KubernetesPodOperator` tasks fail with an empty logline. From the 
following logs, you could see that `monitor_pod` function 
   
   1. continuously fails to get a timestamp in log message `Error parsing 
timestamp. Will continue execution but won't update timestamp`
   2. Not able to fetch container logs `unable to retrieve container logs for 
docker://`
   3. eventually failing with an empty log line `Exception: Log not in 
"{timestamp} {log}" format. Got:`
   
   
   ### What you expected to happen
   
   _No response_
   
   ### How to reproduce
   
   Not sure what really causes this issue but this [StackOverflow 
question](https://stackoverflow.com/questions/59929589/docker-cleaning-up-kubernetes-pod-logs-too-quickly)
 Docker cleaning up the logs?
   
   ### Anything else
   
   **Complete log stacktrace***
   
   ```
   [2022-02-07, 23:33:23 UTC] {pod_launcher.py:231} ERROR - Error parsing 
timestamp. Will continue execution but won't update timestamp
   [2022-02-07, 23:33:23 UTC] {pod_launcher.py:176} INFO - rpc error: code = 
DeadlineExceeded desc = context deadline exceeded
   [2022-02-07, 23:33:24 UTC] {pod_launcher.py:192} WARNING - Pod 
dbt-hourly-run-task.537231fc6daf403484e342380a5caf53 log read interrupted
   [2022-02-07, 23:35:24 UTC] {pod_launcher.py:231} ERROR - Error parsing 
timestamp. Will continue execution but won't update timestamp
   [2022-02-07, 23:35:24 UTC] {pod_launcher.py:176} INFO - unable to retrieve 
container logs for 
docker://c2cd33567efa4a95f555ccb6d7fda760b65bb9cf2d13087d2704e2e8b974e42a
   [2022-02-07, 23:35:25 UTC] {pod_launcher.py:192} WARNING - Pod 
dbt-hourly-run-task.537231fc6daf403484e342380a5caf53 log read interrupted
   [2022-02-07, 23:37:25 UTC] {pod_launcher.py:231} ERROR - Error parsing 
timestamp. Will continue execution but won't update timestamp
   [2022-02-07, 23:37:25 UTC] {pod_launcher.py:176} INFO - unable to retrieve 
container logs for 
docker://c2cd33567efa4a95f555ccb6d7fda760b65bb9cf2d13087d2704e2e8b974e42a
   [2022-02-07, 23:37:26 UTC] {pod_launcher.py:192} WARNING - Pod 
dbt-hourly-run-task.537231fc6daf403484e342380a5caf53 log read interrupted
   [2022-02-07, 23:39:26 UTC] {pod_launcher.py:231} ERROR - Error parsing 
timestamp. Will continue execution but won't update timestamp
   [2022-02-07, 23:39:26 UTC] {pod_launcher.py:176} INFO - unable to retrieve 
container logs for 
docker://c2cd33567efa4a95f555ccb6d7fda760b65bb9cf2d13087d2704e2e8b974e42a
   [2022-02-07, 23:39:27 UTC] {pod_launcher.py:192} WARNING - Pod 
dbt-hourly-run-task.537231fc6daf403484e342380a5caf53 log read interrupted
   [2022-02-07, 23:41:27 UTC] {pod_launcher.py:231} ERROR - Error parsing 
timestamp. Will continue execution but won't update timestamp
   [2022-02-07, 23:41:27 UTC] {pod_launcher.py:176} INFO - unable to retrieve 
container logs for 
docker://c2cd33567efa4a95f555ccb6d7fda760b65bb9cf2d13087d2704e2e8b974e42a
   [2022-02-07, 23:41:28 UTC] {pod_launcher.py:192} WARNING - Pod 
dbt-hourly-run-task.537231fc6daf403484e342380a5caf53 log read interrupted
   [2022-02-07, 23:43:28 UTC] {pod_launcher.py:231} ERROR - Error parsing 
timestamp. Will continue execution but won't update timestamp
   [2022-02-07, 23:43:28 UTC] {pod_launcher.py:176} INFO - unable to retrieve 
container logs for 
docker://c2cd33567efa4a95f555ccb6d7fda760b65bb9cf2d13087d2704e2e8b974e42a
   [2022-02-07, 23:43:29 UTC] {pod_launcher.py:192} WARNING - Pod 
dbt-hourly-run-task.537231fc6daf403484e342380a5caf53 log read interrupted
   [2022-02-07, 23:45:29 UTC] {pod_launcher.py:231} ERROR - Error parsing 
timestamp. Will continue execution but won't update timestamp
   [2022-02-07, 23:45:29 UTC] {pod_launcher.py:176} INFO - unable to retrieve 
container logs for 
docker://c2cd33567efa4a95f555ccb6d7fda760b65bb9cf2d13087d2704e2e8b974e42a
   [2022-02-07, 23:45:30 UTC] {pod_launcher.py:192} WARNING - Pod 
dbt-hourly-run-task.537231fc6daf403484e342380a5caf53 log read interrupted
   [2022-02-07, 23:47:30 UTC] {pod_launcher.py:231} ERROR - Error parsing 
timestamp. Will continue execution but won't update timestamp
   [2022-02-07, 23:47:30 UTC] {pod_launcher.py:176} INFO - unable to retrieve 
container logs for 
docker://c2cd33567efa4a95f555ccb6d7fda760b65bb9cf2d13087d2704e2e8b974e42a
   [2022-02-07, 23:47:31 UTC] {pod_launcher.py:192} WARNING - Pod 
dbt-hourly-run-task.537231fc6daf403484e342380a5caf53 log read interrupted
   [2022-02-07, 23:49:31 UTC] {pod_launcher.py:231} ERROR - Error parsing 
timestamp. Will continue execution but won't update timestamp
   [2022-02-07, 23:49:31 UTC] {pod_launcher.py:176} INFO - unable to retrieve 
container logs for 
docker://c2cd33567efa4a95f555ccb6d7fda760b65bb9cf2d13087d2704e2e8b974e42a
   [2022-02-07, 23:49:32 UTC] {pod_launcher.py:192} WARNING - Pod 
dbt-hourly-run-task.537231fc6daf403484e342380a5caf53 log read interrupted
   [2022-02-07, 23:51:32 UTC] {pod_launcher.py:231} ERROR - Error parsing 
timestamp. Will continue execution but won't update timestamp
   [2022-02-07, 23:51:32 UTC] {pod_launcher.py:176} INFO - unable to retrieve 
container logs for 
docker://c2cd33567efa4a95f555ccb6d7fda760b65bb9cf2d13087d2704e2e8b974e42a
   [2022-02-07, 23:51:33 UTC] {pod_launcher.py:192} WARNING - Pod 
dbt-hourly-run-task.537231fc6daf403484e342380a5caf53 log read interrupted
   [2022-02-07, 23:51:56 UTC] {taskinstance.py:1700} ERROR - Task failed with 
exception
   Traceback (most recent call last):
     File 
"/usr/local/lib/python3.9/site-packages/airflow/models/taskinstance.py", line 
1329, in _run_raw_task
       self._execute_task_with_callbacks(context)
     File 
"/usr/local/lib/python3.9/site-packages/airflow/models/taskinstance.py", line 
1455, in _execute_task_with_callbacks
       result = self._execute_task(context, self.task)
     File 
"/usr/local/lib/python3.9/site-packages/airflow/models/taskinstance.py", line 
1506, in _execute_task
       result = execute_callable(context=context)
     File 
"/usr/local/lib/python3.9/site-packages/airflow/providers/cncf/kubernetes/operators/kubernetes_pod.py",
 line 367, in execute
       final_state, remote_pod, result = 
self.create_new_pod_for_operator(labels, launcher)
     File 
"/usr/local/lib/python3.9/site-packages/airflow/providers/cncf/kubernetes/operators/kubernetes_pod.py",
 line 524, in create_new_pod_for_operator
       final_state, remote_pod, result = launcher.monitor_pod(pod=self.pod, 
get_logs=self.get_logs)
     File 
"/usr/local/lib/python3.9/site-packages/airflow/providers/cncf/kubernetes/utils/pod_launcher.py",
 line 175, in monitor_pod
       timestamp, message = self.parse_log_line(line.decode('utf-8'))
     File 
"/usr/local/lib/python3.9/site-packages/airflow/providers/cncf/kubernetes/utils/pod_launcher.py",
 line 225, in parse_log_line
       raise Exception(f'Log not in "{{timestamp}} {{log}}" format. Got: 
{line}')
   Exception: Log not in "{timestamp} {log}" format. Got:
   ```
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to