Hi, I’m running airflow 1.10.6 (upgrading to 2.0 soon) and here’s the output of astro version
:
$ astro version
Astro CLI Version: 0.23.1, Git Commit: e3c74b0ea3c43cf2eb2b744d91b02c08a91e909e
Astro Server Version: Please authenticate to a cluster to see server version
I recently got an M1 macbook and experiencing degraded performance when I try to run DAGs inside the container. Sometimes they work, but other times they hang at the Found credentials in environment variables.
stage. Other times it looks like airflow loses the connection to postgres like below.
Has anyone had success with this? Will upgrading to Airflow 2.0 help?
root@7359b6033dd6:/usr/local/airflow# airflow test netsuite_backfill_dag_v9 create_voucher_journal_entries 2021-01-01
[2021-05-17 19:09:38,092] {settings.py:252} INFO - settings.configure_orm(): Using pool settings. pool_size=5, max_overflow=10, pool_recycle=1800, pid=521
/usr/local/lib/python3.7/site-packages/psycopg2/__init__.py:144: UserWarning: The psycopg2 wheel package will be renamed from release 2.8; in order to keep installing from binary please use "pip install psycopg2-binary" instead. For details see: <http://initd.org/psycopg/docs/install.html#binary-install-from-pypi>.
""")
[2021-05-17 19:09:42,664] {credentials.py:1059} INFO - Found credentials in environment variables.
[2021-05-17 19:09:51,072] {__init__.py:51} INFO - Using executor LocalExecutor
[2021-05-17 19:09:51,074] {dagbag.py:402} INFO - Filling up the DagBag from /usr/local/airflow/dags
/usr/local/lib/python3.7/site-packages/fuzzywuzzy/fuzz.py:11: UserWarning: Using slow pure-python SequenceMatcher. Install python-Levenshtein to remove this warning
warnings.warn('Using slow pure-python SequenceMatcher. Install python-Levenshtein to remove this warning')
[2021-05-17 19:10:01,966] {taskinstance.py:630} INFO - Dependencies all met for <TaskInstance: netsuite_backfill_dag_v9.create_voucher_journal_entries 2021-01-01T00:00:00+00:00 [None]>
[2021-05-17 19:10:02,030] {taskinstance.py:630} INFO - Dependencies all met for <TaskInstance: netsuite_backfill_dag_v9.create_voucher_journal_entries 2021-01-01T00:00:00+00:00 [None]>
[2021-05-17 19:10:02,031] {taskinstance.py:841} INFO -
--------------------------------------------------------------------------------
[2021-05-17 19:10:02,031] {taskinstance.py:842} INFO - Starting attempt 1 of 6
[2021-05-17 19:10:02,032] {taskinstance.py:843} INFO -
--------------------------------------------------------------------------------
[2021-05-17 19:10:02,034] {taskinstance.py:862} INFO - Executing <Task(SnowflakeToNetsuiteOperator): create_voucher_journal_entries> on 2021-01-01T00:00:00+00:00
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1249, in _execute_context
cursor, statement, parameters, context
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 580, in do_execute
cursor.execute(statement, parameters)
psycopg2.OperationalError: server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/bin/airflow", line 37, in <module>
args.func(args)
File "/usr/local/lib/python3.7/site-packages/airflow/utils/cli.py", line 74, in wrapper
return f(*args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/airflow/bin/cli.py", line 688, in test
ti.run(ignore_task_deps=True, ignore_ti_state=True, test_mode=True)
File "/usr/local/lib/python3.7/site-packages/airflow/utils/db.py", line 74, in wrapper
return func(*args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/airflow/models/taskinstance.py", line 1020, in run
session=session)
File "/usr/local/lib/python3.7/site-packages/airflow/utils/db.py", line 70, in wrapper
return func(*args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/airflow/models/taskinstance.py", line 890, in _run_raw_task
self.refresh_from_db(session=session)
File "/usr/local/lib/python3.7/site-packages/airflow/utils/db.py", line 70, in wrapper
return func(*args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/airflow/models/taskinstance.py", line 461, in refresh_from_db
ti = qry.first()
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3240, in first
ret = list(self[0:1])
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3018, in __getitem__
return list(res)
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3342, in __iter__
return self._execute_and_instances(context)
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3367, in _execute_and_instances
result = conn.execute(querycontext.statement, self._params)
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 988, in execute
return meth(self, multiparams, params)
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/sql/elements.py", line 287, in _execute_on_connection
return connection._execute_clauseelement(self, multiparams, params)
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1107, in _execute_clauseelement
distilled_params,
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1253, in _execute_context
e, statement, parameters, cursor, context
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1473, in _handle_dbapi_exception
util.raise_from_cause(sqlalchemy_exception, exc_info)
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 398, in raise_from_cause
reraise(type(exception), exception, tb=exc_tb, cause=cause)
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 152, in reraise
raise value.with_traceback(tb)
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1249, in _execute_context
cursor, statement, parameters, context
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 580, in do_execute
cursor.execute(statement, parameters)
sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
[SQL: SELECT task_instance.try_number AS task_instance_try_number, task_instance.task_id AS task_instance_task_id, task_instance.dag_id AS task_instance_dag_id, task_instance.execution_date AS task_instance_execution_date, task_instance.start_date AS task_instance_start_date, task_instance.end_date AS task_instance_end_date, task_instance.duration AS task_instance_duration, task_instance.state AS task_instance_state, task_instance.max_tries AS task_instance_max_tries, task_instance.hostname AS task_instance_hostname, task_instance.unixname AS task_instance_unixname, task_instance.job_id AS task_instance_job_id, task_instance.pool AS task_instance_pool, task_instance.queue AS task_instance_queue, task_instance.priority_weight AS task_instance_priority_weight, task_instance.operator AS task_instance_operator, task_instance.queued_dttm AS task_instance_queued_dttm, task_instance.pid AS task_instance_pid, task_instance.executor_config AS task_instance_executor_config
FROM task_instance
WHERE task_instance.dag_id = %(dag_id_1)s AND task_instance.task_id = %(task_id_1)s AND task_instance.execution_date = %(execution_date_1)s
LIMIT %(param_1)s]
[parameters: {'dag_id_1': 'netsuite_backfill_dag_v9', 'task_id_1': 'create_voucher_journal_entries', 'execution_date_1': <Pendulum [2021-01-01T00:00:00+00:00]>, 'param_1': 1}]
(Background on this error at: http://sqlalche.me/e/e3q8)