0

当我转到Webserver UI中的Admin-->Xcom部分时,我收到此错误:Airflow 2.1.2

Traceback (most recent call last):
  File "/home/airflow/.local/lib/python3.8/site-packages/flask/app.py", line 2447, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/airflow/.local/lib/python3.8/site-packages/flask/app.py", line 1952, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/airflow/.local/lib/python3.8/site-packages/flask/app.py", line 1821, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/home/airflow/.local/lib/python3.8/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/home/airflow/.local/lib/python3.8/site-packages/flask/app.py", line 1950, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/airflow/.local/lib/python3.8/site-packages/flask/app.py", line 1936, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/home/airflow/.local/lib/python3.8/site-packages/flask_appbuilder/security/decorators.py", line 109, in wraps
    return f(self, *args, **kwargs)
  File "/home/airflow/.local/lib/python3.8/site-packages/flask_appbuilder/views.py", line 552, in list
    return self.render_template(
  File "/home/airflow/.local/lib/python3.8/site-packages/flask_appbuilder/baseviews.py", line 287, in render_template
    return render_template(
  File "/home/airflow/.local/lib/python3.8/site-packages/flask/templating.py", line 137, in render_template
    return _render(
  File "/home/airflow/.local/lib/python3.8/site-packages/flask/templating.py", line 120, in _render
    rv = template.render(context)
  File "/home/airflow/.local/lib/python3.8/site-packages/jinja2/environment.py", line 1090, in render
    self.environment.handle_exception()
  File "/home/airflow/.local/lib/python3.8/site-packages/jinja2/environment.py", line 832, in handle_exception
    reraise(*rewrite_traceback_stack(source=source))
  File "/home/airflow/.local/lib/python3.8/site-packages/jinja2/_compat.py", line 28, in reraise
    raise value.with_traceback(tb)
  File "/home/airflow/.local/lib/python3.8/site-packages/flask_appbuilder/templates/appbuilder/general/model/list.html", line 2, in top-level template code
    {% import 'appbuilder/general/lib.html' as lib %}
  File "/home/airflow/.local/lib/python3.8/site-packages/flask_appbuilder/templates/appbuilder/base.html", line 1, in top-level template code
    {% extends base_template %}
  File "/home/airflow/.local/lib/python3.8/site-packages/airflow/www/templates/airflow/main.html", line 20, in top-level template code
    {% extends 'appbuilder/baselayout.html' %}
  File "/home/airflow/.local/lib/python3.8/site-packages/flask_appbuilder/templates/appbuilder/baselayout.html", line 2, in top-level template code
    {% import 'appbuilder/baselib.html' as baselib %}
  File "/home/airflow/.local/lib/python3.8/site-packages/flask_appbuilder/templates/appbuilder/init.html", line 37, in top-level template code
    {% block body %}
  File "/home/airflow/.local/lib/python3.8/site-packages/flask_appbuilder/templates/appbuilder/baselayout.html", line 19, in block "body"
    {% block content %}
  File "/home/airflow/.local/lib/python3.8/site-packages/flask_appbuilder/templates/appbuilder/general/model/list.html", line 13, in block "content"
    {% block list_list scoped %}
  File "/home/airflow/.local/lib/python3.8/site-packages/flask_appbuilder/templates/appbuilder/general/model/list.html", line 15, in block "list_list"
    {{ widgets.get('list')()|safe }}
  File "/home/airflow/.local/lib/python3.8/site-packages/flask_appbuilder/widgets.py", line 37, in __call__
    return template.render(args)
  File "/home/airflow/.local/lib/python3.8/site-packages/jinja2/environment.py", line 1090, in render
    self.environment.handle_exception()
  File "/home/airflow/.local/lib/python3.8/site-packages/jinja2/environment.py", line 832, in handle_exception
    reraise(*rewrite_traceback_stack(source=source))
  File "/home/airflow/.local/lib/python3.8/site-packages/jinja2/_compat.py", line 28, in reraise
    raise value.with_traceback(tb)
  File "/home/airflow/.local/lib/python3.8/site-packages/airflow/www/templates/airflow/model_list.html", line 21, in top-level template code
    {% extends 'appbuilder/general/widgets/base_list.html' %}
  File "/home/airflow/.local/lib/python3.8/site-packages/flask_appbuilder/templates/appbuilder/general/widgets/base_list.html", line 23, in top-level template code
    {% block begin_loop_values %}
  File "/home/airflow/.local/lib/python3.8/site-packages/airflow/www/templates/airflow/model_list.html", line 80, in block "begin_loop_values"
    {% elif item[value] != None %}
  File "/home/airflow/.local/lib/python3.8/site-packages/pandas/core/generic.py", line 1537, in __nonzero__
    raise ValueError(
ValueError: The truth value of a DataFrame is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().

我怎样才能解决这个问题?

Dockerfile:

FROM apache/airflow:2.1.2-python3.8

ARG AIRFLOW_USER_HOME=/opt/airflow

ENV PYTHONPATH "${PYTHONPATH}:/"

RUN pip install -r /requirements.pip

码头工人组成:

version: '3'
services:
  webserver:
    image: my_airflow2
    command: webserver
    ports:
      - 8080:8080
    healthcheck:
      test: [ "CMD", "curl", "--fail", "http://localhost:8080/health" ]
      interval: 10s
      timeout: 10s
      retries: 5
    restart: always
    build:
      context: .
      dockerfile: Dockerfile
    env_file:
      - ./airflow.env
    container_name: my_webserver_container
    volumes:
      - ./database_utils:/database_utils
  scheduler:
    image: my_airflow2
    command: scheduler
    healthcheck:
      test: [ "CMD-SHELL", 'airflow jobs check --job-type SchedulerJob --hostname "$${HOSTNAME}"' ]
      interval: 10s
      timeout: 10s
      retries: 5
    restart: always
    container_name: my_scheduler_container
    build:
      context: .
      dockerfile: Dockerfile
    env_file:
      - ./airflow.env
    volumes:
      - ./database_utils:/database_utils
    depends_on:
      - webserver
4

0 回答 0