riok / Kreya

Kreya is a GUI client for gRPC and REST APIs with innovative features for environments, authorizations and more.
https://kreya.app
289 stars 5 forks source link

Failed in reflection #158

Closed tcgtam closed 1 year ago

tcgtam commented 1 year ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Reflection failed on bytearray I/O object

Expected behavior A clear and concise description of what you expected to happen.

Screenshots { "kreyaVersion": "1.10.1", "releaseChannel": "stable", "osDescription": "Microsoft Windows 10.0.19045", "osVersion": "Microsoft Windows NT 10.0.19045.0", "osArch": "X64", "processArch": "X64", "runtimeIdentifier": "win10-x64", "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.67" }

Google.Protobuf.Reflection.DescriptorValidationException: ird.ntp.fe.epayment.v1.PaymentService.createPaymentURL: ".ird.ntp.fe.epayment.v1.CreatePaymentURLReq" is not defined. at Google.Protobuf.Reflection.DescriptorPool.LookupSymbol(String name, IDescriptor relativeTo) at Google.Protobuf.Reflection.MethodDescriptor.CrossLink() at Google.Protobuf.Reflection.ServiceDescriptor.CrossLink() at Google.Protobuf.Reflection.FileDescriptor.CrossLink() at Google.Protobuf.Reflection.FileDescriptor.BuildFromByteStrings(IEnumerable1 descriptorData, ExtensionRegistry registry) at Google.Protobuf.Reflection.FileDescriptor.BuildFromByteStrings(IEnumerable1 descriptorData) at Kreya.Grpc.Core.Importer.ImporterProtoRegistry.AddDescriptors(IEnumerable1 byteStrings) in C:\dev\gitlab-runner\builds\ifF5m2AW\0\riokch\kreya\kreya\src\grpc\Kreya.Grpc.Core\Importer\ImporterProtoRegistry.cs:line 50 at Kreya.Grpc.Core.Importer.ImporterProtoRegistry.SetDescriptors(IEnumerable1 byteStrings) in C:\dev\gitlab-runner\builds\ifF5m2AW\0\riokch\kreya\kreya\src\grpc\Kreya.Grpc.Core\Importer\ImporterProtoRegistry.cs:line 21 at Kreya.Grpc.Core.Importer.ProtoRegistryAccessor.SetDescriptors(Guid importStreamId, IEnumerable1 byteStrings) in C:\dev\gitlab-runner\builds\ifF5m2AW\0\riokch\kreya\kreya\src\grpc\Kreya.Grpc.Core\Importer\ProtoRegistryAccessor.cs:line 29 at Kreya.Grpc.Core.Importer.BaseGrpcImporter1.Import(IImportStream1 importStream, Boolean allowCache) in C:\dev\gitlab-runner\builds\ifF5m2AW\0\riokch\kreya\kreya\src\grpc\Kreya.Grpc.Core\Importer\BaseGrpcImporter.cs:line 49 at Kreya.Core.Importer.ImporterService.RunSingleImporter(ImportStream importStream, Boolean allowCache, IReadOnlyDictionary2 operationsByInvoker) in C:\dev\gitlab-runner\builds\ifF5m2AW\0\riokch\kreya\kreya\src\Kreya.Core\Importer\ImporterService.cs:line 171 at Kreya.Core.Importer.ImporterService.RunImporter(Guid id, Boolean allowCache) in C:\dev\gitlab-runner\builds\ifF5m2AW\0\riokch\kreya\kreya\src\Kreya.Core\Importer\ImporterService.cs:line 106 at SpiderEye.Bridge.ApiMethod.InvokeAsync(Object instance, Object parameter) at SpiderEye.Bridge.WebviewBridge.InvokeWithDependencyInjection(IDependencyInjectionApiMethod apiMethod, Object parameters) at SpiderEye.Bridge.WebviewBridge.InvokeWithDependencyInjection(IDependencyInjectionApiMethod apiMethod, Object parameters) at SpiderEye.Bridge.WebviewBridge.ResolveCall(String id, String parameters) Environment (if possible, copy the information from the error dialog or the About menu):

Additional context Add any other context about the problem here.

ni507 commented 1 year ago

Thanks for your report. Can you tell us the content of the proto file? It looks like that the PaymentService is missing the CreatePaymentURLReq.

tcgtam commented 1 year ago

Attached is our proto files. Our gRPC server runs on Java platform and we use Java util to generate gRPC data objects and interface . test.zip

ni507 commented 1 year ago

The proto files look good. We were able to set everything up locally and the import into Kreya works. Perhaps your Java services are not yet configured correctly with the proto includes, etc.

tcgtam commented 1 year ago

The proto files look good. We were able to set everything up locally and the import into Kreya works. Perhaps your Java services are not yet configured correctly with the proto includes, etc.

But, for the same Java service endpoint, we can use Postman to perform reflection and call the corresponding function?

ni507 commented 1 year ago

Sorry for the late reply, I tried to reproduce it with a small sample application. With a small basic setup it works for me with your protos.

For the server reflection part I enabled it with ProtoReflectionService.newInstance() . Whole configuration looks like this:

Grpc.newServerBuilderForPort(port, InsecureServerCredentials.create())
                .addService(new PaymentServiceImpl())
                .addService(ProtoReflectionService.newInstance())
                .build()
                .start();

Since it works for me with the protos you provided, it must be a difference in the Java service setup. Can you provide me with more information about your setup?

CommonGuy commented 1 year ago

I'm going to close this issue as no further information was provided