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

Fix error when users.table does not exist yet during initialize #22887

Merged
merged 1 commit into from
Nov 25, 2024

Conversation

KevinMind
Copy link
Contributor

@KevinMind KevinMind commented Nov 22, 2024

Fixes: mozilla/addons#15196

Follow up: #22860

Description

Add error handling to check_users in the initialize script

Context

When running initialize we check if there are any users in the user table.. however if you run this command before the database has been migrated, it will raise a mysql error.

We should handle that such that if the query errors, we assume no users and return false

Testing

make down
make docker_mysqld_volume_remove
make up

Should not error

Checklist

  • Add #ISSUENUM at the top of your PR to an existing open issue in the mozilla/addons repository.
  • Successfully verified the change locally.
  • The change is covered by automated tests, or otherwise indicated why doing so is unnecessary/impossible.
  • Add before and after screenshots (Only for changes that impact the UI).
  • Add or update relevant docs reflecting the changes made.

@KevinMind KevinMind requested review from a team and diox and removed request for a team November 22, 2024 19:31
@KevinMind KevinMind force-pushed the fix-initialize-error branch from 3d0c043 to f1f9552 Compare November 22, 2024 19:36
@KevinMind KevinMind marked this pull request as ready for review November 22, 2024 19:36
@KevinMind KevinMind merged commit fab7533 into master Nov 25, 2024
31 checks passed
@KevinMind KevinMind deleted the fix-initialize-error branch November 25, 2024 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Handle exception raised by mysql during make up
2 participants