play-grpc icon indicating copy to clipboard operation
play-grpc copied to clipboard

Target uri should not have null authority

Open onemore-creator opened this issue 10 months ago • 4 comments

Hi there,

Been trying to create a simple client/server from one protobuf file. The server works as expected, but when I am trying to configure the client

pekko.grpc.client {
  "prime.PrimeNumberService" {
    host = "127.0.0.1"
    port = 9000
    use-tls = false
  }
}

I get the following error:

[IllegalArgumentException: requirement failed: target uri should not have null authority, got [http://///127.0.0.1:9000]]

And some more details:

@PekkoGrpcGenerated
28object PrimeNumberServiceClient {
29  def apply(settings: GrpcClientSettings)(implicit sys: ClassicActorSystemProvider): PrimeNumberServiceClient =
30    new DefaultPrimeNumberServiceClient(GrpcChannel(settings), isChannelOwned = true)
31
32
33  def apply(channel: GrpcChannel)(implicit sys: ClassicActorSystemProvider): PrimeNumberServiceClient =
34    new DefaultPrimeNumberServiceClient(channel, isChannelOwned = false)

Do you know if I made a typo in the configuration or should I use a different approach?

Thanks!

onemore-creator avatar Feb 25 '25 09:02 onemore-creator

To add some more context - I am using Play 3.0.2, scala 3.3.3, play-grpc-generators 0.12.2

onemore-creator avatar Feb 25 '25 09:02 onemore-creator

Update: got that fixed by switching from netty to pekko-http for pekko.grpc.client

onemore-creator avatar Feb 25 '25 14:02 onemore-creator

pekko.grpc.client."*" {
  backend = "pekko-http"
}

onemore-creator avatar Feb 25 '25 14:02 onemore-creator

Update: got that fixed by switching from netty to pekko-http for pekko.grpc.client

Great if that works for you now!

mkurz avatar Mar 28 '25 12:03 mkurz