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

Wrong condition make Database schema migration always triggered #1949

Open
3 tasks done
lamm opened this issue Sep 3, 2024 · 1 comment
Open
3 tasks done

Wrong condition make Database schema migration always triggered #1949

lamm opened this issue Sep 3, 2024 · 1 comment

Comments

@lamm
Copy link

lamm commented Sep 3, 2024

Please confirm the following

  • I agree to follow this project's code of conduct.
  • I have checked the current issues for duplicates.
  • I understand that the AWX Operator is open source software provided for free and that I might not receive a timely response.

Bug Summary

Operator always try to migrate schema even if there are no pending migration.

AWX Operator version

2.15.0

AWX version

24.2.0

Kubernetes platform

openshift

Kubernetes/Platform version

4.14.34

Modifications

yes

Steps to reproduce

Any modification that make the operator to include migrate_schema.yml

Expected results

The operator should not execute the block which execute the schema migration process if no migration is pending.

Actual results

The operator execute the schema migration even if there are no pending migrations.

Additional information

When looking at the command executed to count the number of pending migrations, i noticed that it does not filter as it should.

sh-5.1$ bash -c "awx-manage showmigrations | grep -v '[X]' | grep '[ ]'"
 (no migrations)
 (no migrations)
sh-5.1$ bash -c "awx-manage showmigrations | grep -v '[X]'"
auth
conf
contenttypes
dab_jwt_consumer
 (no migrations)
dab_resource_registry
dab_rest_filters
 (no migrations)
main
oauth2_provider
sessions
sites
social_django
sso

Lines containing (no migrations) are not filtered. That's why the schema migration process is executed.

Operator Logs

No response

@oziel88
Copy link

oziel88 commented Nov 5, 2024

Yeah seeing the same issue after upgrading from operator 2.0.0 (awx 22.0.0) to 2.19.1 (awx 24.6.1)

The upgrade worked good after I ran command:

awx-manage migrate --noinput

But now I keep getting this pod below in error state

NAME                                               READY   STATUS    RESTARTS   AGE
awx-migration-24.6.1-27hbp                         1/2     Error     0          36m

For now will just update migrate_schema.yml to filter out (no migrations)

bash-5.1$ bash -c "awx-manage showmigrations | grep -v '[X]' | grep '[ ]' | wc -l"
2
bash-5.1$ bash -c "awx-manage showmigrations | grep -v '[X]' | grep '[ ]'"
 (no migrations)
 (no migrations)
bash-5.1$ bash -c "awx-manage showmigrations | egrep -v '[X]|(no migrations)' | grep '[ ]' | wc -l"
0
bash-5.1$

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants