I'm using Aurora MySQL 5.6 with my application, in which I use EF Core (2.1) as ORM. I run the migrations from my TeamCity build server.
The migrations are executed by a user
'tc-user'@'%' that is identified by a password and has a set of permissions to change the schema, etc. The connection string is pulled from AWS SSM parameter store.
Sometimes running the migrations
dotnet ef database update fails, with an error message
An error occurred using the connection to database '' on server 'redacted.eu-west-1.rds.amazonaws.com'. MySql.Data.MySqlClient.MySqlException (0x80004005): Access denied for user 'tc-user'@'172.31.2.37' (using password: YES)
When this happens I found that there's a new user created with no password or permissions in that database -
If I delete that user - the migrations pass. But once in a while this happens again, and lately it has been happening more often. This happens on multiple clusters as well.
Sometimes, when there's more than 1 migration in the build it will execute some and then break.
Why is it creating that user?
I tried setting the same password on the new user and giving it the same permissions as the main one, but the migrations still fail. So having both users doesn't seem to be an option either.
User contributions licensed under CC BY-SA 3.0