When maintain-dbusers attempts to make new accounts for folks who have had accounts created in the past on labsdb1005, it doesn't handle it and fails, blocking account creation for new tools and users. We thought this would go away when 1001 and 1003 where decommissioned, but it looks like this problem persists in labsdb1005.
Description
Details
Related Objects
Event Timeline
Is the fix as simple as adding DROP USER IF EXISTS {username}; to the start of ACCOUNT_CREATION_SQL['legacy']?
Change 418709 had a related patch set uploaded (by BryanDavis; owner: Bryan Davis):
[operations/puppet@production] toolsdb: Remove stale accounts if present in maintain-dbusers
Change 418709 merged by Bstorm:
[operations/puppet@production] toolsdb: Remove stale accounts if present in maintain-dbusers
Turns out that the MariaDB this is needed on is too old. IF EXISTS only works starting from 10.1.3.
Change 419630 had a related patch set uploaded (by Bstorm; owner: Bstorm):
[operations/puppet@production] toolsdb: Remove stale accounts if present in maintain-dbusers
That catches the exception thrown in this case (rather specifically), drops the user and then adds them as usual.
Change 419630 merged by Bstorm:
[operations/puppet@production] toolsdb: Remove stale accounts if present in maintain-dbusers
Change 420114 had a related patch set uploaded (by Bstorm; owner: Bstorm):
[operations/puppet@production] toolsdb: include failsafe against removing admin accounts
Change 420114 merged by Bstorm:
[operations/puppet@production] toolsdb: include failsafe against removing admin accounts
At this point, this should all work fine. We'll have to wait for this edge case to occur before a true test happens. I think its safe to close this for now, though.