Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log does not show when browsing Logs on web UI #23

Open
jewel77 opened this issue Feb 12, 2018 · 4 comments
Open

Log does not show when browsing Logs on web UI #23

jewel77 opened this issue Feb 12, 2018 · 4 comments

Comments

@jewel77
Copy link

jewel77 commented Feb 12, 2018

I am very new to Kubernetes and Airflow, please bear with me if I ask some very simple questions. I had kube-airflow running on the Kubernetes cluster, but when I click "Browse" "Logs" for some DAG, I saw the message:
*** Log file isn't local.
*** Fetching here: http://worker-797654bfc5-wnpvn:8793/log/tuto_test/print_date_test/2018-02-11T00:00:00
*** Failed to fetch log file from worker.

*** Reading remote logs...
*** Unsupported remote log location.
There is a folder /usr/local/airflow/logs in the worker pod, but why the log cannot be fetched?

Any suggestion is appreciated. And thank you in advance.

@gsemet
Copy link
Contributor

gsemet commented Feb 12, 2018

I had to use statefulset on my Helm chart example in order to have these logs.

@litaxc
Copy link

litaxc commented Dec 19, 2018

Having a similar error:

*** Log file does not exist: /usr/local/airflow/logs/kubernetes_sample/bash-passing-task/2018-12-15T00:06:00+00:00/1.log
*** Fetching from: http://airflow-worker-0.airflow-worker.airflow.svc.cluster.local:8793/log/kubernetes_sample/bash-passing-task/2018-12-15T00:06:00+00:00/1.log
*** Failed to fetch log file from worker. 503 Server Error: Service Unavailable for url: http://airflow-worker-0.airflow-worker.airflow.svc.cluster.local:8793/log/kubernetes_sample/bash-passing-task/2018-12-15T00:06:00+00:00/1.log

Install airflow with helm install --name airflow --namespace airflow stable/airflow
and with image puckel/docker-airflow:1.10.1

@litaxc
Copy link

litaxc commented Dec 19, 2018

It seems to do with the docker image. I change back the image to default of helm chart puckel/docker-airflow:1.10.0-4, and it doesn't show up this error again, but encounter another error:

-------------------------------------------------------------------------------
Node: airflow-web-789c79fd4d-pdhrq
-------------------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1982, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1614, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1517, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python3.6/site-packages/flask/_compat.py", line 33, in reraise
    raise value
  File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1612, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1598, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/usr/local/lib/python3.6/site-packages/flask_admin/base.py", line 69, in inner
    return self._run_view(f, *args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/flask_admin/base.py", line 368, in _run_view
    return fn(self, *args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/flask_login.py", line 755, in decorated_view
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/airflow/www/utils.py", line 270, in wrapper
    return f(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/airflow/www/views.py", line 890, in task
    attr = getattr(ti, attr_name)
  File "/usr/local/lib/python3.6/site-packages/airflow/utils/db.py", line 74, in wrapper
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/airflow/models.py", line 1290, in previous_ti
    last_dagrun = dr.get_previous_scheduled_dagrun(session=session)
  File "/usr/local/lib/python3.6/site-packages/airflow/utils/db.py", line 70, in wrapper
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/airflow/models.py", line 4973, in get_previous_scheduled_dagrun
    DagRun.execution_date == dag.previous_schedule(self.execution_date)
  File "/usr/local/lib/python3.6/site-packages/airflow/models.py", line 3342, in previous_schedule
    dttm = timezone.make_naive(dttm, self.timezone)
  File "/usr/local/lib/python3.6/site-packages/airflow/utils/timezone.py", line 141, in make_naive
    o = value.astimezone(timezone)
  File "/usr/local/lib/python3.6/site-packages/pendulum/tz/timezone_info.py", line 99, in fromutc
    tzinfo = self._tz._tzinfos[self._tz._transitions[idx]._tzinfo_index]
IndexError: list index out of range

@witwickey
Copy link

I am very new to Kubernetes and Airflow, please bear with me if I ask some very simple questions. I had kube-airflow running on the Kubernetes cluster, but when I click "Browse" "Logs" for some DAG, I saw the message:
*** Log file isn't local.
*** Fetching here: http://worker-797654bfc5-wnpvn:8793/log/tuto_test/print_date_test/2018-02-11T00:00:00
*** Failed to fetch log file from worker.

*** Reading remote logs...
*** Unsupported remote log location.
There is a folder /usr/local/airflow/logs in the worker pod, but why the log cannot be fetched?

Any suggestion is appreciated. And thank you in advance.

Creating service for the worker solved this issue,

apiVersion: v1
kind: Service
metadata:
name: worker
spec:
type: NodePort
selector:
app: airflow
tier: worker
ports:
- name: worker
protocol: TCP
port: 8793
targetPort: worker
nodePort: 32082

Also by mentioning the following in worker deployment yaml
hostname: worker
containerPort: 8793

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants