Unable to init/reset db with Airflow 2.1 with docker-compose #16325
Replies: 2 comments 7 replies
-
You probably call directly the If you intend to run the script manually you should run this method in the
|
Beta Was this translation helpful? Give feedback.
-
Thank you very much for your answer @potiuk. This has solved this problem (and created another). However... In any DAG is called the function directly, only in Python scripts, so I tried first with
Which didn't have any effect. I am wondering if it is something wrong in the code/file or just it is a wrong approach. Then, in all my dags I have this: Furthermore, this line is also in my utilities files and I have had to include a I am surprised that I haven't seen any mention of this in any upgrade document. The scheduler behavior has changed a lot and I have spent a lot of time trying to solve scheduler-parsing-related errors. Maybe it is very uncommon to import variables in DAG files or even execute python scripts from files, I don't know. Anyway, if this is what it is, and it's not some weird error related to some part of my code/deployment, I'd be happy to open a PR adding documentation. So as I said, this solves the initial error. Now it seems that it executes the command correctly:
Nevertheless, when I enter in the scheduler container logs I get:
I have tried also with db init and db upgrade with no luck. So eventually I am still not able to run airflow 2 =( |
Beta Was this translation helpful? Give feedback.
-
I have been trying to migrate to Airflow 2 for a long time with several versions and I haven't been able to do so. Now, with 2.1 I can't init nor reset the db. This is the log of the init command:
And this is for the
reset db
:I have a function with those arguments in the
utilities
subfolder withindags
folder. The code of the function is the following:The entire folder utilities is in the file
.airflowignore
. I call this function from python scripts (called from bash operators) that are in dags subfolders. So my directory looks like:My docker files seem very much the same the ones in the official example of the docs, and work perfectly for 1.10.15. My Dockerfile is:
The docker-compose is:
I have tried in my Mac and in a fresh Ubuntu EC2 and in both cases, I get the same error. Is there any way I could solve this or is it some kind of bug?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions