Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] server mode throws error about "replpp.server.WebServiceWithWebSocket$basicAuth" not implemented #5195

Open
BrianMehrman opened this issue Dec 31, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@BrianMehrman
Copy link

Hi there, I am trying to get the server mode started so I can query a CPG from a python script.

There is a possibility that I have not setup something correctly.

I have tried a precompiled version, then tried to debug the problem locally with no success.

I when I trying the server mode using a simple test post requests I get an error.

curl http://localhost:8080/query-sync -X POST -d '{"query": "val bar = foo + 1"}'

This request returns the following error.

java.lang.AbstractMethodError: Receiver class replpp.server.WebServiceWithWebSocket$basicAuth does not define or inherit an implementation of the resolved method abstract wrapFunction(Lcask/model/Request;Lscala/Function2;)Lcask/router/Result; of interface cask.router.Decorator.
        at cask.router.Decorator$.invoke(Decorators.scala:47)
        at cask.main.Main$DefaultHandler.handleRequest(Main.scala:123)
        at io.undertow.server.Connectors.executeRootHandler(Connectors.java:395)
        at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:861)
        at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
        at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2513)
        at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1538)
        at org.xnio.XnioWorker$WorkerThreadFactory$1$1.run(XnioWorker.java:1282)
        at java.base/java.lang.Thread.run(Thread.java:834)

Steps to reproduce the behavior:

  1. Install Joern
  2. Start Joern in server mode
  3. Run command curl http://localhost:8080/query-sync -X POST -d '{"query": "val bar = foo + 1"}'
  4. See error

Expected behavior
From the Joern server documentation i expect to see this output

$ joern-remote 'val foo = 42'
> val foo: Int = 42

Desktop (please complete the following information):

  • OS: MacOS Sequoia 15.1.1 (Apple M4 Max(
  • Joern Version: v4.0.195
  • Java version: openjdk 21.0.5 2024-10-15 LTS

Additional context

Upon trying to get the Dev Container working I did have to migrate the Centos7 image to Ubuntu, however I have not seen any side effects from this change. The CLI still works.

Please let me know if you need any further information.

@BrianMehrman BrianMehrman added the bug Something isn't working label Dec 31, 2024
@Codefiring
Copy link

Codefiring commented Jan 3, 2025

I have occured the same problem.
I am not familiar with scala. I can only find the server mode is implemented in the git repo scala-repl-pp

@mpollmeier
Copy link
Contributor

thanks for reporting, I'll take a look

@heedongy
Copy link

heedongy commented Jan 7, 2025

I have also occured the same problem.
Although I’m not entirely sure, it seems to be caused by some libraryDependencies version upgrades (Scala 3.5.2 update).
(8fa3240)

I solved it temporarily by rolling back to scala-3.4.2 and reverting the libraryDependencies to their previous versions.

--- a/build.sbt
+++ b/build.sbt

-ThisBuild / scalaVersion := "3.5.2"
+ThisBuild / scalaVersion := "3.4.2"

-val cpgVersion = "1.7.15"
+val cpgVersion = "1.7.13"

--- a/project/Versions.scala
+++ b/project/Versions.scala

-  val cask                   = "0.10.2"
+  val cask                   = "0.9.2"

-  val phpParser              = "4.15.10"
+  val phpParser              = "4.15.9"

-  val scalaReplPP            = "0.3.8"
+  val scalaReplPP            = "0.3.6"

-  val upickle                = "4.0.2"
+  val upickle                = "3.3.1"

Hope this helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants