I have an SQL cloud instance and a compute Engine with a Centos 7 VM on different projects. I use Utilizzo l'SQL proxy cloud_sql_proxy to connect to the SQL instance with mysql CLI client and via php-mysql (wordpress). accesses are configured properly, VM's service account has a role of SQL administrator on the SQL instance. everything works fine for 30-40 minutes, I can run mysql CLI commands, wordpress works fine.
then suddenly I get on the proxy console:
2017/03/01 23:17:44 couldn't connect to "database-xxxx:europe-west1:xxxx": ensure that the account has access to "database-xxxx:europe-west1:xxxx" (and make sure there's no typo in that name). Error during createEphemeral for database-xxxx:europe-west1:xxxx: googleapi: Error 403: The client is not authorized to make this request., notAuthorized
and the mysql connection is lost. I tried the proxy authenticated as service account (VM has SQL apis enabled) AND with a service account created on purpose to run the proxy authenticated with the -credential-file option and the private JSON generated for that service account. works for a while, sometimes 10 minutes, sometimes an hour, maybe more, and then suddenly I get "notAuthorized" errors.
closing and restarting the proxy doesn't help, closing and reopening the SQL connection doesn't help either.
This happens at differents times of the day, mornings, afternoons, evenings, nights.
Are there stability issues with this infrastructure? It seems totally unreliable.
Really reluctant to put my production server here until I don't understand what's going on.