Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Illegal name '}' #1262

Open
wcjohnson opened this issue Jul 9, 2019 · 1 comment
Open

Illegal name '}' #1262

wcjohnson opened this issue Jul 9, 2019 · 1 comment

Comments

@wcjohnson
Copy link

protobuf.js version: 6.8.8

When parsing the following proto file from the Envoy proxy control plane:

https://github.com/envoyproxy/envoy/blob/master/api/envoy/api/v2/cds.proto

The following parsing error is thrown:

Error: illegal name '}' (/Users/wcj/dev/mesh/experiments/kube/gitops/protocols/envoy/api/v2/cds.proto, line 130)
    at illegal (/Users/wcj/dev/mesh/experiments/kube/gitops/node_modules/protobufjs/src/parse.js:94:16)
    at parseOptionValue (/Users/wcj/dev/mesh/experiments/kube/gitops/node_modules/protobufjs/src/parse.js:559:27)
    at parseOption (/Users/wcj/dev/mesh/experiments/kube/gitops/node_modules/protobufjs/src/parse.js:551:9)
    at parseInlineOptions (/Users/wcj/dev/mesh/experiments/kube/gitops/node_modules/protobufjs/src/parse.js:585:17)
    at parseField_line (/Users/wcj/dev/mesh/experiments/kube/gitops/node_modules/protobufjs/src/parse.js:376:13)
    at ifBlock (/Users/wcj/dev/mesh/experiments/kube/gitops/node_modules/protobufjs/src/parse.js:290:17)
    at parseField (/Users/wcj/dev/mesh/experiments/kube/gitops/node_modules/protobufjs/src/parse.js:366:9)
    at parseType_block (/Users/wcj/dev/mesh/experiments/kube/gitops/node_modules/protobufjs/src/parse.js:338:21)
    at ifBlock (/Users/wcj/dev/mesh/experiments/kube/gitops/node_modules/protobufjs/src/parse.js:286:17)
    at parseType (/Users/wcj/dev/mesh/experiments/kube/gitops/node_modules/protobufjs/src/parse.js:304:9)

The relevant lines of .proto code are:

  // The timeout for new network connections to hosts in the cluster.
  google.protobuf.Duration connect_timeout = 4 [
    (validate.rules).duration.gt = {},
    (gogoproto.stdduration) = true,
    (gogoproto.nullable) = false
  ];

It appears the parser is having difficulty with (validate.rules).duration.gt = {}. Removing the bracketed annotation resolves the parsing problem.

@wcjohnson
Copy link
Author

This may be related to #1142 as well. Both result from trying to load the Envoy control plane defs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant