Importing an export of an sql instance fails via command line, succeeds via cloud console

513 views
Skip to first unread message

bj...@otainsight.com

unread,
Jan 28, 2016, 4:08:55 AM1/28/16
to Google Cloud SQL discuss
When I try to import an export of an sql instance via the command line, I get the following output:
Importing Cloud SQL instance...failed,
ERROR: (gcloud.sql.instances.import) UNKNOWN

The command I use is: 

> gcloud sql instances import <target instance> gs://<mybucket>/<file.gz>


However, when I import the file to the target instance using the cloud console, I don't get any errors.


David Newgas

unread,
Jan 28, 2016, 12:50:13 PM1/28/16
to Google Cloud SQL discuss
Hi,

I suspect this is a issue with a Second Generation instances not having permissions to access the data in GCS. If acceptable security-wise, could you see if you can import from a publicly accessible object?

Also please note that if you need to load the data urgently you will be able to do so (but slower and at higher cost) by downloading the file to your workstation and loading it with a remote MySQL connection.

David

--
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-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/8cd8147b-488a-4dd4-96e6-f05ebeaa3ec1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

David Newgas

unread,
Jan 28, 2016, 12:57:21 PM1/28/16
to Google Cloud SQL discuss
In fact, could you run "gcloud sql instances describe <target instance>" and note the serviceAccountEmailAddress in the output. Try granting that email address read access to your object and then importing again (rather than making the object public). I'm going to check in with the Cloud SQL team whether this is supposed to be necessary and whether we are missing it from our docs.

bj...@otainsight.com

unread,
Jan 28, 2016, 2:42:46 PM1/28/16
to Google Cloud SQL discuss
The EmailAddress from the output already had read permissions for the bucket.
Thanks for your help.


On Thursday, 28 January 2016 18:57:21 UTC+1, David Newgas wrote:
In fact, could you run "gcloud sql instances describe <target instance>" and note the serviceAccountEmailAddress in the output. Try granting that email address read access to your object and then importing again (rather than making the object public). I'm going to check in with the Cloud SQL team whether this is supposed to be necessary and whether we are missing it from our docs.
On Thu, Jan 28, 2016 at 9:50 AM, David Newgas <dne...@google.com> wrote:
Hi,

I suspect this is a issue with a Second Generation instances not having permissions to access the data in GCS. If acceptable security-wise, could you see if you can import from a publicly accessible object?

Also please note that if you need to load the data urgently you will be able to do so (but slower and at higher cost) by downloading the file to your workstation and loading it with a remote MySQL connection.

David
On Thu, Jan 28, 2016 at 1:08 AM, <bj...@otainsight.com> wrote:
When I try to import an export of an sql instance via the command line, I get the following output:
Importing Cloud SQL instance...failed,
ERROR: (gcloud.sql.instances.import) UNKNOWN

The command I use is: 

> gcloud sql instances import <target instance> gs://<mybucket>/<file.gz>


However, when I import the file to the target instance using the cloud console, I don't get any errors.


--
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+unsub...@googlegroups.com.

David Newgas

unread,
Jan 28, 2016, 3:42:33 PM1/28/16
to Google Cloud SQL discuss
The service account has read permission on the bucket but not on the object. Bucket read allows you to list objects but you need object read to access their contents. Try running 'gsutil acl -u <service-acct>:r <object>'. If you set the default object acl then new objects will have the permission automatically.

David



On Thu, Jan 28, 2016 at 11:42 AM, <bj...@otainsight.com> wrote:
The EmailAddress from the output already had read permissions for the bucket.
Thanks for your help.

On Thursday, 28 January 2016 18:57:21 UTC+1, David Newgas wrote:
In fact, could you run "gcloud sql instances describe <target instance>" and note the serviceAccountEmailAddress in the output. Try granting that email address read access to your object and then importing again (rather than making the object public). I'm going to check in with the Cloud SQL team whether this is supposed to be necessary and whether we are missing it from our docs.
On Thu, Jan 28, 2016 at 9:50 AM, David Newgas <dne...@google.com> wrote:
Hi,

I suspect this is a issue with a Second Generation instances not having permissions to access the data in GCS. If acceptable security-wise, could you see if you can import from a publicly accessible object?

Also please note that if you need to load the data urgently you will be able to do so (but slower and at higher cost) by downloading the file to your workstation and loading it with a remote MySQL connection.

David
On Thu, Jan 28, 2016 at 1:08 AM, <bj...@otainsight.com> wrote:
When I try to import an export of an sql instance via the command line, I get the following output:
Importing Cloud SQL instance...failed,
ERROR: (gcloud.sql.instances.import) UNKNOWN

The command I use is: 

> gcloud sql instances import <target instance> gs://<mybucket>/<file.gz>


However, when I import the file to the target instance using the cloud console, I don't get any errors.


--
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-d...@googlegroups.com.

--
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-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/2a082ced-7169-40ea-9775-9c9247df3ffa%40googlegroups.com.

bj...@otainsight.com

unread,
Jan 28, 2016, 5:11:07 PM1/28/16
to Google Cloud SQL discuss
That did the trick indeed, thank you!


On Thursday, 28 January 2016 21:42:33 UTC+1, David Newgas wrote:
The service account has read permission on the bucket but not on the object. Bucket read allows you to list objects but you need object read to access their contents. Try running 'gsutil acl -u <service-acct>:r <object>'. If you set the default object acl then new objects will have the permission automatically.

David


On Thu, Jan 28, 2016 at 11:42 AM, <bj...@otainsight.com> wrote:
The EmailAddress from the output already had read permissions for the bucket.
Thanks for your help.

On Thursday, 28 January 2016 18:57:21 UTC+1, David Newgas wrote:
In fact, could you run "gcloud sql instances describe <target instance>" and note the serviceAccountEmailAddress in the output. Try granting that email address read access to your object and then importing again (rather than making the object public). I'm going to check in with the Cloud SQL team whether this is supposed to be necessary and whether we are missing it from our docs.
On Thu, Jan 28, 2016 at 9:50 AM, David Newgas <dne...@google.com> wrote:
Hi,

I suspect this is a issue with a Second Generation instances not having permissions to access the data in GCS. If acceptable security-wise, could you see if you can import from a publicly accessible object?

Also please note that if you need to load the data urgently you will be able to do so (but slower and at higher cost) by downloading the file to your workstation and loading it with a remote MySQL connection.

David
On Thu, Jan 28, 2016 at 1:08 AM, <bj...@otainsight.com> wrote:
When I try to import an export of an sql instance via the command line, I get the following output:
Importing Cloud SQL instance...failed,
ERROR: (gcloud.sql.instances.import) UNKNOWN

The command I use is: 

> gcloud sql instances import <target instance> gs://<mybucket>/<file.gz>


However, when I import the file to the target instance using the cloud console, I don't get any errors.


--
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+unsub...@googlegroups.com.

--
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+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages