ashb opened a new issue #8634:
URL: https://github.com/apache/airflow/issues/8634
**Apache Airflow version**: 1.10.5, and 1.10.10
**What happened**:
If you include non-Ascii characters in a dag ID, and enable statsd metrics,
it causes the webserver to fail to start.
(It is only the statsd part that causes an issue, the rest of Airflow
appears to cope fine with the non-US chars.
For example
```python
dag = DAG(dag_id='non_ascii_ñ')
```
The error is:
```
File "/usr/bin/airflow", line 32, in <module>
args.func(args)
File "/usr/lib/python3.7/site-packages/airflow/utils/cli.py", line 74, in
wrapper
return f(*args, **kwargs)
File "/usr/lib/python3.7/site-packages/airflow/bin/cli.py", line 1472, in
sync_perm
appbuilder = cached_appbuilder()
File "/usr/lib/python3.7/site-packages/airflow/www_rbac/app.py", line 246,
in cached_appbuilder
cached_app(config=config, testing=testing)
File "/usr/lib/python3.7/site-packages/airflow/www_rbac/app.py", line 239,
in cached_app
app, _ = create_app(config, session, testing)
File "/usr/lib/python3.7/site-packages/airflow/www_rbac/app.py", line 186,
in create_app
init_views(appbuilder)
File "/usr/lib/python3.7/site-packages/airflow/www_rbac/app.py", line 106,
in init_views
from airflow.www_rbac import views
File "/usr/lib/python3.7/site-packages/airflow/www_rbac/views.py", line
77, in <module>
dagbag = models.DagBag(settings.DAGS_FOLDER,
store_serialized_dags=STORE_SERIALIZED_DAGS)
File "/usr/lib/python3.7/site-packages/airflow/models/dagbag.py", line
108, in __init__
safe_mode=safe_mode)
File "/usr/lib/python3.7/site-packages/airflow/models/dagbag.py", line
456, in collect_dags
file_stat.duration)
File "/usr/lib/python3.7/site-packages/statsd/client/base.py", line 31, in
timing
self._send_stat(stat, '%0.6f|ms' % delta, rate)
File "/usr/lib/python3.7/site-packages/statsd/client/base.py", line 59, in
_send_stat
self._after(self._prepare(stat, value, rate))
File "/usr/lib/python3.7/site-packages/statsd/client/base.py", line 74, in
_after
self._send(data)
File "/usr/lib/python3.7/site-packages/statsd/client/udp.py", line 44, in
_send
self._sock.sendto(data.encode('ascii'), self._addr)
UnicodeEncodeError: 'ascii' codec can't encode character '\xf1' in position
38: ordinal not in range(128)
```
----------------------------------------------------------------
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]