Closed GoogleCodeExporter closed 8 years ago
Thanks for reporting this; we're sorry about the delay.
We're looking into it.
Original comment by z...@google.com
on 24 Nov 2015 at 10:33
A couple of questions to help us further troubleshoot:
Do you still experience the same issue if you try again now? We may be able to
dig up logs to see what's happening on our end. Please provide the operation
names if you see this (they're in the gcloud output).
Are you by any chance applying previews between those commands?
Original comment by z...@google.com
on 25 Nov 2015 at 2:44
Hi,
I have not applied previews between the commands (not sure what you mean by
that, but I've not done anything but wait a while between the commands).
I retried it with the same version of google-cloud-sdk (0.9.82) and got the
same errors as before. Then I updated to the latest version of google-cloud-sdk
(0.9.88) and got the same behavior again.
Below is the output from my latest run of deployment-manager create/update (I
used the exact same config as attached earlier, except for changing name of
deployment and db server):
$ gcloud --project xxxx deployment-manager deployments update rn333-4 --config
config
Waiting for create
operation-1448572952203-525782c3f4ef8-d2ad7594-c74d0c70...failed.
ERROR: (gcloud.deployment-manager.deployments.create) Error in Operation
operation-1448572952203-525782c3f4ef8-d2ad7594-c74d0c70: <ErrorValue
errors: [<ErrorsValueListEntry
code: u'RESOURCE_ERROR'
location: u'rn333-4/testdb1'
message: u'Unexpected response from resource of type sqladmin.v1beta4.database: 403 {statusMessage=Forbidden, errors=[{message=The client is not authorized to make this request., domain=global, reason=notAuthorized}]}'>, <ErrorsValueListEntry
code: u'RESOURCE_ERROR'
location: u'rn333-4/testdb8'
message: u'Unexpected response from resource of type sqladmin.v1beta4.database: 403 {statusMessage=Forbidden, errors=[{message=The client is not authorized to make this request., domain=global, reason=notAuthorized}]}'>, <ErrorsValueListEntry
code: u'RESOURCE_ERROR'
location: u'rn333-4/testdb5'
message: u'Unexpected response from resource of type sqladmin.v1beta4.database: 403 {statusMessage=Forbidden, errors=[{message=The client is not authorized to make this request., domain=global, reason=notAuthorized}]}'>, <ErrorsValueListEntry
code: u'RESOURCE_ERROR'
location: u'rn333-4/testdb4'
message: u'Unexpected response from resource of type sqladmin.v1beta4.database: 403 {statusMessage=Forbidden, errors=[{message=The client is not authorized to make this request., domain=global, reason=notAuthorized}]}'>, <ErrorsValueListEntry
code: u'RESOURCE_ERROR'
location: u'rn333-4/testdb7'
message: u'Unexpected response from resource of type sqladmin.v1beta4.database: 403 {statusMessage=Forbidden, errors=[{message=The client is not authorized to make this request., domain=global, reason=notAuthorized}]}'>, <ErrorsValueListEntry
code: u'RESOURCE_ERROR'
location: u'rn333-4/testdb9'
message: u'Unexpected response from resource of type sqladmin.v1beta4.database: 403 {statusMessage=Forbidden, errors=[{message=The client is not authorized to make this request., domain=global, reason=notAuthorized}]}'>, <ErrorsValueListEntry
code: u'RESOURCE_ERROR'
location: u'rn333-4/testdb2'
message: u'Unexpected response from resource of type sqladmin.v1beta4.database: 403 {statusMessage=Forbidden, errors=[{message=The client is not authorized to make this request., domain=global, reason=notAuthorized}]}'>, <ErrorsValueListEntry
code: u'RESOURCE_ERROR'
location: u'rn333-4/testdb3'
message: u'Unexpected response from resource of type sqladmin.v1beta4.database: 403 {statusMessage=Forbidden, errors=[{message=The client is not authorized to make this request., domain=global, reason=notAuthorized}]}'>, <ErrorsValueListEntry
code: u'RESOURCE_ERROR'
location: u'rn333-4/testdb10'
message: u'Unexpected response from resource of type sqladmin.v1beta4.database: 403 {statusMessage=Forbidden, errors=[{message=The client is not authorized to make this request., domain=global, reason=notAuthorized}]}'>, <ErrorsValueListEntry
code: u'RESOURCE_ERROR'
location: u'rn333-4/testdb6'
message: u'Unexpected response from resource of type sqladmin.v1beta4.database: 403 {statusMessage=Forbidden, errors=[{message=The client is not authorized to make this request., domain=global, reason=notAuthorized}]}'>]>
$ gcloud --project xxxx deployment-manager deployments update rn333-4 --config
config
Waiting for update
operation-1448573714236-5257859ab0260-fae34a35-54686614...failed.
ERROR: (gcloud.deployment-manager.deployments.update) Error in Operation
operation-1448573714236-5257859ab0260-fae34a35-54686614: <ErrorValue
errors: [<ErrorsValueListEntry
code: u'RESOURCE_ERROR'
location: u'rn333-4/testdb4'
message: u"Unexpected response from resource of type sqladmin.v1beta4.database: ERROR_RDBMS speckle::MySQL exception: mysql_query Can't create database 'testdb4'; database exists">, <ErrorsValueListEntry
code: u'RESOURCE_ERROR'
location: u'rn333-4/testdb6'
message: u"Unexpected response from resource of type sqladmin.v1beta4.database: ERROR_RDBMS speckle::MySQL exception: mysql_query Can't create database 'testdb6'; database exists">, <ErrorsValueListEntry
code: u'RESOURCE_ERROR'
location: u'rn333-4/testdb3'
message: u"Unexpected response from resource of type sqladmin.v1beta4.database: ERROR_RDBMS speckle::MySQL exception: mysql_query Can't create database 'testdb3'; database exists">, <ErrorsValueListEntry
code: u'RESOURCE_ERROR'
location: u'rn333-4/testdb2'
message: u"Unexpected response from resource of type sqladmin.v1beta4.database: ERROR_RDBMS speckle::MySQL exception: mysql_query Can't create database 'testdb2'; database exists">, <ErrorsValueListEntry
code: u'RESOURCE_ERROR'
location: u'rn333-4/testdb10'
message: u"Unexpected response from resource of type sqladmin.v1beta4.database: ERROR_RDBMS speckle::MySQL exception: mysql_query Can't create database 'testdb10'; database exists">, <ErrorsValueListEntry
code: u'RESOURCE_ERROR'
location: u'rn333-4/testdb5'
message: u"Unexpected response from resource of type sqladmin.v1beta4.database: ERROR_RDBMS speckle::MySQL exception: mysql_query Can't create database 'testdb5'; database exists">, <ErrorsValueListEntry
code: u'RESOURCE_ERROR'
location: u'rn333-4/testdb7'
message: u"Unexpected response from resource of type sqladmin.v1beta4.database: ERROR_RDBMS speckle::MySQL exception: mysql_query Can't create database 'testdb7'; database exists">, <ErrorsValueListEntry
code: u'RESOURCE_ERROR'
location: u'rn333-4/testdb9'
message: u"Unexpected response from resource of type sqladmin.v1beta4.database: ERROR_RDBMS speckle::MySQL exception: mysql_query Can't create database 'testdb9'; database exists">, <ErrorsValueListEntry
code: u'RESOURCE_ERROR'
location: u'rn333-4/testdb1'
message: u"Unexpected response from resource of type sqladmin.v1beta4.database: ERROR_RDBMS speckle::MySQL exception: mysql_query Can't create database 'testdb1'; database exists">]>
Original comment by rickyn...@gmail.com
on 26 Nov 2015 at 9:40
Thanks for following up; we'll investigate and get back to you soon.
Original comment by z...@google.com
on 27 Nov 2015 at 8:32
Still looking into this–it's proving to be a little hairy to figure out
what's going on. Thanks for your patience.
Original comment by z...@google.com
on 7 Dec 2015 at 2:45
I got some answers from someone on the deployment manager team:
-----------------------------------------------
Turns out the SQL API is different than most cloud APIs in a few ways, and so
must be used differently in DM as well.
1. sqladmin API does not allow instance names to be re-used, even after
deletion. This explains the 409 error "The instance or operation is not in an
appropriate state to handle the request". The instance name (rntest-db-db01)
needs to be changed with each new deployment.
2. Only one operation can happen on an instance at a time (including db
creation). To force this dependency chain, add a reference to each database on
the previously created resource. For the first db, replace the instance
property with "$(ref.rntest-db-db01.name)"'. For all subsequent datbases,
replace the instance property with "$(ref.rntest-db)"
I've attached a config that should correct these issues. To use:
$ gcloud deployment-manager deployments create rntest-db-dbXX --config
sqladmin.yaml
The jinja file needs to be in the same folder as the yaml file, and the
deployment name needs to be unique every time (even after deletion) to enforce
always-unique instance names.
Original comment by z...@google.com
on 8 Dec 2015 at 8:46
Attachments:
And...quick correction to point 2 above: the chained property should be
project, not instance. The sqladmin.jinja example does this correctly.
For the first db, chain to the instance:
project: $(ref.rntest-db-db01.project)
For the rest, chain to database n-1 (example for testdb9):
project: $(ref.testdb8.project)
Original comment by z...@google.com
on 8 Dec 2015 at 9:03
I have verified that the project-chaining approach works. Thanks!
Original comment by rickyn...@gmail.com
on 14 Dec 2015 at 11:00
Original issue reported on code.google.com by
rickyn...@gmail.com
on 22 Oct 2015 at 9:41Attachments: