CloudSQL create replica slave problem (external replication)

463 views
Skip to first unread message

Lisei Andrei

unread,
Nov 29, 2016, 9:05:25 AM11/29/16
to Google Cloud SQL discuss

I'm following this guide here for creating a cloudsql slave for an external mysql database.

I've managed to create an internal master but when i try to create the replica I have this error: 
I'm the project owner of the GCP project. 

{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "notAuthorized",
    "message": "The client is not authorized to make this request."
   }
  ],
  "code": 403,
  "message": "The client is not authorized to make this request."
 }
}

Thanks! 

Nicholas (Google Cloud Support)

unread,
Nov 29, 2016, 12:42:30 PM11/29/16
to Google Cloud SQL discuss
Hey Lisei,

Welcome.  From what I understand, you have an existing MySQL server that you wish to use as the base for replication as Cloud SQL instances.  From your description, I understand that you receive the 403 when attempting to create the replica (step 2 in Creating the external master configuration).  The 403 suggests an authorization issue.  My questions are as follows:
  • Could you successfully create the internal master instance (step 1 in the same guide)?  I ask this because that step should require the same authorization and could in fact be accomplished with the same access token if properly authorized.  It would therefore be quite strange if step 1 succeeded while step 2 failed.
  • Did you use the proper replication user/pass credentials in the request when creating a replica?
  • Do you have proper privileges for the provided Cloud Storage bucket for the dump file?
  • Is the Cloud SQL instance one of the first generation and of the same MySQL version as the existing external MySQL instance?  I doubt this would return a 403 but would not want to disregard the possibility.
Nicholas

Lisei Andrei

unread,
Nov 29, 2016, 3:13:07 PM11/29/16
to Google Cloud SQL discuss

Hey Nicholas, 

Yes, I have an external MySQL server and I'm trying to make a replication slave in a CloudSQL instance. 

  • Yes, I created the internal master (step 1 from documentation) without problems. I've exported my authorization token and I'm sure it's working because I've created and deleted a bunch of SQL instances to test this trough cloud sql API. The 403 shows up for the second step. 
  • Yes, credentials are correct for external master.
  • I used the same bucket for importing mysqldump files from web interface and was ok.
  • The Cloud SQL instance isn't created with API when I'm executing the steps from tutorial ? I'm assuming that will go default with first generation right ? 
  • Both MySQL are version 5.6 

Thank you! 

Nicholas (Google Cloud Support)

unread,
Dec 2, 2016, 2:40:14 PM12/2/16
to Google Cloud SQL discuss
I am working on trying to reproduce this error but no luck yet.  I still have a few things to try.  I'll get back to you early next week.


On Tuesday, November 29, 2016 at 9:05:25 AM UTC-5, Lisei Andrei wrote:

Nicholas (Google Cloud Support)

unread,
Dec 15, 2016, 3:56:00 PM12/15/16
to Google Cloud SQL discuss
Apologies for the lengthy radio silence.  I could not reproduce this issue on my end.  I got a 200 every time I tried, including when trying with some deliberate typos in the request body values.

Have you tried creating the replica from the API explorer for Instances: insert?  You can supply the JSON request body the way it's provided in the curl example and authenticate through the web OAuth flow.  If you're authorized, it should return a 200 OK with a operation resource.  You can inspect the progress of the operation providing its name to the Operations: get API.  This should show the errors encountered in replica creation or success.

Martin Sarsale

unread,
Jan 12, 2017, 9:49:33 AM1/12/17
to Google Cloud SQL discuss
Nicholas, I'm experiencing the same, I tried by using the API explorer and received the same answer.
Any other information you might be interested in?


cache-control:  private, max-age=0
content-encoding:  gzip
content-length:  153
content-type:  application/json; charset=UTF-8
date:  Thu, 12 Jan 2017 14:31:33 GMT
expires:  Thu, 12 Jan 2017 14:31:33 GMT
server:  GSE
vary:  Origin, X-Origin
Reply all
Reply to author
Forward
0 new messages