Wisani Salani
Wisani Salani

Reputation: 144

Airflow stack webserver failing to resolve postgres related attribute, fails to start

Airflow fails to start after deploying, error reports to be failing to resolve postgres attribute AttributeError: module 'sqlalchemy.dialects.postgresql' has no attribute 'MONEY'.

Dockerfile installing coupled dependencies as apache-airflow[async,postgres,celery,rabbitmq,crypto]==1.10 for the complete stack.

  File "/usr/local/bin/airflow", line 22, in <module>
    from airflow.bin.cli import CLIFactory
  File "/usr/local/lib/python3.6/site-packages/airflow/bin/cli.py", line 69, in <module>
    from airflow.www_rbac.app import cached_app as cached_app_rbac
  File "/usr/local/lib/python3.6/site-packages/airflow/www_rbac/app.py", line 24, in <module>
    from flask_appbuilder import AppBuilder, SQLA
  File "/usr/local/lib/python3.6/site-packages/flask_appbuilder/__init__.py", line 5, in <module>
    from .base import AppBuilder
  File "/usr/local/lib/python3.6/site-packages/flask_appbuilder/base.py", line 5, in <module>
    from .api.manager import OpenApiManager
  File "/usr/local/lib/python3.6/site-packages/flask_appbuilder/api/__init__.py", line 11, in <module>
    from marshmallow_sqlalchemy.fields import Related, RelatedList
  File "/usr/local/lib/python3.6/site-packages/marshmallow_sqlalchemy/__init__.py", line 1, in <module>
    from .schema import TableSchemaOpts, ModelSchemaOpts, TableSchema, ModelSchema
  File "/usr/local/lib/python3.6/site-packages/marshmallow_sqlalchemy/schema.py", line 3, in <module>
    from .convert import ModelConverter
  File "/usr/local/lib/python3.6/site-packages/marshmallow_sqlalchemy/convert.py", line 36, in <module>
    class ModelConverter:
  File "/usr/local/lib/python3.6/site-packages/marshmallow_sqlalchemy/convert.py", line 52, in ModelConverter
    postgresql.MONEY: fields.Decimal,
AttributeError: module 'sqlalchemy.dialects.postgresql' has no attribute 'MONEY'```

Upvotes: 6

Views: 1173

Answers (2)

Muhammad Qasim
Muhammad Qasim

Reputation: 107

Sometimes it also happens to have same error when you are supposed to run your python project in a virtual environment but you forgot to enable virtual environment.

Upvotes: 0

Wisani Salani
Wisani Salani

Reputation: 144

Allow airflow to select its own dependency version to the latest, apache-airflow[async,postgres,celery,rabbitmq,crypto].

Upvotes: 3

Related Questions