所以,
我已经更新了gcloud组件。我一直在使用下面的代码,现在失败了:
gcloud app modules set-default default --version my-version --project my-proj所以我试着:
gcloud app services set-traffic --project my-proj --splits my-version=1 --migrate但我得到了以下输出:
Setting the following traffic allocations:
- my-proj/default/my-version: 1.0
Any other versions on the specified services will receive zero traffic.
ERROR: (gcloud.app.services.set-traffic) Issue setting traffic on service(s): default
INVALID_ARGUMENT: Invalid request.你知道可能出了什么问题吗?
提前谢谢你,奥哈德
==========编辑===========
按照Newman的建议,对于冗长,输出如下:
DEBUG: Running gcloud.app.services.set-traffic with Namespace(__calliope_internal_deepest_parser=ArgumentParser(prog='gcloud.app.services.set-traffic', usage=None, description='This command sets the traffic split of versions across a service or a project.', version=None, formatter_class=<class 'argparse.HelpFormatter'>, conflict_handler='error', add_help=False), account=None, authority_selector=None, authorization_token_file=None, calliope_command=<googlecloudsdk.calliope.backend.Command object at 0x101309bd0>, command_path=['gcloud', 'app', 'services', 'set-traffic'], configuration=None, credential_file_override=None, document=None, flatten=None, format=None, h=None, help=None, http_timeout=None, log_http='true', migrate=True, project='my-proj', quiet=True, services=[], split_by='ip', splits={'my-version': '1'}, trace_email=None, trace_log=None, trace_token=None, user_output_enabled=None, verbosity='debug', version=None).
--request-start--
uri: https://appengine.googleapis.com/v1beta5/apps/my-proj/services?alt=json
method: GET
-headers-start-
Authorization: Bearer {something that looks like a secret}
accept: application/json
accept-encoding: gzip, deflate
content-length: 0
user-agent: Cloud SDK Command Line Tool {something that looks like a secret} gcloud/128.0.0 command/gcloud.app.services.set-traffic invocation-id/{something that looks like a secret} environment/None environment-version/None interactive/True python/2.7.10 (Macintosh; Intel Mac OS X 15.6.0)
-headers-end-
-body-start-
-body-end-
--request-end--
--response-start--
-headers-start-
-content-encoding: gzip
alt-svc: quic=":443"; ma=2592000; v="36,35,34,33,32"
cache-control: private
content-length: 189
content-location: https://appengine.googleapis.com/v1beta5/apps/my-proj/services?alt=json
content-type: application/json; charset=UTF-8
date: Wed, 05 Oct 2016 13:45:30 GMT
server: ESF
status: 200
transfer-encoding: chunked
vary: Origin, X-Origin, Referer
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
x-xss-protection: 1; mode=block
-headers-end-
-body-start-
{
"services": [
{
"name": "apps/my-proj/services/default",
"id": "default",
"split": {
"allocations": {
"test": 1
}
}
}
]
}
-body-end-
total latency (request+response): 1.773 secs
--response-end--
Setting the following traffic allocations:
- my-proj/default/my-version: 1.0
Any other versions on the specified services will receive zero traffic.
--request-start--
uri: https://appengine.googleapis.com/v1beta5/apps/my-proj/services/default?mask=split&alt=json&migrateTraffic=True
method: PATCH
-headers-start-
Authorization: Bearer {something that looks like a secret}
accept: application/json
accept-encoding: gzip, deflate
content-length: 61
content-type: application/json
user-agent: Cloud SDK Command Line Tool {something that looks like a secret} gcloud/128.0.0 command/gcloud.app.services.set-traffic invocation-id/{something that looks like a secret} environment/None environment-version/None interactive/True python/2.7.10 (Macintosh; Intel Mac OS X 15.6.0)
-headers-end-
-body-start-
{"split": {"allocations": {"my-version": 1.0}, "shardBy": "IP"}}
-body-end-
--request-end--
--response-start--
-headers-start-
-content-encoding: gzip
alt-svc: quic=":443"; ma=2592000; v="36,35,34,33,32"
cache-control: private
content-length: 549
content-type: application/json; charset=UTF-8
date: Wed, 05 Oct 2016 13:45:31 GMT
server: ESF
status: 400
transfer-encoding: chunked
vary: Origin, X-Origin, Referer
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
x-xss-protection: 1; mode=block
-headers-end-
-body-start-
{
"error": {
"code": 400,
"message": "Invalid request.",
"status": "INVALID_ARGUMENT",
"details": [
{
"@type": "type.googleapis.com/google.rpc.BadRequest",
"fieldViolations": [
{
"field": "service",
"description": "Traffic migration does not support Managed VMs."
},
{
"field": "service.split.allocations[my-version]",
"description": "Warmup requests are not enabled for the target version."
}
]
}
]
}
}
-body-end-
total latency (request+response): 0.981 secs
--response-end--
DEBUG: (gcloud.app.services.set-traffic) Issue setting traffic on service(s): default
INVALID_ARGUMENT: Invalid request.
Traceback (most recent call last):
File "/Users/ohad/google-cloud-sdk/lib/googlecloudsdk/calliope/cli.py", line 733, in Execute
resources = args.calliope_command.Run(cli=self, args=args)
File "/Users/ohad/google-cloud-sdk/lib/googlecloudsdk/calliope/backend.py", line 1630, in Run
resources = command_instance.Run(args)
File "/Users/ohad/google-cloud-sdk/lib/surface/app/services/set_traffic.py", line 134, in Run
'\n\n'.join(printable_errors.values()))
TrafficSplitError: Issue setting traffic on service(s): default
INVALID_ARGUMENT: Invalid request.
ERROR: (gcloud.app.services.set-traffic) Issue setting traffic on service(s): default
INVALID_ARGUMENT: Invalid request.发布于 2020-03-02 02:56:56
您是否正在尝试将流量迁移到新版本的gcp app engine
gcloud documentation
此命令会将流量立即迁移到指定的版本:
gcloud app services set-traffic MY_SERVICE --splits MY_VERSION=1或者,您可以使用以下命令按百分比(verion1=30%和version2=70%)拆分:
gcloud app services set-traffic MY_SERVICE --splits MY_VERSION_V1=0.3,MY_VERSION_V2=0.7发布于 2018-07-04 02:02:01
https://stackoverflow.com/questions/39774384
复制相似问题