You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "bbjrgithub (via GitHub)" <gi...@apache.org> on 2025/10/01 05:12:56 UTC
[D] "docker compose run airflow-cli airflow config list" with Python 3.13 and FAB 5 fails with "cannot import name 'SQLA' from 'flask_appbuilder'" [airflow]
GitHub user bbjrgithub created a discussion: "docker compose run airflow-cli airflow config list" with Python 3.13 and FAB 5 fails with "cannot import name 'SQLA' from 'flask_appbuilder'"
Hello Everyone,
I am trying to build a custom image for Airflow 3.1.0 on Fedora 42 with Python 3.13 and FAB 5 but I am getting ```cannot import name 'SQLA' from 'flask_appbuilder'```:
```
$ docker compose run airflow-cli airflow config list
[+] Running 24/24
✔ postgres Pulled
...
✔ redis Pulled
[+] Creating 4/4
✔ Network reddit_tcm_movies_data_pipeline_project_default Created 0.2s
✔ Volume reddit_tcm_movies_data_pipeline_project_postgres-db-volume Created 0.0s
✔ Container reddit_tcm_movies_data_pipeline_project-redis-1 Created 1.6s
✔ Container reddit_tcm_movies_data_pipeline_project-postgres-1 Created 1.6s
[+] Running 2/2
✔ Container reddit_tcm_movies_data_pipeline_project-postgres-1 Started 0.2s
✔ Container reddit_tcm_movies_data_pipeline_project-redis-1 Started 0.3s
[+] Building 91.1s (11/11) FINISHED
=> [internal] load local bake definitions 0.0s
=> => reading from stdin 751B 0.0s
=> [internal] load build definition from Dockerfile 0.1s
=> => transferring dockerfile: 341B 0.0s
=> [internal] load metadata for docker.io/apache/airflow:3.1.0-python3.13 1.1s
=> [internal] load .dockerignore 0.1s
=> => transferring context: 2B 0.0s
=> [internal] load build context 0.1s
=> => transferring context: 3.29kB 0.0s
=> [1/4] FROM docker.io/apache/airflow:3.1.0-python3.13@sha256:7cca8bfcdf8a5d2e2d4f0063c7443c9311a2d7baba691c1c6cd8c9e7aef63fab 24.8s
...
=> [2/4] COPY requirements.txt /opt/airflow/ 2.1s
=> [3/4] RUN apt-get update && apt-get install -y gcc python3-dev 28.8s
=> [4/4] RUN pip install apache-airflow==3.1.0 --no-cache-dir -r /opt/airflow/requirements.txt 30.7s
=> exporting to image 2.9s
=> => exporting layers 2.8s
=> => writing image sha256:132e5f0c79b494031afb0a70a8840366d7210a11f50511a684c49fd790d7b113 0.0s
=> => naming to docker.io/library/reddit_tcm_movies_data_pipeline_project-airflow-cli 0.0s
=> resolving provenance for metadata file 0.1s
2025-10-01T04:58:03.302568Z [warning ] cannot import name 'SQLA' from 'flask_appbuilder' (/home/airflow/.local/lib/python3.13/site-packages/flask_appbuilder/__init__.py) [airflow.configuration] loc=configuration.py:1266
2025-10-01T04:58:03.303100Z [warning ] cannot load CLI commands from auth manager: The object could not be loaded. Please check "auth_manager" key in "core" section. Current value: "airflow.providers.fab.auth_manager.fab_auth_manager.FabAuthManager". [airflow.cli.cli_parser] loc=cli_parser.py:81
2025-10-01T04:58:03.303241Z [warning ] Auth manager is not configured and api-server will not be able to start. [airflow.cli.cli_parser] loc=cli_parser.py:82
```
It looks like support for FAB 5 was added in [#50960](https://github.com/apache/airflow/pull/50960)
Attached are my [docker-compose.yaml](https://github.com/user-attachments/files/22631056/docker-compose.txt), [Dockerfile](https://github.com/user-attachments/files/22631061/Dockerfile.txt) and [requirements.txt](https://github.com/user-attachments/files/22631067/requirements.txt)
GitHub link: https://github.com/apache/airflow/discussions/56279
----
This is an automatically sent email for commits@airflow.apache.org.
To unsubscribe, please send an email to: commits-unsubscribe@airflow.apache.org
Re: [D] "docker compose run airflow-cli airflow config list" with Python 3.13 and FAB 5 fails with "cannot import name 'SQLA' from 'flask_appbuilder'" [airflow]
Posted by "potiuk (via GitHub)" <gi...@apache.org>.
GitHub user potiuk added a comment to the discussion: "docker compose run airflow-cli airflow config list" with Python 3.13 and FAB 5 fails with "cannot import name 'SQLA' from 'flask_appbuilder'"
The #50960 adds support for FAB 5 in fab provider. The fab provider (3.*) that is going to support FAB 5 is not yet released. If you look at fab apache-airflow-providers-fab==2.4.4 deps, it explicitly depends of lower version of flask appbuilder. The mere fact of merging support when no release has been done since does not make released versions of software to "work" - the software needs to be relased first.
Just watch announcement at the devlist and issue opened when we ask people to test it and when RC candidate is released (should be soon) you should test it and report back if you find any issues - this way you will be able to help us testing it. Please test and report any issues in the appropriate "status of testing" issue.
We are counting on your help and engagement there as apparently you are eager to test it.
GitHub link: https://github.com/apache/airflow/discussions/56279#discussioncomment-14559236
----
This is an automatically sent email for commits@airflow.apache.org.
To unsubscribe, please send an email to: commits-unsubscribe@airflow.apache.org
Re: [D] "docker compose run airflow-cli airflow config list" with Python 3.13 and FAB 5 fails with "cannot import name 'SQLA' from 'flask_appbuilder'" [airflow]
Posted by "bbjrgithub (via GitHub)" <gi...@apache.org>.
GitHub user bbjrgithub added a comment to the discussion: "docker compose run airflow-cli airflow config list" with Python 3.13 and FAB 5 fails with "cannot import name 'SQLA' from 'flask_appbuilder'"
@potiuk
Cool. Thank you for your help.
GitHub link: https://github.com/apache/airflow/discussions/56279#discussioncomment-14559371
----
This is an automatically sent email for commits@airflow.apache.org.
To unsubscribe, please send an email to: commits-unsubscribe@airflow.apache.org
Re: [D] "docker compose run airflow-cli airflow config list" with Python 3.13 and FAB 5 fails with "cannot import name 'SQLA' from 'flask_appbuilder'" [airflow]
Posted by "salimuddin07 (via GitHub)" <gi...@apache.org>.
GitHub user salimuddin07 added a comment to the discussion: "docker compose run airflow-cli airflow config list" with Python 3.13 and FAB 5 fails with "cannot import name 'SQLA' from 'flask_appbuilder'"
1. Downgrade Flask AppBuilder to a compatible version
The simplest and recommended solution:
Airflow 3.1.x expects FAB 4.x, so in your requirements.txt or Dockerfile:
`RUN pip install "flask-appbuilder<5.0.0"`
Or in requirements.txt:
`flask-appbuilder>=4.3,<5.0`
Then rebuild your image:
```
docker compose build airflow-cli
docker compose run airflow-cli airflow db init
```
This should remove the cannot import SQLA errors and allow the auth manager to initialize properly.
2. Consider Python version
Using Python 3.13 is cutting edge; Airflow 3.1.x is mainly tested on Python 3.10/3.11.
If you run into other dependency issues, consider using Python 3.11 in your custom image:
`FROM apache/airflow:3.1.0-python3.11`
3. Verify your auth manager config
After downgrading FAB, ensure your airflow.cfg has a proper auth manager:
```
[core]
auth_backend = airflow.providers.fab.auth_backend.fab_auth_backend
```
This tells Airflow to use FAB for authentication, which should now work correctly with FAB 4.x.
Recommended Approach
Pin FAB to 4.x
Stick with Python 3.11 (to match tested Airflow 3.1.x images)
Rebuild the Docker image
Initialize the DB: airflow db init
Start Airflow services: webserver, scheduler, etc.
After this, your Airflow CLI, webserver, and auth manager should work without the SQLA import errors.
GitHub link: https://github.com/apache/airflow/discussions/56279#discussioncomment-14560225
----
This is an automatically sent email for commits@airflow.apache.org.
To unsubscribe, please send an email to: commits-unsubscribe@airflow.apache.org