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/18 08:31:30 UTC

[GitHub] [airflow] potiuk edited a comment on pull request #19597: Fix `airflow db check-migrations`

potiuk edited a comment on pull request #19597:
URL: https://github.com/apache/airflow/pull/19597#issuecomment-972641054


   I think one of the problem with CI we have that we are "accepting" such errors rather than fixing them. That leads to "broken window" policy  - once tests are broken we ignore it and miss real problems.
   
   For the future, whenever we see such failures logs of the kind/test containers are uploaded as artifacts of such failed build - they are visible at "summary" page when you scroll the page the bottom)
   
   The problem seems to be still with the new alembic EnvironmentContext:
   
   https://github.com/apache/airflow/actions/runs/1473732053 (see CeleryExecutor logs / webserver):
   
   ````
   ation.py:201} INFO - Context impl PostgresqlImpl.
   2021-11-17T20:46:29.932473057Z stdout F [2021-11-17 20:46:29,932] {migration.py:204} INFO - Will assume transactional DDL.
   2021-11-17T20:46:29.945091208Z stderr F Traceback (most recent call last):
   2021-11-17T20:46:29.945109248Z stderr F   File "<string>", line 5, in get_bind
   2021-11-17T20:46:29.94532407Z stderr F NameError: name '_proxy' is not defined
   2021-11-17T20:46:29.94533169Z stderr F 
   2021-11-17T20:46:29.94533516Z stderr F The above exception was the direct cause of the following exception:
   2021-11-17T20:46:29.94533839Z stderr F 
   2021-11-17T20:46:29.94534107Z stderr F Traceback (most recent call last):
   2021-11-17T20:46:29.94534375Z stderr F   File "<string>", line 25, in <module>
   2021-11-17T20:46:29.945673083Z stderr F   File "/home/airflow/.local/lib/python3.9/site-packages/alembic/script/base.py", line 391, in get_heads
   2021-11-17T20:46:29.945833315Z stderr F     return list(self.revision_map.heads)
   2021-11-17T20:46:29.945841105Z stderr F   File "/home/airflow/.local/lib/python3.9/site-packages/sqlalchemy/util/langhelpers.py", line 893, in __get__
   2021-11-17T20:46:29.946260398Z stderr F     obj.__dict__[self.__name__] = result = self.fget(obj)
   2021-11-17T20:46:29.946266478Z stderr F   File "/home/airflow/.local/lib/python3.9/site-packages/alembic/script/revision.py", line 135, in heads
   2021-11-17T20:46:29.94640733Z stderr F     self._revision_map
   2021-11-17T20:46:29.94641463Z stderr F   File "/home/airflow/.local/lib/python3.9/site-packages/sqlalchemy/util/langhelpers.py", line 893, in __get__
   2021-11-17T20:46:29.946818553Z stderr F     obj.__dict__[self.__name__] = result = self.fget(obj)
   2021-11-17T20:46:29.946823733Z stderr F   File "/home/airflow/.local/lib/python3.9/site-packages/alembic/script/revision.py", line 189, in _revision_map
   2021-11-17T20:46:29.946974695Z stderr F     for revision in self._generator():
   2021-11-17T20:46:29.946981495Z stderr F   File "/home/airflow/.local/lib/python3.9/site-packages/alembic/script/base.py", line 136, in _load_revisions
   2021-11-17T20:46:29.947114956Z stderr F     script = Script._from_filename(self, vers, file_)
   2021-11-17T20:46:29.947121396Z stderr F   File "/home/airflow/.local/lib/python3.9/site-packages/alembic/script/base.py", line 999, in _from_filename
   2021-11-17T20:46:29.947665881Z stderr F     module = util.load_python_file(dir_, filename)
   2021-11-17T20:46:29.947672701Z stderr F   File "/home/airflow/.local/lib/python3.9/site-packages/alembic/util/pyfiles.py", line 92, in load_python_file
   2021-11-17T20:46:29.947803542Z stderr F     module = load_module_py(module_id, path)
   2021-11-17T20:46:29.947808422Z stderr F   File "/home/airflow/.local/lib/python3.9/site-packages/alembic/util/pyfiles.py", line 108, in load_module_py
   2021-11-17T20:46:29.947988114Z stderr F     spec.loader.exec_module(module)  # type: ignore
   2021-11-17T20:46:29.947998674Z stderr F   File "<frozen importlib._bootstrap_external>", line 850, in exec_module
   2021-11-17T20:46:29.948138375Z stderr F   File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
   2021-11-17T20:46:29.948301086Z stderr F   File "/home/airflow/.local/lib/python3.9/site-packages/airflow/migrations/versions/f2ca10b85618_add_dag_stats_table.py", line 29, in <module>
   2021-11-17T20:46:29.948429508Z stderr F     from airflow.migrations.db_types import StringID
   2021-11-17T20:46:29.948436538Z stderr F   File "/home/airflow/.local/lib/python3.9/site-packages/airflow/migrations/db_types.py", line 72, in __getattr__
   2021-11-17T20:46:29.948610759Z stderr F     dialect = context.get_bind().dialect.name
   2021-11-17T20:46:29.948619249Z stderr F   File "<string>", line 7, in get_bind
   2021-11-17T20:46:29.94867927Z stderr F   File "/home/airflow/.local/lib/python3.9/site-packages/alembic/util/langhelpers.py", line 96, in _name_error
   2021-11-17T20:46:29.948850441Z stderr F     raise NameError(
   2021-11-17T20:46:29.948856321Z stderr F NameError: Can't invoke function 'get_bind', as the proxy object has not yet been established for the Alembic 'EnvironmentContext' class.  Try placing this code inside a callable.
   ```
   


-- 
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