airflow: Task exited with return code Negsignal.SIGSEGV

Apache Airflow version

2.2.2 (latest released)

What happened

Simple task of using snowflake_connector to do a select 1 to test the snowflake connection. The python code itself runs fine, but once wrapped within an airflow task always returns Negsignal.SIGSEGV.

Airflow DAG:

@dag(dag_id="test_snowflake_connector", **dag_kwargs)
def test_snowflake_connector():
    @task
    def dummy_task():
        qry = """
            select 1
        """
        print(snowflake_connector.__dict__)
        res = snowflake_connector.execute_query(qry, SnowflakeWarehouse.xs).as_list_dict

        return True


    success = dummy_task()


dag = test_snowflake_connector()

Airflow Logs:

--------------------------------------------------------------------------------
[2021-12-14, 23:10:24 UTC] {taskinstance.py:1242} INFO - Starting attempt 1 of 1
[2021-12-14, 23:10:24 UTC] {taskinstance.py:1243} INFO - 
--------------------------------------------------------------------------------
[2021-12-14, 23:10:24 UTC] {taskinstance.py:1262} INFO - Executing <Task(_PythonDecoratedOperator): dummy_task> on 2021-12-15 04:10:20.867874+00:00
[2021-12-14, 23:10:24 UTC] {standard_task_runner.py:52} INFO - Started process 69853 to run task
[2021-12-14, 23:10:24 UTC] {standard_task_runner.py:76} INFO - Running: ['airflow', 'tasks', 'run', 'test_snowflake_connector', 'dummy_task', 'manual__2021-12-15T04:10:20.867874+00:00', '--job-id', '7', '--raw', '--subdir', 'DAGS_FOLDER/test_snowflake_connector.py', '--cfg-path', '/var/folders/xk/zf4k85m5491__d22lcdj06m80000gn/T/tmp2k7i6tcw', '--error-file', '/var/folders/xk/zf4k85m5491__d22lcdj06m80000gn/T/tmpnepzugpd']
[2021-12-14, 23:10:24 UTC] {standard_task_runner.py:77} INFO - Job 7: Subtask dummy_task
[2021-12-14, 23:10:24 UTC] {logging_mixin.py:109} INFO - Running <TaskInstance: test_snowflake_connector.dummy_task manual__2021-12-15T04:10:20.867874+00:00 [running]> on host alex.soong C02FT18GML7L
[2021-12-14, 23:10:24 UTC] {taskinstance.py:1427} INFO - Exporting the following env vars:
AIRFLOW_CTX_DAG_EMAIL=
AIRFLOW_CTX_DAG_OWNER=
AIRFLOW_CTX_DAG_ID=test_snowflake_connector
AIRFLOW_CTX_TASK_ID=dummy_task
AIRFLOW_CTX_EXECUTION_DATE=2021-12-15T04:10:20.867874+00:00
AIRFLOW_CTX_DAG_RUN_ID=manual__2021-12-15T04:10:20.867874+00:00

[2021-12-14, 23:10:24 UTC] {snowflake_connector.py:123} INFO - Creating snowflake connection
[2021-12-14, 23:10:24 UTC] {snowflake_connector.py:102} INFO - Creating snowflake engine
[2021-12-14, 23:10:25 UTC] {snowflake_connector.py:113} INFO - Created engine 
[2021-12-14, 23:10:25 UTC] {connection.py:267} INFO - Snowflake Connector for Python Version: 2.7.1, Python Version: 3.8.12, Platform: macOS-11.6.1-x86_64-i386-64bit
[2021-12-14, 23:10:25 UTC] {connection.py:878} INFO - This connection is in OCSP Fail Open Mode. TLS Certificates would be checked for validity and revocation status. Any other Certificate Revocation related exceptions or OCSP Responder failures would be disregarded in favor of connectivity.
[2021-12-14, 23:10:25 UTC] {connection.py:896} INFO - Setting use_openssl_only mode to False
[2021-12-14, 23:10:25 UTC] {local_task_job.py:154} INFO - Task exited with return code Negsignal.SIGSEGV
[2021-12-14, 23:10:25 UTC] {taskinstance.py:1270} INFO - Marking task as FAILED. dag_id=test_snowflake_connector, task_id=dummy_task, execution_date=20211215T041020, start_date=20211215T041024, end_date=20211215T041025
[2021-12-14, 23:10:26 UTC] {local_task_job.py:264} INFO - 0 downstream tasks scheduled from follow-on schedule check

snowflake-connector-python==2.7.1
snowflake-sqlalchemy==1.2.0
apache-airflow==2.2.2
apache-airflow-providers-amazon==2.5.0
apache-airflow-providers-ftp==2.0.1
apache-airflow-providers-http==2.0.1
apache-airflow-providers-imap==2.0.1
apache-airflow-providers-sqlite==2.0.1

What you expected to happen

Expected a {cursor.py:720} INFO - query execution done

How to reproduce

snowflake_connector = SnowflakeConnector(<creds>)
snowflake_connector.execute("select 1") 

Operating System

macOS Big Sur 11.6.1

Versions of Apache Airflow Providers

apache-airflow==2.2.2
apache-airflow-providers-amazon==2.5.0
apache-airflow-providers-ftp==2.0.1
apache-airflow-providers-http==2.0.1
apache-airflow-providers-imap==2.0.1
apache-airflow-providers-sqlite==2.0.1

Deployment

Virtualenv installation

Deployment details

created a conda environment and pip installed all requirements

Anything else

Problem occurs everytime i manually trigger a dag

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 15 (5 by maintainers)

Most upvoted comments

I’m not sure yet but are the people with this issue on Mac M1? I feel this is something related with network calls with M1.

Try uninstalling pyarrow and then upgrading the Snowflake connector. It just magically fixed this problem for me.

pip uninstall pyarrow
pip3 install --upgrade snowflake-connector-python