loopbackio / loopbackio/loopback4-extension-grpc
Application not starting when it has more than one described procedure
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 18
- Forks
- 8
- PR merge metrics
- No merged PRs in 30d
Description
Description/Steps to reproduce
When I add the second procedure in proto3 file and describe it in controller application launch fails.
Steps to reproduce:
- Create minimal project
- Install grpc extension
- Write two procedures
Link to reproduction sandbox
https://github.com/zombiQWERTY/loopback-grpc-test
Additional information
Platform: Mac OS (darwin x64 11.9.0)
npm ls --prod --depth 0 | grep loopback
├── @loopback/boot@1.5.3
├── @loopback/context@1.21.4
├── @loopback/core@1.9.3
├── @loopback/grpc@0.1.1
├── @loopback/openapi-v3@1.9.4
├── @loopback/repository@1.12.0
├── @loopback/rest@1.17.0
├── @loopback/rest-explorer@1.3.4
└── @loopback/service-proxy@1.3.3
Method handler sayTest for /greeterpackage.Greeter/SayTest expected but not provided
Method handler sayHello for /greeterpackage.Greeter/SayHello expected but not provided
Cannot start the application. Error: Method handler for /greeterpackage.Greeter/SayHello already provided.
at Object.keys.forEach.name (***/test/node_modules/grpc/src/server.js:920:13)
at Array.forEach (<anonymous>)
at Server.addService (***/test/node_modules/grpc/src/server.js:884:24)
at GrpcServer._setupControllerMethods (***/test/node_modules/@loopback/grpc/src/grpc.server.ts:99:19)
at new GrpcServer (***/test/node_modules/@loopback/grpc/src/grpc.server.ts:57:12)
at value_promise_1.transformValueOrPromise.args (***/test/node_modules/@loopback/context/src/resolver.ts:73:14)
at Object.transformValueOrPromise (***/test/node_modules/@loopback/context/src/value-promise.ts:270:12)
at Object.instantiateClass (***/test/node_modules/@loopback/context/src/resolver.ts:66:35)
at _setValueGetter (***/test/node_modules/@loopback/context/src/binding.ts:522:29)
at Binding._getValue (***/test/node_modules/@loopback/context/src/binding.ts:400:14)
at resolution_session_1.ResolutionSession.runWithBinding.s (***/test/node_modules/@loopback/context/src/binding.ts:295:23)
at value_promise_1.tryWithFinally (***/test/node_modules/@loopback/context/src/resolution-session.ts:114:13)
at Object.tryWithFinally (***/test/node_modules/@loopback/context/src/value-promise.ts:196:14)
at Function.runWithBinding (***/test/node_modules/@loopback/context/src/resolution-session.ts:113:12)
at Binding.getValue (***/test/node_modules/@loopback/context/src/binding.ts:292:40)
at value_promise_1.resolveList.b (***/test/node_modules/@loopback/context/src/context-view.ts:125:16)
npm version is 6.9.0
node version is 11.9.0
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the failure using the linked loopback-grpc-test sandbox with two procedures, then inspect @loopback/grpc/src/grpc.server.ts, especially _setupControllerMethods at the stack-trace location. Compare the procedure declarations with the handlers registered during startup. Done means the application starts successfully with both procedures and no duplicate or missing-handler errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- grpc, nodejs, typescript
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100