2

I already deployed a lot of google gRPC cloud endpoints with success.

But for the first time, i'm using a timestamp type in my proto, and when i'm trying to deploy my gRPC API, i have an error :

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.'

my command to generate api_descriptor.pb

protoc -I . backoffice*.proto \
--proto_path=. \
--include_imports \
--include_source_info \
--descriptor_set_out=api_descriptor.pb 

my 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

I cannot find any information about this issue ... any ideas ?

2 Answers2

2

This was a mistake in the timestamp.proto file, unfortunately.

It's been fixed, but it sounds like the protobuf release you've got doesn't have the fix in yet.

Fortunately, you can fix this locally - just edit timestamp.proto (wherever you've got it; that depends on which package you're using) to break the --) on line 121 into -- at the end of line 121 and ) on the next line, as it is in the current file (linked above).

Jon Skeet
  • 1,261,211
  • 792
  • 8,724
  • 8,929
  • OK thks for the fix. I'm using protobuf 3.5.1.1 : brew list protobuf --versions protobuf 3.5.1_1 –  Apr 05 '18 at 15:14
  • I just add a PR on brew to add the last version of protobuf : https://github.com/Homebrew/homebrew-core/pull/26252 –  Apr 06 '18 at 09:14
2

It seems this problem exists in protobuf versions (3.5.0 - 3.5.2, as of May 9, 2018) and fix is not in any release yet. I found the problematic file at "<python path>\Lib\site-packages\grpc_tools\_proto\google\protobuf\timestamp.proto"

Replacing the line:

// http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime--)

with

// http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime)

solved the problem for me

Caner
  • 49,709
  • 33
  • 153
  • 169