Unable to read log if the pod name is too long
See original GitHub issueApache Airflow version: 1.10.12
Kubernetes version (if you are using kubernetes) (use kubectl version
): 1.15
Environment:
- Cloud provider or hardware configuration: Not related
- OS (e.g. from /etc/os-release): Not related
- Kernel (e.g.
uname -a
): Not related - Install tools: Not related
- Others: Not related
What happened:
We are using kubernetes executor and try to read logs from webserver directly via the Kubernetes API. (https://github.com/apache/airflow/pull/12598) We found that if the pod name is longer than 63 characters, it will be 404.
*** Unable to fetch logs from worker pod thisisaverylooooooooooooooooooooongpodname-8fba3581e4614c469655 ***
(404)
Reason: Not Found
HTTP response headers: HTTPHeaderDict({'Audit-Id': 'xxxxxxxx', 'Content-Type': 'application/json', 'Date': 'Mon, 11 Jan 2021 09:57:37 GMT', 'Content-Length': '294'})
HTTP response body: b'{"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"pods \\"thisisaverylooooooooooooooooooooongpodname-8fba3581e4614c469655\\" not found","reason":"NotFound","details":{"name":"thisisaverylooooooooooooooooooooongpodname-8fba3581e4614c469655","kind":"pods"},"code":404}\n'
What you expected to happen:
*** Trying to get logs (last 100 lines) from worker pod shortnameeeeeeeeeeeeeeetask-a11e7ef862f641e4a0a4a686482f43a4 ***
[2021-01-11 10:22:29,200] {__init__.py:50} INFO - Using executor LocalExecutor
[2021-01-11 10:22:29,200] {dagbag.py:417} INFO - Filling up the DagBag from /usr/local/airflow/dags/shortname.py
How to reproduce it: Name a dag / task with long name.
Anything else we need to know:
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:6
Top Results From Across the Web
Determine the Reason for Pod Failure - Kubernetes
In the YAML file, in the command and args fields, you can see that the container sleeps for 10 seconds and then writes...
Read more >Pods restart frequently causing periodic timeout errors - IBM
This issue can occur due to frequent failing readiness probes for a pod. When the pod becomes 'not ready', you might not be...
Read more >Under condition of heavy pod creation, creation fails with 'error ...
Consequence: Pod and Container creation can stall for a long time, and many "name is reserved" errors are reported by the Kubelet.
Read more >How to Debug Kubernetes Pending Pods and Scheduling ...
Learn how to debug Pending pods that fail to get scheduled due to resource constraints, taints, affinity rules, and other reasons.
Read more >Unable to get logs from Kubernetes POD - Stack Overflow
Kubernetes only collects container logs written to stdout and this is what you get from kubectl logs . For more information, please refer...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Just found out that it is fix with this PR https://github.com/apache/airflow/pull/10942 (included in 1.10.13)
where you able to fix this issue ? I also updated to a newer version and couldn’t fix it. Same on 1.18