http4s / http4s

A minimal, idiomatic Scala interface for HTTP

Home Page:https://http4s.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Getting `java.lang.NoSuchMethodError 'fs2.Stream respToBytes(org.http4s.Response, int)'` after version upgrade

mdiasribeiro opened this issue · comments

After updating http4s (ember-client, circe, dsl) to latest 0.23.21 from 0.23.18 my swagger server is blowing up when a request arrives, with:

[info] 08:13:45.329 [main] ERROR Redirected from STDERR: [] Exception in thread "io-compute-1" java.lang.NoSuchMethodError: 'fs2.Stream org.http4s.ember.core.Encoder$.respToBytes(org.http4s.Response, int)' 
[info] 08:13:45.330 [main] ERROR Redirected from STDERR: [] 	at org.http4s.ember.server.internal.ServerHelpers$.send(ServerHelpers.scala:355) 
[info] 08:13:45.330 [main] ERROR Redirected from STDERR: [] 	at org.http4s.ember.server.internal.ServerHelpers$.$anonfun$runConnection$6(ServerHelpers.scala:459) 
[info] 08:13:45.330 [main] ERROR Redirected from STDERR: [] 	at cats.data.Kleisli.$anonfun$flatMap$4(Kleisli.scala:75) 
[info] 08:13:45.330 [main] ERROR Redirected from STDERR: [] 	at cats.effect.IOFiber.succeeded(IOFiber.scala:1190) 
[info] 08:13:45.330 [main] ERROR Redirected from STDERR: [] 	at cats.effect.IOFiber.runLoop(IOFiber.scala:240) 
[info] 08:13:45.330 [main] ERROR Redirected from STDERR: [] 	at cats.effect.IOFiber.asyncContinueSuccessfulR(IOFiber.scala:1358) 
[info] 08:13:45.330 [main] ERROR Redirected from STDERR: [] 	at cats.effect.IOFiber.run(IOFiber.scala:113) 
[info] 08:13:45.330 [main] ERROR Redirected from STDERR: [] 	at cats.effect.unsafe.WorkerThread.run(WorkerThread.scala:721) 

I've also updated cats-effect to 3.5.0, fs2 to 3.7.0 and tapir to 1.5.5. Using scala 2.13.11. Is this a regression or am I missing something?

Have you updated ember-server to 0.23.21 as well? the versions must match precisely.

see similar issue in #7142

Yes, all http4s-based projects are using the same value to set the version. Perhaps one of the dependencies is pulling an older version? I'll investigate

Do you have http4s-ember-server explicitly listed in your dependencies? Because based on the stack trace, you are definitely using it. So you should make sure to explicitly add it with the right version.

[info] 08:13:45.330 [main] ERROR Redirected from STDERR: [] 	at org.http4s.ember.server.internal.ServerHelpers$.send(ServerHelpers.scala:355)