Bridgewater / scala-notebook

Interactive Scala REPL in a browser
Other
741 stars 155 forks source link

Creating a new notebook crashes the kernel immediately if you run other services on localhost #11

Open copumpkin opened 11 years ago

copumpkin commented 11 years ago

It then restarts and all is well, but the crash in the log is as follows:

Embedded server running on port 8899. Press any key to stop.
net.liftweb.json.JsonParser$ParseException: unknown token h
Near: ho
    at net.liftweb.json.JsonParser$Parser.fail(JsonParser.scala:228)
    at net.liftweb.json.JsonParser$Parser.nextToken(JsonParser.scala:313)
    at net.liftweb.json.JsonParser$$anonfun$2.apply(JsonParser.scala:184)
    at net.liftweb.json.JsonParser$$anonfun$2.apply(JsonParser.scala:141)
    at net.liftweb.json.JsonParser$.parse(JsonParser.scala:80)
    at net.liftweb.json.JsonParser$.parse(JsonParser.scala:45)
    at net.liftweb.json.package$.parse(package.scala:41)
    at com.bwater.notebook.ObservableIntent$$anonfun$1$$anonfun$apply$1.apply(ObservableIntent.scala:61)
    at com.bwater.notebook.ObservableIntent$$anonfun$1$$anonfun$apply$1.apply(ObservableIntent.scala:25)
    at scala.PartialFunction$$anon$1.apply(PartialFunction.scala:75)
    at unfiltered.netty.websockets.SocketPlan.messageReceived(plans.scala:182)
    at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:296)
    at org.jboss.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessageReceived(FrameDecoder.java:458)
    at org.jboss.netty.handler.codec.replay.ReplayingDecoder.callDecode(ReplayingDecoder.java:538)
    at org.jboss.netty.handler.codec.replay.ReplayingDecoder.messageReceived(ReplayingDecoder.java:437)
    at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:268)
    at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:255)
    at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:91)
    at org.jboss.netty.channel.socket.nio.AbstractNioWorker.processSelectedKeys(AbstractNioWorker.java:385)
    at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:256)
    at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:35)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:680)
2013-04-03 20:10:41,670  INFO [RemoteProcess-akka.actor.default-dispatcher-2] (akka.event.slf4j.Slf4jEventHandler) - Slf4jEventHandler started

I added some more debugging and it turns out that the bad message the parser doesn't like is host=.butterfly. I'm trying to find where it gets sent now. It looks like a cookie, but I have no idea how it got set and why the kernel is receiving it.

copumpkin commented 11 years ago

I guess this might be a bogus bug that arises because something else I ran on 127.0.0.1 set that cookie (still no clue what). We probably still shouldn't crash on unexpected cookies, though.

copumpkin commented 11 years ago

Basically, I run another local project that listens on 127.0.0.1 on a different port (google/openrefine) and it sets a cookie. SN receives that cookie and barfs horribly.

KenCoder commented 11 years ago

Dan - make this a pull request and I'll merge it