当我运行gcloud sql instances create testdb1
时,我创建了一个数据库。
当我运行gcloud sql instances create testdb2 --pricing-plan=PER_USE
时,我得到一个python堆栈跟踪:
DEBUG: operation : None
DEBUG: (gcloud.sql.instances.create) The instance or operation is not in an appropriate state to handle the request.
Traceback (most recent call last):
File "/home/scole/google-cloud-sdk/./lib/googlecloudsdk/calliope/cli.py", line 548, in Execute
result = args.cmd_func(cli=self, args=args)
File "/home/scole/google-cloud-sdk/./lib/googlecloudsdk/calliope/backend.py", line 1124, in Run
result = command_instance.Run(args)
File "/home/scole/google-cloud-sdk/./lib/googlecloudsdk/sql/util.py", line 229, in Func
return foo(*args, **kwargs)
File "/home/scole/google-cloud-sdk/lib/googlecloudsdk/sql/tools/instances/create.py", line 206, in Run
result = sql_client.instances.Insert(instance_resource)
File "/home/scole/google-cloud-sdk/./lib/googlecloudapis/sqladmin/v1beta3/sqladmin_v1beta3_client.py", line 401, in Insert
config, request, global_params=global_params)
File "/home/scole/google-cloud-sdk/./lib/googlecloudapis/apitools/base/py/base_api.py", line 639, in _RunMethod
return self.ProcessHttpResponse(method_config, http_response)
File "/home/scole/google-cloud-sdk/./lib/googlecloudapis/apitools/base/py/base_api.py", line 645, in ProcessHttpResponse
self.__ProcessHttpResponse(method_config, http_response))
File "/home/scole/google-cloud-sdk/./lib/googlecloudapis/apitools/base/py/base_api.py", line 528, in __ProcessHttpResponse
raise exceptions.HttpError.FromResponse(http_response)
HttpException: The instance or operation is not in an appropriate state to handle the request.
ERROR: (gcloud.sql.instances.create) The instance or operation is not in an appropriate state to handle the request.
每次向命令行添加选项时都会发生跟踪。我应该在哪里寻求命令行选项?
根据gcloud --version
,我在gcloud SDK 0.9.69。
答案 0 :(得分:2)
我收到了Google支持的回复。当您尝试使用以前使用的名称创建SQL实例时,似乎抛出此异常。在名称中添加某种uuid将解决问题。
(所以我重复使用相同名称的部署代码[create-delete-create-delete-etc]是处理事情的错误方法。)