question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error since avro4s 1.9.0

See original GitHub issue

The following case happens in latest release only: v0.13.5.

TestProtocol.scala source code:

package mytest.domain

import freestyle.rpc.protocol.message

@message final case class ResponseValue(str: String = "ERROR")
@message final case class TestRequest(names: List[String])
@message final case class TestResponse(value: ResponseValue)

TestService.scala source code:

package mytest

import mytest.domain.{TestRequest, TestResponse}
import freestyle.rpc.protocol._

@service trait TestService[F[_]] {

  @rpc(AvroWithSchema)
  def testMethod(request: TestRequest): F[TestResponse]

}

When trying to compile it, the following error occurs:

[error] <macro>:6:129: could not find implicit value for parameter e: io.grpc.MethodDescriptor.Marshaller[mytest.domain.TestResponse]
[error]       _root_.io.grpc.MethodDescriptor.newBuilder(implicitly[_root_.io.grpc.MethodDescriptor.Marshaller[TestRequest]], implicitly[_root_.io.grpc.MethodDescriptor.Marshaller[TestResponse]]).setType(_root_.io.grpc.MethodDescriptor.MethodType.UNARY).setFullMethodName(_root_.io.grpc.MethodDescriptor.generateFullMethodName("TestService", "testMethod")).build()
[error]                                                                                                                                 ^
[error] <macro>:6:129: not enough arguments for method implicitly: (implicit e: io.grpc.MethodDescriptor.Marshaller[mytest.domain.TestResponse])io.grpc.MethodDescriptor.Marshaller[mytest.domain.TestResponse].
[error] Unspecified value parameter e.
[error]       _root_.io.grpc.MethodDescriptor.newBuilder(implicitly[_root_.io.grpc.MethodDescriptor.Marshaller[TestRequest]], implicitly[_root_.io.grpc.MethodDescriptor.Marshaller[TestResponse]]).setType(_root_.io.grpc.MethodDescriptor.MethodType.UNARY).setFullMethodName(_root_.io.grpc.MethodDescriptor.generateFullMethodName("TestService", "testMethod")).build()
[error]                                                                                                                                 ^
[error] two errors found
[error] (server / Test / compileIncremental) Compilation failed
[error] Total time: 39 s, completed Jun 1, 2018 2:35:08 PM

But it works if:

  • The default value is removed from ResponseValue.
  • Instead of importing the domain using import mytest.domain.{TestRequest, TestResponse}, using import mytest.domain._.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
fedefernandezcommented, Nov 22, 2018

Let me verify this, thanks for the heads up

0reactions
juanpedromorenocommented, Nov 22, 2018

Thanks @fedefernandez for confirming! 🎉

Read more comments on GitHub >

github_iconTop Results From Across the Web

Broken typeclass derivation upgrading from 1.9.0 to 2.0.1 #235
I am using avro4s to auto-generate kafka serdes with a function that looked like this in 1.9.0: object AutoSerde { def apply[A]( implicit ......
Read more >
sksamuel/avro4s - Gitter
But this fails with the error: requirement failed: Schema type for either ... is there a way in avro4s 1.9.0 to annotate the...
Read more >
Defining Empty String in Avro Schema - java - Stack Overflow
Source: https://github.com/sksamuel/avro4s/issues/106. If it is possible, try to upgrade your Avro Decoder to 1.9.0 version.
Read more >
Safety Considerations When Using Enums in Avro Schemas
How later versions of Avro fix the problem ... Since 1.9.0: A symbol default — informs the reader to use the default symbol...
Read more >
Avro4s Macros - Maven Repository
Version Scala Vulnerabilities Repository Usages Date 2.0.x 2.0.4 2.13.0‑M5 · 2.12 Central 2 2.0.3 2.0.x 2.13.0‑M5 · 2.12 Central 1 Dec 02, 2018 2.0.2 2.0.x 2.13.0‑M4...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found