Tuesday, September 6, 2016

[google-cloud-sql-discuss] Re: Errors when setting root password or attempting to list users on second gen instance using gcloud

Hi, Nick. I apologize for taking a few days to reply to this. I didn't get an email notification of the response and to make matters worse I cross-posted this to SO after reading the group header a second time.

In any case: as of last night yes the issue was still occurring. I can't give you an instance because we were experimenting and it has since been deleted but I am sure I could recreate.

The current scenario is this:

1) Create a second generation SQL instance through the REST json API. This call succeeds and we then wait for the instance to become runnable.

2) We then issue an update through the sql/v1beta4/projects/our-project/instances/our-instance/users endpoint to update the password of the root user. The endpoint responds with:

{
 
"error": {
 
"errors": [
   
{
   
"domain": "global",
   
"reason": "invalidOperation",
   
"message": "This operation isn\"t valid for this instance."
   
}
 
],
 
"code": 400,
 
"message": "This operation isn\"t valid for this instance."
 
}
}


We get basically the same error message if we try any of the relevant gcloud commands, i.e. gcloud beta sql users list, or gcloud sql instances set-root-password.

On Tuesday, August 30, 2016 at 11:52:55 AM UTC-4, paynen wrote:
Hey Mark,

Thanks for getting in touch with us about this. A few questions:

Is this still occurring?

How long after creating the instance were you running these commands? 

What is the output of "gcloud beta sql instances list"?

If you could email me directly with your project ID and the name of the instance, we could also take a look directly. Usually issues like this should be reported to the Cloud SQL Public Issue Tracker, but we're happy to start work here and transfer there if something is found which will require progress updates. 

Cheers,

Nick
Cloud Platform Community Support

On Friday, August 26, 2016 at 3:51:49 PM UTC-4, Mark Betz wrote:
Hi, folks. I have a second gen. instance that has been created in our project using mysql 5.7. Nothing else has been done after using the console to create this instance. If I try to execute ...

$ gcloud sql instances set-root-password my_instance --password my_password

... I get the error "ERROR: (gcloud.sql.instances.set-root-password) The instance or operation is not in an appropriate state to handle the request."

On a perhaps related note if I try ...

$ gcloud beta sql users list --instance my_instance

... I get "ERROR: (gcloud.beta.sql.users.list) This operation isn"t valid for this instance."

Any help would be appreciated. The ability to execute these commands in script is intrinsic to our approach for managing access to database secrets in our kubernetes cluster.

Thanks very much!

--Mark

--
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/a3cbba2f-16cc-4afa-91df-985009f2b1c4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment