Tuesday, April 24, 2018

[google-cloud-sql-discuss] SQL import error (Cloud SQL exported instance)

I have a working project with a Cloud SQL database that I want to import into a new project, an exact clone of the working one. 

I exported the SQL instance to a bucket in the working project. I then transfered that SQL dump over to a bucket in the new project. 

From there, I tried importing the SQL dump, but I get an unknown error, so I went moved to the CLI. 

Here are the commands I ran following the docs https://cloud.google.com/sql/docs/postgres/import-export/importing ...

gcloud sql instances describe  myapp-wp-db-app-v2

// serviceAccountEmailAddress in the output (a fake version of it)
5vfxzdlh6h7u43tc5onthaevia@sparkle-boots-27.iam.gserviceaccount.com

// gsutil acl ch -u [SERVICE_ACCOUNT_ADDRESS]:W gs://[BUCKET_NAME]
gsutil acl ch -u 5vfxzdlh6h7u43tc5onthaevia@sparkle-boots-27.iam.gserviceaccount.com:W gs://import-myapp-wp-app-v2

// gsutil acl ch -u [SERVICE_ACCOUNT_ADDRESS]:R gs://[BUCKET_NAME]/[IMPORT_FILE_NAME]
gsutil acl ch -u 5vfxzdlh6h7u43tc5onthaevia@sparkle-boots-27.iam.gserviceaccount.com:R gs://import-myapp-wp-app-v2/Cloud_SQL_Export_2018-04-24 (20:48:52)/

// gcloud sql import sql [INSTANCE_NAME] gs://[BUCKET_NAME]/[IMPORT_FILE_NAME] \
//                            --database=[DATABASE_NAME]

gcloud sql import sql myapp-wp-db-app-v2 gs://import-myapp-wp-app-v2/Cloud_SQL_Export_2018-04-24 (20:48:52)/ \
                            --database=wordpress_db


The last command, in the CLI, give me...
Importing data into Cloud SQL instance...failed.
ERROR: (gcloud.sql.import.sql) ERROR_RDBMS
And "gs://import-myapp-wp-app-v2/Cloud_SQL_Export_2018-04-24 (20:48:52)/: Not found (bad bucket name?)" in the Cloud SQL operations log. 

The same command without the trailing slash after the file name give me
Importing data into Cloud SQL instance...failed.
ERROR: (gcloud.sql.import.sql) INTERNAL_ERROR
And "An unknown error occurred." in the Cloud SQL operations log. 

The docs says that an "ERROR_RDBMS" is likely a permissions problem, but it does not elaborate. I thought that since I had exported from Cloud SQL the SQL dump would be fine for importing into Cloud SQL. 

Any direction would be appreciated. 

Cheers.



--
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/81f00ac9-ffa7-43ce-9aa3-3df4e069f7c5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment