You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Tomasz Żukowski (Jira)" <ji...@apache.org> on 2019/11/17 15:00:05 UTC

[jira] [Comment Edited] (AIRFLOW-5941) MySQLHook initialization fails when db charset is utf8mb4

    [ https://issues.apache.org/jira/browse/AIRFLOW-5941?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16976054#comment-16976054 ] 

Tomasz Żukowski edited comment on AIRFLOW-5941 at 11/17/19 2:59 PM:
--------------------------------------------------------------------

I think it is unrelated as MySQLHook uses MySQLdb connection, not sqlqlchemy, but fixing AIRFLOW-4824 will most probably solve my issue. Thanks for pointing.


was (Author: zuku):
I think it is unrelated as MySQLHook uses MySQLdb connection, not sqlqlchemy, but fixing AIRFLOW-4824 will most probably solve my issue.

> MySQLHook initialization fails when db charset is utf8mb4
> ---------------------------------------------------------
>
>                 Key: AIRFLOW-5941
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-5941
>             Project: Apache Airflow
>          Issue Type: Bug
>          Components: hooks
>    Affects Versions: 1.10.6
>         Environment: AWS EC2 instance
>            Reporter: Tomasz Żukowski
>            Priority: Minor
>
> When trying to get the connection from MySQLHook below error is raised.
> Airflow version - 1.10.6
>  MySQL version - 8.0.15
>  MySQLdb (mysqlclient) - tested with 1.3.14(both installed with pip and built locally) and 1.4.2.post1
> connection extra:
> {code:python}
> {"charset":"utf8mb4"}
> {code}
> DB charset is set to utf8mb4
>  Error message:
> {code:python}
> [2019-11-15 16:55:46,477] {taskinstance.py:1058} ERROR - (2006, "Can't initialize character set unknown (path: compiled_in)")
> Traceback (most recent call last):
>   File "/usr/local/lib/python3.7/site-packages/airflow/models/taskinstance.py", line 930, in _run_raw_task
>     result = task_copy.execute(context=context)
>   File "/usr/local/lib/python3.7/site-packages/airflow/operators/python_operator.py", line 113, in execute
>     return_value = self.execute_callable()
>   File "/usr/local/lib/python3.7/site-packages/airflow/operators/python_operator.py", line 118, in execute_callable
>     return self.python_callable(*self.op_args, **self.op_kwargs)
>   File "********", line 136, in mysql_*******
>     mysql_conn = mysql_hook.get_conn()
>   File "/usr/local/lib/python3.7/site-packages/airflow/hooks/mysql_hook.py", line 116, in get_conn
>     conn = MySQLdb.connect(**conn_config)
>   File "/usr/local/lib64/python3.7/site-packages/mysqlclient-1.3.14-py3.7-linux-x86_64.egg/MySQLdb/__init__.py", line 85, in Connect
>     return Connection(*args, **kwargs)
>   File "/usr/local/lib64/python3.7/site-packages/mysqlclient-1.3.14-py3.7-linux-x86_64.egg/MySQLdb/connections.py", line 208, in __init__
>     super(Connection, self).__init__(*args, **kwargs2)
> _mysql_exceptions.OperationalError: (2006, "Can't initialize character set unknown (path: compiled_in)")
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)