Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always bring breeze down before using --use-version #35916

Merged
merged 1 commit into from
Nov 28, 2023

Conversation

potiuk
Copy link
Member

@potiuk potiuk commented Nov 28, 2023

When you are starting old version of airflow using the command breeze start-airflow --use-version you might already have a new version of the database runnign - that is both Postgres DB running in the background and Postgres DB volume when the database files are stored.

Since older version of Airflow does not know this new version, it will fail attempts to migrate to the current version with Can't locate revision identified by 'xxxx' error.

This PR automatically adds docker-compose down command including removing volumes and orphan containers whenver you pass the --use-airflow-version flag in order to avoid this problem.

This makes --use-airflow-version slower but in many cases will avoid an error followed by manual running of --use-airflow-version and confusion it creates by printing the cryptic error.


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

When you are starting old version of airflow using the command
`breeze start-airflow --use-version` you might already have a new
version of the database runnign - that is both Postgres DB running
in the background and Postgres DB volume when the database files
are stored.

Since older version of Airflow does not know this new version, it
will fail attempts to migrate to the current version with
`Can't locate revision identified by 'xxxx'` error.

This PR automatically adds `docker-compose down` command including
removing volumes and orphan containers whenver you pass the
`--use-airflow-version` flag in order to avoid this problem.

This makes `--use-airflow-version` slower but in many cases will
avoid an error followed by manual running of `--use-airflow-version`
and confusion it creates by printing the cryptic error.
@potiuk potiuk force-pushed the breeze-down-before-use-version branch from a2cdcfb to 4038790 Compare November 28, 2023 13:05
@potiuk potiuk merged commit 2375e0d into apache:main Nov 28, 2023
10 checks passed
@potiuk potiuk deleted the breeze-down-before-use-version branch November 28, 2023 13:06
potiuk added a commit that referenced this pull request Dec 15, 2023
When you are starting old version of airflow using the command
`breeze start-airflow --use-version` you might already have a new
version of the database runnign - that is both Postgres DB running
in the background and Postgres DB volume when the database files
are stored.

Since older version of Airflow does not know this new version, it
will fail attempts to migrate to the current version with
`Can't locate revision identified by 'xxxx'` error.

This PR automatically adds `docker-compose down` command including
removing volumes and orphan containers whenver you pass the
`--use-airflow-version` flag in order to avoid this problem.

This makes `--use-airflow-version` slower but in many cases will
avoid an error followed by manual running of `--use-airflow-version`
and confusion it creates by printing the cryptic error.

(cherry picked from commit 2375e0d)
@ephraimbuddy ephraimbuddy added the changelog:skip Changes that should be skipped from the changelog (CI, tests, etc..) label Dec 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:dev-tools changelog:skip Changes that should be skipped from the changelog (CI, tests, etc..)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants