codingteam / horta-hell

Configurable XMPP bot written in Scala based on the Akka framework.
MIT License
15 stars 8 forks source link

Problem with HTTPS loglist #397

Closed ForNeVeR closed 8 years ago

ForNeVeR commented 8 years ago

After loglist have been migrated to HTTPS, we have the following:

15:56:35.708 [CodingteamSystem-akka.actor.default-dispatcher-6439] INFO  r.o.c.h.p.loglist.LogListPlugin - Requesting http://www.loglist.net/api/quote/8055
15:56:36.190 [CodingteamSystem-akka.actor.default-dispatcher-6441] INFO  r.o.c.h.p.loglist.LogListPlugin - Json answer: <html>
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx/1.4.6 (Ubuntu)</center>
</body>
</html>

15:56:36.216 [CodingteamSystem-akka.actor.default-dispatcher-6441] ERROR akka.actor.OneForOneStrategy - Unexpected character '<' at input index 0 (line 1, position 1), expected JSON Value:
<html>?
^

spray.json.JsonParser$ParsingException: Unexpected character '<' at input index 0 (line 1, position 1), expected JSON Value:
<html>?
^

        at spray.json.JsonParser.fail(JsonParser.scala:198) ~[horta-hell.jar:0.16.2]
        at spray.json.JsonParser.value(JsonParser.scala:63) ~[horta-hell.jar:0.16.2]
        at spray.json.JsonParser.parseJsValue(JsonParser.scala:43) ~[horta-hell.jar:0.16.2]
        at spray.json.JsonParser$.apply(JsonParser.scala:28) ~[horta-hell.jar:0.16.2]
        at spray.json.PimpedString.parseJson(package.scala:45) ~[horta-hell.jar:0.16.2]
        at ru.org.codingteam.horta.plugins.loglist.LogListApi$.retrieveQuoteFromUrl(LogListApi.scala:26) ~[horta-hell.jar:0.16.2]
        at ru.org.codingteam.horta.plugins.loglist.LogListApi$.getQuoteById(LogListApi.scala:18) ~[horta-hell.jar:0.16.2]
        at ru.org.codingteam.horta.plugins.loglist.LogListPlugin.processCommand(LogListPlugin.scala:30) ~[horta-hell.jar:0.16.2]
        at ru.org.codingteam.horta.plugins.CommandProcessor$$anonfun$receive$1.applyOrElse(CommandProcessor.scala:11) ~[horta-hell.jar:0.16.2]
        at akka.actor.Actor$class.aroundReceive(Actor.scala:465) ~[horta-hell.jar:0.16.2]
        at ru.org.codingteam.horta.plugins.BasePlugin.aroundReceive(BasePlugin.scala:8) ~[horta-hell.jar:0.16.2]
        at akka.actor.ActorCell.receiveMessage(ActorCell.scala:516) [horta-hell.jar:0.16.2]
        at akka.actor.ActorCell.invoke(ActorCell.scala:487) [horta-hell.jar:0.16.2]
        at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:238) [horta-hell.jar:0.16.2]
        at akka.dispatch.Mailbox.run(Mailbox.scala:220) [horta-hell.jar:0.16.2]
        at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:393) [horta-hell.jar:0.16.2]
        at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260) [horta-hell.jar:0.16.2]
        at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339) [horta-hell.jar:0.16.2]
        at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979) [horta-hell.jar:0.16.2]
        at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107) [horta-hell.jar:0.16.2]
15:56:38.312 [CodingteamSystem-akka.actor.default-dispatcher-6441] DEBUG s.StatementExecutor$$anon$1 - [SQL Execution] insert into Log (time, room, sender, type, message) values ('2016-06-06 15:56:38.312', 'codingteam@conference.jabber.ru', 'horta hell', 'message', 'ForNeVeR: [ERROR] Something bad happened. Please, do not panic and tell Dr. von Never to take a look... (113)'); (0 ms)

We need to fix that ASAP and also extract loglist URL to the configuration file. Maybe we'll need to disable SSL certificate checking also because modern Oracle JVM distributions still doesn't support Let's Encrypt certificates. Need to check that shits.