freedom1989 opened a new issue #9100:
URL: https://github.com/apache/airflow/issues/9100
<!--
IMPORTANT!!!
PLEASE CHECK "SIMILAR TO X EXISTING ISSUES" OPTION IF VISIBLE
NEXT TO "SUBMIT NEW ISSUE" BUTTON!!!
PLEASE CHECK IF THIS ISSUE HAS BEEN REPORTED PREVIOUSLY USING SEARCH!!!
Please complete the next sections or the issue will be closed.
This questions are the first thing we need to know to understand the context.
-->
**Apache Airflow version**: 1.10.10
**Kubernetes version (if you are using kubernetes)** (use `kubectl version`):
**Environment**:
- **Cloud provider or hardware configuration**: Inside docker
- **OS** (e.g. from /etc/os-release): Ubuntu 16.04
- **Kernel** (e.g. `uname -a`):
- **Install tools**:
- **Others**:
**What happened**:
Got the following error when I enabled rbac:
`[2020-06-02 08:24:41,561] {app.py:1891} ERROR - Exception on /home [GET]
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 2446, in
wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 1951, in
full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 1820, in
handle_user_exception
reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python3.7/dist-packages/flask/_compat.py", line 39,
in reraise
raise value
File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 1949, in
full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 1935, in
dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File
"/usr/local/lib/python3.7/dist-packages/flask_appbuilder/security/decorators.py",
line 109, in wraps
return f(self, *args, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/airflow/utils/db.py", line
74, in wrapper
return func(*args, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/airflow/www_rbac/views.py",
line 332, in index
tags=tags)
File "/usr/local/lib/python3.7/dist-packages/airflow/www_rbac/views.py",
line 186, in render_template
**kwargs
File
"/usr/local/lib/python3.7/dist-packages/flask_appbuilder/baseviews.py", line
281, in render_template
template, **dict(list(kwargs.items()) + list(self.extra_args.items()))
File "/usr/local/lib/python3.7/dist-packages/flask/templating.py", line
140, in render_template
ctx.app,
File "/usr/local/lib/python3.7/dist-packages/flask/templating.py", line
120, in _render
rv = template.render(context)
File "/usr/local/lib/python3.7/dist-packages/jinja2/asyncsupport.py", line
76, in render
return original_render(self, *args, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/jinja2/environment.py", line
1008, in render
return self.environment.handle_exception(exc_info, True)
File "/usr/local/lib/python3.7/dist-packages/jinja2/environment.py", line
780, in handle_exception
reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python3.7/dist-packages/jinja2/_compat.py", line 37,
in reraise
raise value.with_traceback(tb)
File
"/usr/local/lib/python3.7/dist-packages/airflow/www_rbac/templates/airflow/dags.html",
line 19, in top-level template code
{% extends base_template %}
File "/usr/local/lib/python3.7/dist-packages/jinja2/environment.py", line
1005, in render
return concat(self.root_render_func(self.new_context(vars)))
File
"/usr/local/lib/python3.7/dist-packages/airflow/www_rbac/templates/airflow/dags.html",
line 17, in root
#}
File
"/usr/local/lib/python3.7/dist-packages/airflow/www_rbac/templates/airflow/master.html",
line 16, in root
File
"/usr/local/lib/python3.7/dist-packages/flask_appbuilder/templates/appbuilder/baselayout.html",
line 17, in root
{% include 'appbuilder/flash.html' %}
File
"/usr/local/lib/python3.7/dist-packages/flask_appbuilder/templates/appbuilder/init.html",
line 32, in root
<link
href="{{url_for('appbuilder.static',filename='select2/select2.css')}}"
rel="stylesheet">
File
"/usr/local/lib/python3.7/dist-packages/flask_appbuilder/templates/appbuilder/baselayout.html",
line 26, in block_body
<div class="img-rounded nav-fixed-bottom">
File
"/usr/local/lib/python3.7/dist-packages/flask_appbuilder/templates/appbuilder/general/confirm.html",
line 12, in root
<div class="modal-footer">
File "/usr/local/lib/python3.7/dist-packages/jinja2/runtime.py", line 262,
in call
return __obj(*args, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/jinja2/ext.py", line 134, in
_gettext_alias
return __context.call(__context.resolve('gettext'), *args, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/jinja2/ext.py", line 140, in
gettext
rv = __context.call(func, __string)
File "/usr/local/lib/python3.7/dist-packages/flask_babel/__init__.py",
line 110, in <lambda>
lambda x: get_translations().ugettext(x),
File "/usr/local/lib/python3.7/dist-packages/flask_babel/__init__.py",
line 221, in get_translations
[get_locale()],
File "/usr/local/lib/python3.7/dist-packages/flask_babel/__init__.py",
line 255, in get_locale
locale = Locale.parse(rv)
File "/usr/local/lib/python3.7/dist-packages/babel/core.py", line 266, in
parse
raise TypeError('Unexpected value for identifier: %r' % (identifier,))
TypeError: Unexpected value for identifier: b'en'`
Here is my dockerfile:
`FROM ubuntu:16.04
# Never prompts the user for choices on installation/configuration of
packages
ENV DEBIAN_FRONTEND noninteractive LANGUAGE=C.UTF-8 LANG=C.UTF-8
LC_ALL=C.UTF-8 \
LC_CTYPE=C.UTF-8 LC_MESSAGES=C.UTF-8
ENV TERM linux
ENV SLUGIFY_USES_TEXT_UNIDECODE=yes
# Airflow
ARG AIRFLOW_VERSION=1.10.10
ARG PYTHON_VERSION=3.7
ARG AIRFLOW_HOME=/usr/local/airflow
# specify airflow work dirctory
ENV AIRFLOW_HOME=${AIRFLOW_HOME}
RUN buildDeps=' \
build-essential \
software-properties-common \
libpq-dev \
libkrb5-dev \
libsasl2-dev \
libssl-dev \
libffi-dev \
git' \
&& apt-get update -yqq --fix-missing \
&& apt-get install -yqq --no-install-recommends $buildDeps
RUN add-apt-repository ppa:deadsnakes/ppa \
&& apt-get update -yqq --fix-missing
RUN apt-get install -yqq \
python${PYTHON_VERSION} \
python${PYTHON_VERSION}-dev \
python${PYTHON_VERSION}-distutils \
libmysqlclient-dev \
libmysqld-dev \
openssl \
sqlite \
postgresql \
apt-utils \
curl \
netcat \
locales \
cron \
iproute2 \
&& useradd -ms /bin/bash -d ${AIRFLOW_HOME} airflow
RUN update-alternatives --install /usr/bin/python3 python3
/usr/bin/python${PYTHON_VERSION} 1
RUN curl https://bootstrap.pypa.io/get-pip.py | python3
RUN /bin/sh -c cd /usr/bin && ln -s pydoc3 pydoc && ln -s python3 python &&
ln -s python3-config python-config
RUN pip install --upgrade pip \
&& pip install -U setuptools \
awscli \
boto3 \
opsgenie-sdk==0.3.1 \
docker \
datadog \
python-jenkins \
cryptography \
psycopg2-binary==2.8.4 \
apache-airflow==${AIRFLOW_VERSION} \
apache-airflow[celery,crypto,kubernetes,password,postgres,redis,ssh,statsd]==${AIRFLOW_VERSION}
\
--constraint
https://raw.githubusercontent.com/apache/airflow/1.10.10/requirements/requirements-python${PYTHON_VERSION}.txt
RUN apt-get remove --purge -yqq $buildDeps \
&& apt-get clean \
&& rm -rf \
/var/lib/apt/lists/* \
/tmp/* \
/var/tmp/* \
/usr/share/man \
/usr/share/doc \
/usr/share/doc-base
RUN chown -R airflow: ${AIRFLOW_HOME}
EXPOSE 8080 5555 8793
USER airflow
WORKDIR ${AIRFLOW_HOME}
`
----------------------------------------------------------------
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:
[email protected]