You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Ash Berlin-Taylor (Jira)" <ji...@apache.org> on 2019/10/07 09:23:00 UTC

[jira] [Commented] (AIRFLOW-5576) relation "variable" does not exist - psycopg2 - DagBag import

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

Ash Berlin-Taylor commented on AIRFLOW-5576:
--------------------------------------------

The error logged does not stop the migration applying or functioning. The fix for this should be to capture/silence the error so that it doesn't look like it is fails. 

> relation "variable" does not exist - psycopg2 - DagBag import
> -------------------------------------------------------------
>
>                 Key: AIRFLOW-5576
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-5576
>             Project: Apache Airflow
>          Issue Type: Bug
>          Components: DAG, database
>    Affects Versions: 1.10.5
>            Reporter: Darren Weber
>            Priority: Major
>
> While loading dags during a db-reset, before creating any DAG, some code attempts to get/set a Variable, e.g.
>  
> {code:java}
> val = Variable.get(key, default_var=None)
> # or
> val = Variable.setdefault(key, default="value")
> {code}
>   
> On sqlite3 it's all fine, but not on postgres.  The traceback is like:
>  
> {code:java}
> [SQL: SELECT variable.val AS variable_val, variable.id AS variable_id, variable.key AS variable_key, variable.is_encrypted AS variable_is_encrypted 
>  FROM variable 
>  WHERE variable.key = %(key_1)s 
>  LIMIT %(param_1)s]
>  [parameters:
> {'key_1': 'dag_enabled', 'param_1': 1}
> ]
>  (Background on this error at: http://sqlalche.me/e/f405)
>  ERROR [airflow.models.dagbag.DagBag] Failed to import: /home/joe/jupiter/cis/airflow/dags/cis/fsp/dags/dag_generator.py
>  Traceback (most recent call last):
>  File "/home/joe/.cache/pypoetry/virtualenvs/dags-py3.6/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1249, in _execute_context
>  cursor, statement, parameters, context
>  File "/home/joe/.cache/pypoetry/virtualenvs/dags-py3.6/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 552, in do_execute
>  cursor.execute(statement, parameters)
>  psycopg2.ProgrammingError: relation "variable" does not exist
>  LINE 2: FROM variable
> {code}
>  
> versions:
> {code:java}
> $ pip freeze | grep airflow
> apache-airflow==1.10.5
> $ pip freeze | grep sqlalchemy
> marshmallow-sqlalchemy==0.19.0
> $ pip freeze | grep psycopg2
> psycopg2==2.7.7
> {code}
>  



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