Protocol buffers gcloud端点部署时间戳类型为的错误
我已经成功部署了很多google gRPC云端点 但这是我第一次在proto中使用时间戳类型,当我试图部署我的gRPC API时,我出现了一个错误:Protocol buffers gcloud端点部署时间戳类型为的错误,protocol-buffers,grpc,google-cloud-endpoints-v2,Protocol Buffers,Grpc,Google Cloud Endpoints V2,我已经成功部署了很多google gRPC云端点 但这是我第一次在proto中使用时间戳类型,当我试图部署我的gRPC API时,我出现了一个错误: gcloud endpoints deploy services api_descriptor.pb api_config.yaml ERROR: (gcloud.endpoints.services.deploy) INVALID_ARGUMENT: Cannot convert to service config. 'ERROR: goog
gcloud endpoints deploy services api_descriptor.pb api_config.yaml
ERROR: (gcloud.endpoints.services.deploy) INVALID_ARGUMENT: Cannot
convert to service config.
'ERROR: google/protobuf/timestamp.proto:121:1: (at document line 76)
Unexpected end tag '--)' with missing begin tag.'
生成api_descriptor.pb的我的命令
protoc -I . backoffice*.proto \
--proto_path=. \
--include_imports \
--include_source_info \
--descriptor_set_out=api_descriptor.pb
我的api_config.yaml
type: google.api.Service
config_version: 3
name: backoffice.endpoints.MY_PROJECT.cloud.goog
title: Backoffice gRPC API
apis:
- name: package.BackofficeApi
usage:
rules:
- selector: "*"
allow_unregistered_calls: true
我找不到有关此问题的任何信息。。。有什么想法吗?不幸的是,这是文件中的一个错误
是的,但听起来你的protobuf版本还没有修复
幸运的是,您可以在本地修复此问题—只需编辑
timestamp.proto
(无论您在哪里;这取决于您使用的是哪个软件包),即可将第121行的-->
分为第121行末尾的-->
和下一行的)
,就像当前文件中的一样(链接在上面).在protobuf
版本(截至2018年5月9日的3.5.0-3.5.2版)中似乎存在此问题,并且尚未发布此修复程序。我在“\Lib\site packages\grpc\u tools\\u proto\google\protobuf\timestamp.proto”
更换线路:
// http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime--)
与
为我解决了问题OK thks用于修复。我正在使用protobuf 3.5.1.1:brew列表protobuf——版本protobuf 3.5.1\u 1I只需在brew上添加一个PR即可添加protobuf的最新版本:
// http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime)