jatskin opened a new issue #11296:
URL: https://github.com/apache/airflow/issues/11296
<!--
Welcome to Apache Airflow! For a smooth issue process, try to answer the
following questions.
Don't worry if they're not all applicable; just try to include what you can
:-)
If you need to include code snippets or logs, please put them in fenced code
blocks. If they're super-long, please use the details tag like
<details><summary>super-long log</summary> lots of stuff </details>
Please delete these comment blocks before submitting the issue.
-->
<!--
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.
These questions are the first thing we need to know to understand the
context.
-->
**Apache Airflow version**: 1.10.12
**Kubernetes version (if you are using kubernetes)** (use `kubectl
version`): 1.11
**Environment**:
- **Cloud provider or hardware configuration**:
- **OS** (e.g. from /etc/os-release):
- **Kernel** (e.g. `uname -a`):
- **Install tools**:
- **Others**:
**What happened**:
<!-- (please include exact error messages if you can) -->
I try to use MS SQL 2017 database as backend. Airflow successfully
initializes the database. But I can't start the DAG.
There are similar repeated errors in the logs:
Traceback (most recent call last):
| File "/usr/local/lib/python3.8/multiprocessing/process.py", line 315, in
_bootstrap
| self.run()
| File "/usr/local/lib/python3.8/multiprocessing/process.py", line 108, in
run
| self._target(*self._args, **self._kwargs)
| File
"/home/airflow/.local/lib/python3.8/site-packages/airflow/jobs/scheduler_job.py",
line 157, in _run_file_processor
| result = scheduler_job.process_file(file_path,
| File
"/home/airflow/.local/lib/python3.8/site-packages/airflow/utils/db.py", line
74, in wrapper
| return func(*args, **kwargs)
| File
"/home/airflow/.local/lib/python3.8/site-packages/airflow/jobs/scheduler_job.py",
line 1611, in process_file
| paused_dag_ids =
models.DagModel.get_paused_dag_ids(dag_ids=dagbag.dag_ids)
| File
"/home/airflow/.local/lib/python3.8/site-packages/airflow/utils/db.py", line
74, in wrapper
| return func(*args, **kwargs)
| File
"/home/airflow/.local/lib/python3.8/site-packages/airflow/models/dag.py", line
1806, in get_paused_dag_ids
| session.query(DagModel.dag_id)
| File
"/home/airflow/.local/lib/python3.8/site-packages/sqlalchemy/orm/query.py",
line 3233, in all
| return list(self)
| File
"/home/airflow/.local/lib/python3.8/site-packages/sqlalchemy/orm/query.py",
line 3389, in __iter__
| return self._execute_and_instances(context)
| File
"/home/airflow/.local/lib/python3.8/site-packages/sqlalchemy/orm/query.py",
line 3414, in _execute_and_instances
| result = conn.execute(querycontext.statement, self._params)
| File
"/home/airflow/.local/lib/python3.8/site-packages/sqlalchemy/engine/base.py",
line 982, in execute
| return meth(self, multiparams, params)
| File
"/home/airflow/.local/lib/python3.8/site-packages/sqlalchemy/sql/elements.py",
line 293, in _execute_on_connection
| return connection._execute_clauseelement(self, multiparams, params)
| File
"/home/airflow/.local/lib/python3.8/site-packages/sqlalchemy/engine/base.py",
line 1095, in _execute_clauseelement
| ret = self._execute_context(
| File
"/home/airflow/.local/lib/python3.8/site-packages/sqlalchemy/engine/base.py",
line 1249, in _execute_context
| self._handle_dbapi_exception(
| File
"/home/airflow/.local/lib/python3.8/site-packages/sqlalchemy/engine/base.py",
line 1476, in _handle_dbapi_exception
| util.raise_from_cause(sqlalchemy_exception, exc_info)
| File
"/home/airflow/.local/lib/python3.8/site-packages/sqlalchemy/util/compat.py",
line 398, in raise_from_cause
| reraise(type(exception), exception, tb=exc_tb, cause=cause)
| File
"/home/airflow/.local/lib/python3.8/site-packages/sqlalchemy/util/compat.py",
line 152, in reraise
| raise value.with_traceback(tb)
| File
"/home/airflow/.local/lib/python3.8/site-packages/sqlalchemy/engine/base.py",
line 1245, in _execute_context
| self.dialect.do_execute(
| File
"/home/airflow/.local/lib/python3.8/site-packages/sqlalchemy/engine/default.py",
line 588, in do_execute
| cursor.execute(statement, parameters)
| sqlalchemy.exc.ProgrammingError: (pyodbc.ProgrammingError) ('42000',
"[42000] [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Incorrect syntax
near '1'. (102) (SQLExecDirectW)")
| [SQL: SELECT dag.dag_id AS dag_dag_id
| FROM dag
| WHERE dag.is_paused IS 1 AND dag.dag_id IN (?)]
| [parameters: ('titanic_pivot',)]
| (Background on this error at: http://sqlalche.me/e/f405 )
| [2020-10-06 09:57:05 +0000] [187] [INFO] Handling signal: ttin
| [2020-10-06 09:57:05 +0000] [17859] [INFO] Booting worker with pid: 17859
|
/home/airflow/.local/lib/python3.8/site-packages/sqlalchemy/connectors/pyodbc.py:78:
SAWarning: No driver name specified; this is expected by PyODBC when using
DSN-less connections
| util.warn(
| [2020-10-06 09:57:06,390] {manager.py:710} WARNING - No user yet
created, use flask fab command to do it.
| Process DagFileProcessor3184-Process:
| Traceback (most recent call last):
| File
"/home/airflow/.local/lib/python3.8/site-packages/sqlalchemy/engine/base.py",
line 1245, in _execute_context
| self.dialect.do_execute(
| File
"/home/airflow/.local/lib/python3.8/site-packages/sqlalchemy/engine/default.py",
line 588, in do_execute
| cursor.execute(statement, parameters)
| pyodbc.ProgrammingError: ('42000', "[42000] [Microsoft][ODBC Driver 17
for SQL Server][SQL Server]Incorrect syntax near '1'. (102) (SQLExecDirectW)")
As far as I understand, the problem is in the incorrect request systaxis.
I set such environment variable AIRFLOW__CORE__SQL_ALCHEMY_CONN:
mssql+pyodbc://airflow:[email protected]:1433/airflow?Driver=ODBC+Driver+17+for+SQL+Server
What am I doing wrong and how can I solve this problem?
**What you expected to happen**:
<!-- What do you think went wrong? -->
**How to reproduce it**:
<!---
As minimally and precisely as possible. Keep in mind we do not have access
to your cluster or dags.
If you are using kubernetes, please attempt to recreate the issue using
minikube or kind.
## Install minikube/kind
- Minikube https://minikube.sigs.k8s.io/docs/start/
- Kind https://kind.sigs.k8s.io/docs/user/quick-start/
If this is a UI bug, please provide a screenshot of the bug or a link to a
youtube video of the bug in action
You can include images using the .md style of

To record a screencast, mac users can use QuickTime and then create an
unlisted youtube video with the resulting .mov file.
--->
**Anything else we need to know**:
<!--
How often does this problem occur? Once? Every time etc?
Any relevant logs to include? Put them here in side a detail tag:
<details><summary>x.log</summary> lots of stuff </details>
-->
----------------------------------------------------------------
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]