2
votes

When trying to restore a backup to a new cloud sql instance I get the following message when using curl:

{
 "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."
 }
}

When trying via google cloud console, after clicking 'ok' in the 'restore instance from backup' menu nothing happens.

1
You should have a valid backup to be able to run the restorebackup operation. It usually takes upto 24 hours for the first automated backup to run (assuming you have enabled it). Is this first gen or second gen? Can you send your instance name to [email protected]? - user2701802

1 Answers

3
votes

I'll answer even thought this is a very old question, maybe useful for someone else (would have been for me).

I just had the same exact same error, my problem was that the storage capacity for the target instance was different than the one for the source instance. My source instance was accidentally deleted so this was a bit troublesome to figure out. This check list helped me https://cloud.google.com/sql/docs/postgres/backup-recovery/restore#tips-restore-different-instance