{"action":"created","issue":{"url":"https://api.github.com/repos/salesforce/grpc-java-contrib/issues/91","repository_url":"https://api.github.com/repos/salesforce/grpc-java-contrib","labels_url":"https://api.github.com/repos/salesforce/grpc-java-contrib/issues/91/labels{/name}","comments_url":"https://api.github.com/repos/salesforce/grpc-java-contrib/issues/91/comments","events_url":"https://api.github.com/repos/salesforce/grpc-java-contrib/issues/91/events","html_url":"https://github.com/salesforce/grpc-java-contrib/issues/91","id":375254675,"node_id":"MDU6SXNzdWUzNzUyNTQ2NzU=","number":91,"title":"jprotoc version 0.8.1 IllegalArgumentException from ProtoTypeMap.of()","user":{"login":"wfhartford","id":717585,"node_id":"MDQ6VXNlcjcxNzU4NQ==","avatar_url":"https://avatars2.githubusercontent.com/u/717585?v=4","gravatar_id":"","url":"https://api.github.com/users/wfhartford","html_url":"https://github.com/wfhartford","followers_url":"https://api.github.com/users/wfhartford/followers","following_url":"https://api.github.com/users/wfhartford/following{/other_user}","gists_url":"https://api.github.com/users/wfhartford/gists{/gist_id}","starred_url":"https://api.github.com/users/wfhartford/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wfhartford/subscriptions","organizations_url":"https://api.github.com/users/wfhartford/orgs","repos_url":"https://api.github.com/users/wfhartford/repos","events_url":"https://api.github.com/users/wfhartford/events{/privacy}","received_events_url":"https://api.github.com/users/wfhartford/received_events","type":"User","site_admin":false},"labels":[{"id":579089346,"node_id":"MDU6TGFiZWw1NzkwODkzNDY=","url":"https://api.github.com/repos/salesforce/grpc-java-contrib/labels/bug","name":"bug","color":"ee0701","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-10-29T23:13:04Z","updated_at":"2018-12-12T18:00:43Z","closed_at":null,"author_association":"NONE","body":"An upgrade to version 0.8.1 of jprotoc caused a new error in my build because of a duplicate entry in the ImmutableMap. Error output is:\r\n```\r\n  java.lang.IllegalArgumentException: Multiple entries with same key: .google.protobuf.Type=com.google.protobuf.DescriptorProtos.Type and .google.protobuf.Type=com.google.protobuf.Type\r\n        at com.google.common.collect.ImmutableMap.checkNoConflict(ImmutableMap.java:136)\r\n        at com.google.common.collect.RegularImmutableMap.checkNoConflictInKeyBucket(RegularImmutableMap.java:100)\r\n        at com.google.common.collect.RegularImmutableMap.fromEntryArray(RegularImmutableMap.java:86)\r\n        at com.google.common.collect.ImmutableMap$Builder.build(ImmutableMap.java:300)\r\n        at com.salesforce.jprotoc.ProtoTypeMap.of(ProtoTypeMap.java:69)\r\n        at io.rouz.grpc.kotlin.GrpcKotlinGenerator.generate(GrpcKotlinGenerator.java:65)\r\n        at com.salesforce.jprotoc.ProtocPlugin.lambda$generate$0(ProtocPlugin.java:77)\r\n        at java.base/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:271)\r\n        at java.base/java.util.Collections$2.tryAdvance(Collections.java:4727)\r\n        at java.base/java.util.Collections$2.forEachRemaining(Collections.java:4735)\r\n        at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)\r\n        at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)\r\n        at java.base/java.util.stream.StreamSpliterators$WrappingSpliterator.forEachRemaining(StreamSpliterators.java:312)\r\n        at java.base/java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:734)\r\n        at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)\r\n        at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)\r\n        at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)\r\n        at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)\r\n        at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578)\r\n        at com.salesforce.jprotoc.ProtocPlugin.generate(ProtocPlugin.java:86)\r\n        at com.salesforce.jprotoc.ProtocPlugin.generate(ProtocPlugin.java:45)\r\n        at com.salesforce.jprotoc.ProtocPlugin.generate(ProtocPlugin.java:37)\r\n        at io.rouz.grpc.kotlin.GrpcKotlinGenerator.main(GrpcKotlinGenerator.java:59)\r\n        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\r\n        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n        at java.base/java.lang.reflect.Method.invoke(Method.java:564)\r\n        at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)\r\n        at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)\r\n        at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)\r\n        at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51)\r\n  --grpc-kotlin_out: protoc-gen-grpc-kotlin: Plugin failed with status code 1.\r\n```\r\nI will do some further investigation and try to make a minimal reproduction case. My project is using the [grpc-kotlin](https://github.com/rouzwawi/grpc-kotlin) plugin which in turn uses jprotoc. I've tested with version 0.7.1 and 0.8.0, both of which do not produce the above error, only version 0.8.1 does."},"comment":{"url":"https://api.github.com/repos/salesforce/grpc-java-contrib/issues/comments/446683339","html_url":"https://github.com/salesforce/grpc-java-contrib/issues/91#issuecomment-446683339","issue_url":"https://api.github.com/repos/salesforce/grpc-java-contrib/issues/91","id":446683339,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0NjY4MzMzOQ==","user":{"login":"rmichela","id":167733,"node_id":"MDQ6VXNlcjE2NzczMw==","avatar_url":"https://avatars2.githubusercontent.com/u/167733?v=4","gravatar_id":"","url":"https://api.github.com/users/rmichela","html_url":"https://github.com/rmichela","followers_url":"https://api.github.com/users/rmichela/followers","following_url":"https://api.github.com/users/rmichela/following{/other_user}","gists_url":"https://api.github.com/users/rmichela/gists{/gist_id}","starred_url":"https://api.github.com/users/rmichela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmichela/subscriptions","organizations_url":"https://api.github.com/users/rmichela/orgs","repos_url":"https://api.github.com/users/rmichela/repos","events_url":"https://api.github.com/users/rmichela/events{/privacy}","received_events_url":"https://api.github.com/users/rmichela/received_events","type":"User","site_admin":false},"created_at":"2018-12-12T18:00:43Z","updated_at":"2018-12-12T18:00:43Z","author_association":"CONTRIBUTOR","body":"Ok. I've been digging into this. Sorry for the delay. I had a baby shortly after this bug was submitted. 👶 🍼 \r\n\r\nThe problem is ultimately caused by a behavior of `protobuf-gradle-plugin`. Swap the `protobuf` dependency to a `compile` dependency. When a `protobuf` dependency is used, `protobuf-gradle-plugin` ends up passing the standard protobuf protos to protoc twice, once through the `extracted-protos` directory and once through the `extracted-include-protos`.\r\n\r\nThis behavior has always been there and is arguably correct for `protobuf-gradle-plugin`. I'm still digging into why jprotoc started having problems."}}
{"actor":{"display_login":"rmichela"}}