AndrewTsao commented on PR #28191:
URL: https://github.com/apache/airflow/pull/28191#issuecomment-1384749135
Hi, I tested #28146 got another exception like this. My SQL version 5.7.
Python 3.8, OS is centos 7.9.
python modules list:
```
apache-airflow 2.5.1rc1
apache-airflow-providers-celery 3.0.0
apache-airflow-providers-common-sql 1.0.0
apache-airflow-providers-ftp 3.0.0
apache-airflow-providers-http 3.0.0
apache-airflow-providers-imap 3.0.0
apache-airflow-providers-microsoft-mssql 3.1.0
apache-airflow-providers-microsoft-psrp 2.1.0
apache-airflow-providers-microsoft-winrm 3.0.0
apache-airflow-providers-mysql 3.0.0
apache-airflow-providers-redis 3.0.0
apache-airflow-providers-samba 4.0.0
apache-airflow-providers-sftp 3.0.0
apache-airflow-providers-sqlite 3.0.0
apache-airflow-providers-ssh 3.0.0
apache-airflow-providers-common-sql 1.0.0
apache-airflow-providers-microsoft-mssql 3.1.0
apache-airflow-providers-mysql 3.0.0
apache-airflow-providers-sqlite 3.0.0
Flask-SQLAlchemy 2.5.1
marshmallow-sqlalchemy 0.26.1
mysql-connector-python 8.0.29
mysqlclient 2.1.1
pymssql 2.2.5
SQLAlchemy 1.4.46
SQLAlchemy-JSONField 1.0.0
SQLAlchemy-Utils 0.38.3
```
```sh
[2023-01-17, 09:38:01 CST] {process_utils.py:179} INFO - Executing cmd:
/home/andi/airflow/venv38/bin/python -m virtualenv /tmp/venvtb4apfe2
--system-site-packages
[2023-01-17, 09:38:01 CST] {process_utils.py:183} INFO - Output:
[2023-01-17, 09:38:02 CST] {process_utils.py:187} INFO - created virtual
environment CPython3.8.0.final.0-64 in 236ms
[2023-01-17, 09:38:02 CST] {process_utils.py:187} INFO - creator
CPython3Posix(dest=/tmp/venvtb4apfe2, clear=False, no_vcs_ignore=False,
global=True)
[2023-01-17, 09:38:02 CST] {process_utils.py:187} INFO - seeder
FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle,
via=copy, app_data_dir=/home/andi/.local/share/virtualenv)
[2023-01-17, 09:38:02 CST] {process_utils.py:187} INFO - added seed
packages: pip==22.3.1, setuptools==65.6.3, wheel==0.38.4
[2023-01-17, 09:38:02 CST] {process_utils.py:187} INFO - activators
BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator
[2023-01-17, 09:38:02 CST] {process_utils.py:179} INFO - Executing cmd:
/tmp/venvtb4apfe2/bin/pip install -r /tmp/venvtb4apfe2/requirements.txt
[2023-01-17, 09:38:02 CST] {process_utils.py:183} INFO - Output:
[2023-01-17, 09:38:03 CST] {process_utils.py:187} INFO - Looking in indexes:
http://pypi:8081
[2023-01-17, 09:38:08 CST] {process_utils.py:179} INFO - Executing cmd:
/tmp/venvtb4apfe2/bin/python /tmp/venvtb4apfe2/script.py
/tmp/venvtb4apfe2/script.in /tmp/venvtb4apfe2/script.out
/tmp/venvtb4apfe2/string_args.txt
[2023-01-17, 09:38:08 CST] {process_utils.py:183} INFO - Output:
[2023-01-17, 09:38:10 CST] {process_utils.py:187} INFO - Traceback (most
recent call last):
[2023-01-17, 09:38:10 CST] {process_utils.py:187} INFO - File
"/home/andi/airflow/venv38/lib/python3.8/site-packages/sqlalchemy/engine/base.py",
line 1900, in _execute_context
[2023-01-17, 09:38:10 CST] {process_utils.py:187} INFO -
self.dialect.do_execute(
[2023-01-17, 09:38:10 CST] {process_utils.py:187} INFO - File
"/home/andi/airflow/venv38/lib/python3.8/site-packages/sqlalchemy/engine/default.py",
line 736, in do_execute
[2023-01-17, 09:38:10 CST] {process_utils.py:187} INFO -
cursor.execute(statement, parameters)
[2023-01-17, 09:38:10 CST] {process_utils.py:187} INFO - File
"/home/andi/airflow/venv38/lib/python3.8/site-packages/MySQLdb/cursors.py",
line 206, in execute
[2023-01-17, 09:38:10 CST] {process_utils.py:187} INFO - res =
self._query(query)
[2023-01-17, 09:38:10 CST] {process_utils.py:187} INFO - File
"/home/andi/airflow/venv38/lib/python3.8/site-packages/MySQLdb/cursors.py",
line 319, in _query
[2023-01-17, 09:38:10 CST] {process_utils.py:187} INFO - db.query(q)
[2023-01-17, 09:38:10 CST] {process_utils.py:187} INFO - File
"/home/andi/airflow/venv38/lib/python3.8/site-packages/MySQLdb/connections.py",
line 254, in query
[2023-01-17, 09:38:10 CST] {process_utils.py:187} INFO -
_mysql.connection.query(self, query)
[2023-01-17, 09:38:10 CST] {process_utils.py:187} INFO -
MySQLdb.ProgrammingError: (1064, "You have an error in your SQL syntax; check
the manual that corresponds to your MySQL server version for the right syntax
to use near '%s AND xcom.task_id = %s AND xcom.dag_id = %s AND xcom.run_id = %s
ORDER BY xcom' at line 3")
[2023-01-17, 09:38:10 CST] {process_utils.py:187} INFO -
[2023-01-17, 09:38:10 CST] {process_utils.py:187} INFO - The above exception
was the direct cause of the following exception:
[2023-01-17, 09:38:10 CST] {process_utils.py:187} INFO -
[2023-01-17, 09:38:10 CST] {process_utils.py:187} INFO - Traceback (most
recent call last):
[2023-01-17, 09:38:10 CST] {process_utils.py:187} INFO - File
"/tmp/venvtb4apfe2/script.py", line 29, in <module>
[2023-01-17, 09:38:10 CST] {process_utils.py:187} INFO - res =
sum_it(*arg_dict["args"], **arg_dict["kwargs"])
[2023-01-17, 09:38:10 CST] {process_utils.py:187} INFO - File
"/tmp/venvtb4apfe2/script.py", line 27, in sum_it
[2023-01-17, 09:38:10 CST] {process_utils.py:187} INFO - print(values)
[2023-01-17, 09:38:10 CST] {process_utils.py:187} INFO - File
"/home/andi/airflow/venv38/lib/python3.8/site-packages/airflow/models/xcom.py",
line 718, in __str__
[2023-01-17, 09:38:10 CST] {process_utils.py:187} INFO - return
str(list(self))
[2023-01-17, 09:38:10 CST] {process_utils.py:187} INFO - File
"/home/andi/airflow/venv38/lib/python3.8/site-packages/airflow/models/xcom.py",
line 688, in __next__
[2023-01-17, 09:38:10 CST] {process_utils.py:187} INFO - return
XCom.deserialize_value(next(self._it))
[2023-01-17, 09:38:10 CST] {process_utils.py:187} INFO - File
"/home/andi/airflow/venv38/lib/python3.8/site-packages/sqlalchemy/orm/query.py",
line 2900, in __iter__
[2023-01-17, 09:38:10 CST] {process_utils.py:187} INFO - result =
self._iter()
[2023-01-17, 09:38:10 CST] {process_utils.py:187} INFO - File
"/home/andi/airflow/venv38/lib/python3.8/site-packages/sqlalchemy/orm/query.py",
line 2915, in _iter
[2023-01-17, 09:38:10 CST] {process_utils.py:187} INFO - result =
self.session.execute(
[2023-01-17, 09:38:10 CST] {process_utils.py:187} INFO - File
"/home/andi/airflow/venv38/lib/python3.8/site-packages/sqlalchemy/orm/session.py",
line 1714, in execute
[2023-01-17, 09:38:10 CST] {process_utils.py:187} INFO - result =
conn._execute_20(statement, params or {}, execution_options)
[2023-01-17, 09:38:10 CST] {process_utils.py:187} INFO - File
"/home/andi/airflow/venv38/lib/python3.8/site-packages/sqlalchemy/engine/base.py",
line 1705, in _execute_20
[2023-01-17, 09:38:10 CST] {process_utils.py:187} INFO - return
meth(self, args_10style, kwargs_10style, execution_options)
[2023-01-17, 09:38:10 CST] {process_utils.py:187} INFO - File
"/home/andi/airflow/venv38/lib/python3.8/site-packages/sqlalchemy/sql/elements.py",
line 334, in _execute_on_connection
[2023-01-17, 09:38:10 CST] {process_utils.py:187} INFO - return
connection._execute_clauseelement(
[2023-01-17, 09:38:10 CST] {process_utils.py:187} INFO - File
"/home/andi/airflow/venv38/lib/python3.8/site-packages/sqlalchemy/engine/base.py",
line 1572, in _execute_clauseelement
[2023-01-17, 09:38:10 CST] {process_utils.py:187} INFO - ret =
self._execute_context(
[2023-01-17, 09:38:10 CST] {process_utils.py:187} INFO - File
"/home/andi/airflow/venv38/lib/python3.8/site-packages/sqlalchemy/engine/base.py",
line 1943, in _execute_context
[2023-01-17, 09:38:10 CST] {process_utils.py:187} INFO -
self._handle_dbapi_exception(
[2023-01-17, 09:38:10 CST] {process_utils.py:187} INFO - File
"/home/andi/airflow/venv38/lib/python3.8/site-packages/sqlalchemy/engine/base.py",
line 2124, in _handle_dbapi_exception
[2023-01-17, 09:38:10 CST] {process_utils.py:187} INFO - util.raise_(
[2023-01-17, 09:38:10 CST] {process_utils.py:187} INFO - File
"/home/andi/airflow/venv38/lib/python3.8/site-packages/sqlalchemy/util/compat.py",
line 210, in raise_
[2023-01-17, 09:38:10 CST] {process_utils.py:187} INFO - raise exception
[2023-01-17, 09:38:10 CST] {process_utils.py:187} INFO - File
"/home/andi/airflow/venv38/lib/python3.8/site-packages/sqlalchemy/engine/base.py",
line 1900, in _execute_context
[2023-01-17, 09:38:10 CST] {process_utils.py:187} INFO -
self.dialect.do_execute(
[2023-01-17, 09:38:10 CST] {process_utils.py:187} INFO - File
"/home/andi/airflow/venv38/lib/python3.8/site-packages/sqlalchemy/engine/default.py",
line 736, in do_execute
[2023-01-17, 09:38:10 CST] {process_utils.py:187} INFO -
cursor.execute(statement, parameters)
[2023-01-17, 09:38:10 CST] {process_utils.py:187} INFO - File
"/home/andi/airflow/venv38/lib/python3.8/site-packages/MySQLdb/cursors.py",
line 206, in execute
[2023-01-17, 09:38:10 CST] {process_utils.py:187} INFO - res =
self._query(query)
[2023-01-17, 09:38:10 CST] {process_utils.py:187} INFO - File
"/home/andi/airflow/venv38/lib/python3.8/site-packages/MySQLdb/cursors.py",
line 319, in _query
[2023-01-17, 09:38:10 CST] {process_utils.py:187} INFO - db.query(q)
[2023-01-17, 09:38:10 CST] {process_utils.py:187} INFO - File
"/home/andi/airflow/venv38/lib/python3.8/site-packages/MySQLdb/connections.py",
line 254, in query
[2023-01-17, 09:38:10 CST] {process_utils.py:187} INFO -
_mysql.connection.query(self, query)
[2023-01-17, 09:38:10 CST] {process_utils.py:187} INFO -
sqlalchemy.exc.ProgrammingError: (MySQLdb.ProgrammingError) (1064, "You have an
error in your SQL syntax; check the manual that corresponds to your MySQL
server version for the right syntax to use near '%s AND xcom.task_id = %s AND
xcom.dag_id = %s AND xcom.run_id = %s ORDER BY xcom' at line 3")
[2023-01-17, 09:38:10 CST] {process_utils.py:187} INFO - [SQL: SELECT
xcom.value
[2023-01-17, 09:38:10 CST] {process_utils.py:187} INFO - FROM xcom INNER
JOIN dag_run ON xcom.dag_run_id = dag_run.id
[2023-01-17, 09:38:10 CST] {process_utils.py:187} INFO - WHERE xcom.`key` =
%%s AND xcom.task_id = %%s AND xcom.dag_id = %%s AND xcom.run_id = %%s ORDER BY
xcom.map_index ASC]
[2023-01-17, 09:38:10 CST] {process_utils.py:187} INFO - (Background on this
error at: https://sqlalche.me/e/14/f405)
[2023-01-17, 09:38:11 CST] {taskinstance.py:1768} ERROR - Task failed with
exception
Traceback (most recent call last):
File
"/home/andi/airflow/venv38/lib/python3.8/site-packages/airflow/decorators/base.py",
line 217, in execute
return_value = super().execute(context)
File
"/home/andi/airflow/venv38/lib/python3.8/site-packages/airflow/operators/python.py",
line 356, in execute
return super().execute(context=serializable_context)
File
"/home/andi/airflow/venv38/lib/python3.8/site-packages/airflow/operators/python.py",
line 175, in execute
return_value = self.execute_callable()
File
"/home/andi/airflow/venv38/lib/python3.8/site-packages/airflow/operators/python.py",
line 553, in execute_callable
return self._execute_python_callable_in_subprocess(python_path, tmp_path)
File
"/home/andi/airflow/venv38/lib/python3.8/site-packages/airflow/operators/python.py",
line 412, in _execute_python_callable_in_subprocess
execute_in_subprocess(
File
"/home/andi/airflow/venv38/lib/python3.8/site-packages/airflow/utils/process_utils.py",
line 168, in execute_in_subprocess
execute_in_subprocess_with_kwargs(cmd, cwd=cwd)
File
"/home/andi/airflow/venv38/lib/python3.8/site-packages/airflow/utils/process_utils.py",
line 191, in execute_in_subprocess_with_kwargs
raise subprocess.CalledProcessError(exit_code, cmd)
subprocess.CalledProcessError: Command '['/tmp/venvtb4apfe2/bin/python',
'/tmp/venvtb4apfe2/script.py', '/tmp/venvtb4apfe2/script.in',
'/tmp/venvtb4apfe2/script.out', '/tmp/venvtb4apfe2/string_args.txt']' returned
non-zero exit status 1.
[2023-01-17, 09:38:11 CST] {taskinstance.py:1318} INFO - Marking task as
FAILED. dag_id=test-dynamic-tasks, task_id=sum_it,
execution_date=20230117T013747, start_date=20230117T013801,
end_date=20230117T013811
[2023-01-17, 09:38:11 CST] {standard_task_runner.py:100} ERROR - Failed to
execute job 47464 for task sum_it (Command '['/tmp/venvtb4apfe2/bin/python',
'/tmp/venvtb4apfe2/script.py', '/tmp/venvtb4apfe2/script.in',
'/tmp/venvtb4apfe2/script.out', '/tmp/venvtb4apfe2/string_args.txt']' returned
non-zero exit status 1.; 22355)
[2023-01-17, 09:38:11 CST] {local_task_job.py:208} INFO - Task exited with
return code 1
[2023-01-17, 09:38:11 CST] {taskinstance.py:2578} INFO - 0 downstream tasks
scheduled from follow-on schedule check
```
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]