patsonluk / airline

Apache License 2.0
109 stars 71 forks source link

airline-web activator crashing on new cycle #558

Closed southworst closed 1 year ago

southworst commented 1 year ago

sorry for the wall of text post here, DM me on discord for more info if needed

on initial install the web service crashes when the simulation ticks over, error output: loaded 0 alliances Refreshed ES alliances Local main actor received topic CycleInfo(12,0.0,0), re-publishing to akka://airline-websocket-actor-systemUncaught error from thread [ airline-websocket-actor-system-akka.actor.default-dispatcher-8]: null, shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled for ActorSystem[airline-websocket-actor-system] java.lang.ExceptionInInitializerError akka://airline-websocket-actor-system/user/1-0 Received cycle info on cycle: 12 at websocket.LocalMainActor$$anonfun$receive$2$$anonfun$applyOrElse$5.applyOrElse(ActorCenter.scala:115) at websocket.LocalMainActor$$anonfun$receive$2$$anonfun$applyOrElse$5.applyOrElse(ActorCenter.scala:106) at scala.PartialFunction$Lifted.apply(PartialFunction.scala:315) at scala.PartialFunction$Lifted.apply(PartialFunction.scala:311) at scala.Option.collect(Option.scala:463) at websocket.LocalMainActor$$anonfun$receive$2.applyOrElse(ActorCenter.scala:106) at akka.actor.Actor.aroundReceive(Actor.scala:539) at akka.actor.Actor.aroundReceive$(Actor.scala:537) at websocket.LocalMainActor.aroundReceive(ActorCenter.scala:93) at akka.actor.ActorCell.receiveMessage(ActorCell.scala:614) at akka.actor.ActorCell.invoke(ActorCell.scala:583) at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:268) at akka.dispatch.Mailbox.run(Mailbox.scala:229) at akka.dispatch.Mailbox.exec(Mailbox.scala:241) at akka.dispatch.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260) at akka.dispatch.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339) at akka.dispatch.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979) at akka.dispatch.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107) Caused by: java.lang.NullPointerException at java.base/java.io.Reader.(Reader.java:167) at java.base/java.io.InputStreamReader.(InputStreamReader.java:72) at controllers.GooglePhotoUtil.getCredentials(GooglePhotoUtil.java:63) at controllers.GooglePhotoUtil.loadBannerUrls(GooglePhotoUtil.java:111) at controllers.GooglePhotoUtil.refreshBanners(GooglePhotoUtil.java:84) at controllers.GooglePhotoUtil.(GooglePhotoUtil.java:51) ... 18 more [ERROR] [SECURITY][01/21/2023 12:36:50.474] [airline-websocket-actor-system-akka.actor.default-dispatcher-8] [akka.actor.ActorSystemImpl(airline-websocket-actor-system)] Uncaught error from thread [airline-websocket-actor-system-akka.actor.default-dispatcher-8]: null, shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled for ActorSystem[airline-websocket-actor-system] java.lang.ExceptionInInitializerError at websocket.LocalMainActor$$anonfun$receive$2$$anonfun$applyOrElse$5.applyOrElse(ActorCenter.scala:115) at websocket.LocalMainActor$$anonfun$receive$2$$anonfun$applyOrElse$5.applyOrElse(ActorCenter.scala:106) at scala.PartialFunction$Lifted.apply(PartialFunction.scala:315) at scala.PartialFunction$Lifted.apply(PartialFunction.scala:311) at scala.Option.collect(Option.scala:463) at websocket.LocalMainActor$$anonfun$receive$2.applyOrElse(ActorCenter.scala:106) at akka.actor.Actor.aroundReceive(Actor.scala:539) at akka.actor.Actor.aroundReceive$(Actor.scala:537) at websocket.LocalMainActor.aroundReceive(ActorCenter.scala:93) at akka.actor.ActorCell.receiveMessage(ActorCell.scala:614) at akka.actor.ActorCell.invoke(ActorCell.scala:583) at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:268) at akka.dispatch.Mailbox.run(Mailbox.scala:229) at akka.dispatch.Mailbox.exec(Mailbox.scala:241) at akka.dispatch.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260) at akka.dispatch.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339) at akka.dispatch.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979) at akka.dispatch.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107) Caused by: java.lang.NullPointerException at java.base/java.io.Reader.(Reader.java:167) at java.base/java.io.InputStreamReader.(InputStreamReader.java:72) at controllers.GooglePhotoUtil.getCredentials(GooglePhotoUtil.java:63) at controllers.GooglePhotoUtil.loadBannerUrls(GooglePhotoUtil.java:111) at controllers.GooglePhotoUtil.refreshBanners(GooglePhotoUtil.java:84) at controllers.GooglePhotoUtil.(GooglePhotoUtil.java:51) ... 18 more

[info] - play.core.server.AkkaHttpServer - Stopping server... 2023-01-21 12:36:50,503 shutdown-hooks-run-all ERROR No Log4j 2 configuration file found. Using default configuration (logging only errors to the console), or user programmatically provided configurations. Set system property 'log4j2.debug' to show Log4j 2 internal initialization logging. See https://logging.apache.org/log4j/2.x/manual/configuration.html for instructions on how to configure Log4j 2 [info] - akka.remote.RemoteActorRefProvider$RemotingTerminator - Shutting down remote daemon. [info] - akka.remote.RemoteActorRefProvider$RemotingTerminator - Remote daemon shut down; proceeding with flushing remote transports. [info] - akka.remote.Remoting - Remoting shut down [info] - akka.remote.RemoteActorRefProvider$RemotingTerminator - Remoting shut down.

with airline-data/src/main/resources/application.conf updated as per https://github.com/patsonluk/airline/commit/411cd59f8c882c76c1c7dd3e7d469fe5d775ed3b the "web" stays up when the simulation ticks over but the website never updates, looks like there is no communication between simulation and web SIM: [ERROR] [01/21/2023 12:43:00.019] [websocketActorSystem-akka.remote.default-remote-dispatcher-6] [akka://websocketActorSystem/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2Fairline-websocket-actor-system%40127.0.0.1%3A34619-0/endpointWriter] dropping message [class akka.actor.ActorSelectionMessage] for non-local recipient [Actor[akka.tcp://websocketActorSystem@127.0.0.1:2552/]] arriving at [akka.tcp://websocketActorSystem@127.0.0.1:2552] inbound addresses are [akka.tcp://websocketActorSystem@0.0.0.0:2552]

WEB: akka://airline-websocket-actor-system/user/local-main-actor resubscribe due to ping timeout akka://airline-websocket-actor-system/user/local-main-actor resubscribe due to ping timeout akka://airline-websocket-actor-system/user/local-main-actor resubscribe due to ping timeout akka://airline-websocket-actor-system/user/local-main-actor resubscribe due to ping timeout akka://airline-websocket-actor-system/user/local-main-actor resubscribe due to ping timeout

If I update airline-web/conf/application.conf and set airline.akka-actor.host="0.0.0.0:2552" to match the setting on the airline-data side, then the web can talk to the sim again (time updates, countdown to next cycle works again) but I'm back to teh web service crashing every time the cycle ticks over. Same error as above on the "web" side, see this on the "data" side: [WARN] [01/21/2023 12:54:53.148] [websocketActorSystem-akka.remote.default-remote-dispatcher-16] [akka.tcp://websocketActorSystem@0.0.0.0:2552/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2Fairline-websocket-actor-system%40127.0.0.1%3A46179-0] Association with remote system [akka.tcp://airline-websocket-actor-system@127.0.0.1:46179] has failed, address is now gated for [5000] ms. Reason: [Disassociated]

patsonluk commented 1 year ago

I think the socket is probably working okay. From the back trace it appears that it's triggered by

Caused by: java.lang.NullPointerException
at java.base/java.io.Reader.(Reader.java:167)
at java.base/java.io.InputStreamReader.(InputStreamReader.java:72)
at controllers.GooglePhotoUtil.getCredentials(GooglePhotoUtil.java:63)
at controllers.GooglePhotoUtil.loadBannerUrls(GooglePhotoUtil.java:111)
at controllers.GooglePhotoUtil.refreshBanners(GooglePhotoUtil.java:84)
at controllers.GooglePhotoUtil.(GooglePhotoUtil.java:51)

There's a google photo util that loads banner and i assume you don't have that set up (which is fine, as it was stated in README that banner should be disabled by default)

Should perform a check in LocalMainActor that if banner is disabled, it should not touch the GooglePhotoUtil 😓

patsonluk commented 1 year ago

Please pull the latest, should be fixed in https://github.com/patsonluk/airline/commit/dab32dbc071d5a104ed7f50e90c2739257351d19 !