You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/11/24 18:10:02 UTC

[GitHub] [airflow] wesleyemery commented on issue #19784: Airflow python exception at login

wesleyemery commented on issue #19784:
URL: https://github.com/apache/airflow/issues/19784#issuecomment-978113168


   > he problem is that your "custom" image is likely based on 2.2.2 version (which is current latest) but since you have `useDefaultImageForMigration`, you are using `defaultAirflowTag` which is probably 2.1.0 as this was the default version released together with the chart. Which means that migration did not actually migrate the database as needed by A
   
   the base image was 2.1.0. I added the 2.2.2 version to the base image to match what helm is expected to see and I still get an error.
   ```
   Something bad has happened.
   Please consider letting us know by creating a bug report using GitHub.
   
   Python version: 3.7.12
   Airflow version: `2.0.2`
   Node: airflow-webserver-5f6d7b6c74-9d772
   -------------------------------------------------------------------------------
   Traceback (most recent call last):
     File "/home/airflow/.local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1277, in _execute_context
       cursor, statement, parameters, context
     File "/home/airflow/.local/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 593, in do_execute
       cursor.execute(statement, parameters)
   psycopg2.errors.UndefinedColumn: column dag.concurrency does not exist
   LINE 1: ..., dag.schedule_interval AS dag_schedule_interval, dag.concur...
                                                                ^
   
   
   The above exception was the direct cause of the following exception:
   
   Traceback (most recent call last):
     File "/home/airflow/.local/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app
       response = self.full_dispatch_request()
     File "/home/airflow/.local/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request
       rv = self.handle_user_exception(e)
     File "/home/airflow/.local/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception
       reraise(exc_type, exc_value, tb)
     File "/home/airflow/.local/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
       raise value
     File "/home/airflow/.local/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
       rv = self.dispatch_request()
     File "/home/airflow/.local/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
       return self.view_functions[rule.endpoint](**req.view_args)
     File "/home/airflow/.local/lib/python3.7/site-packages/airflow/www/auth.py", line 34, in decorated
       return func(*args, **kwargs)
     File "/home/airflow/.local/lib/python3.7/site-packages/airflow/www/views.py", line 497, in index
       filter_dag_ids = current_app.appbuilder.sm.get_accessible_dag_ids(g.user)
     File "/home/airflow/.local/lib/python3.7/site-packages/airflow/www/security.py", line 273, in get_accessible_dag_ids
       return {dag.dag_id for dag in accessible_dags}
     File "/home/airflow/.local/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3535, in __iter__
       return self._execute_and_instances(context)
     File "/home/airflow/.local/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3560, in _execute_and_instances
       result = conn.execute(querycontext.statement, self._params)
     File "/home/airflow/.local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1011, in execute
       return meth(self, multiparams, params)
     File "/home/airflow/.local/lib/python3.7/site-packages/sqlalchemy/sql/elements.py", line 298, in _execute_on_connection
       return connection._execute_clauseelement(self, multiparams, params)
     File "/home/airflow/.local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1130, in _execute_clauseelement
       distilled_params,
     File "/home/airflow/.local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1317, in _execute_context
       e, statement, parameters, cursor, context
     File "/home/airflow/.local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1511, in _handle_dbapi_exception
       sqlalchemy_exception, with_traceback=exc_info[2], from_=e
     File "/home/airflow/.local/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 182, in raise_
       raise exception
     File "/home/airflow/.local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1277, in _execute_context
       cursor, statement, parameters, context
     File "/home/airflow/.local/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 593, in do_execute
       cursor.execute(statement, parameters)
   sqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedColumn) column dag.concurrency does not exist
   LINE 1: ..., dag.schedule_interval AS dag_schedule_interval, dag.concur...
                                                                ^
   
   [SQL: SELECT dag.dag_id AS dag_dag_id, dag.root_dag_id AS dag_root_dag_id, dag.is_paused AS dag_is_paused, dag.is_subdag AS dag_is_subdag, dag.is_active AS dag_is_active, dag.last_parsed_time AS dag_last_parsed_time, dag.last_pickled AS dag_last_pickled, dag.last_expired AS dag_last_expired, dag.scheduler_lock AS dag_scheduler_lock, dag.pickle_id AS dag_pickle_id, dag.fileloc AS dag_fileloc, dag.owners AS dag_owners, dag.description AS dag_description, dag.default_view AS dag_default_view, dag.schedule_interval AS dag_schedule_interval, dag.concurrency AS dag_concurrency, dag.has_task_concurrency_limits AS dag_has_task_concurrency_limits, dag.next_dagrun AS dag_next_dagrun, dag.next_dagrun_create_after AS dag_next_dagrun_create_after 
   FROM dag]
   (Background on this error at: http://sqlalche.me/e/13/f405)
   ```
   
   When I set:
     useDefaultImageForMigration: false 
   
   I get a timeout waiting for a condition when installing the chart. I hope I'm not missing some detail due to user error. 
   
   ```
   FROM apache/airflow:2.2.2-python3.7
   
   USER root
   RUN sudo apt-get update \
     && sudo apt-get install -y g++ \
     && sudo apt-get install -y unixodbc-dev \
     && sudo apt-get install -y python3.7-dev \
     && python3.7 -m pip install --upgrade pip
   USER airflow
   COPY ./.netrc .
   RUN mv .netrc $HOME
   RUN pip install --no-cache-dir --user lola_utils --index-url https://abinbev.jfrog.io/artifactory/api/pypi/beerte-virtual-pypi/simple
   ```
   
   Here I explicitly added the version of airflow to match what's expected by default in `defaultAirflowTag`
   


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org