Tuesday, September 18, 2018

[google-cloud-sql-discuss] (gcloud.sql.users.delete) INTERNAL_ERROR deleting postgres user

I have been terraforming the dev environment, and I have been seeing an intermittent but rather persistent (8 times out of 10 or so) error when deleting databse users - Once I get in that state, there is no way back to normal.

The setup is rather simple, it is a postgres database. We have the default postgres user, and another user we create, called "proxyuser", that we use from the sidecar to connect to the DB. 
Right now, it is an empty database I terraformed a couple of hours ago. 
It has:
* One database: postgres
* Two users: postgres and proxyuser

I am trying to delete proxyuser. There are no open connections because the container cluster has been deleted. If I try to delete the user:

$ gcloud sql users delete proxyuser --instance  dev-instance-XXX --host <host>
proxyuser@35.234.129.60 will be deleted. New connections can no longer
 be made using this user. Existing connections are not affected.

Do you want to continue (Y/n)?  y

Deleting Cloud SQL user...failed.
ERROR: (gcloud.sql.users.delete) INTERNAL_ERROR
                  
I have tried restarting the database, hoping to kill any zombie open connections (is there such a thing?) there may be.

I have tried doing it from the cloud UI, with the same results (same unknown error). Does anyone have any idea of what it may be going on?

I know that if I want to delete the database anyway, a workaround would be to delete the database straightaway, but sadly, that is the order terraform will try to do thing. And it should be a valid use case, right? Deleting a database user without deleting the whole database should be possible (there still will be the postgres user anyway... So it should be doable).

Thanks a bunch!

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/943d6188-7521-47cb-914e-2c22576025ec%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment