graylog-labs / graylog2-web-interface

[DEPRECATED]
https://www.graylog.org/
612 stars 174 forks source link

Inputs section won't open due to Java Null pointer #820

Closed jacubillo closed 9 years ago

jacubillo commented 10 years ago

Freshly installed Graylog. When trying to open /system/inputs this error is received: "Oops, an error occured This exception has been logged with id 6ijohkiac. "

/var/log/graylog2-web.log show this:

! @6ijohkiac - Internal server error, for (GET) [/system/inputs] ->

play.api.Application$$anon$1: Execution exception[[NullPointerException: null]]
        at play.api.Application$class.handleError(Application.scala:293) ~[com.typesafe.play.play_2.10-2.2.2-RC1.jar:2.2.2-RC1]
        at play.api.DefaultApplication.handleError(Application.scala:399) [com.typesafe.play.play_2.10-2.2.2-RC1.jar:2.2.2-RC1]
        at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$2$$anonfun$applyOrElse$3.apply(PlayDefaultUpstreamHandler.scala:261) [com.typesafe.play.play_2.10-2.2.2-RC1.jar:2.2.2-RC1]
        at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$2$$anonfun$applyOrElse$3.apply(PlayDefaultUpstreamHandler.scala:261) [com.typesafe.play.play_2.10-2.2.2-RC1.jar:2.2.2-RC1]
        at scala.Option.map(Option.scala:145) [org.scala-lang.scala-library-2.10.3.jar:na]
        at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$2.applyOrElse(PlayDefaultUpstreamHandler.scala:261) [com.typesafe.play.play_2.10-2.2.2-RC1.jar:2.2.2-RC1]
Caused by: java.lang.NullPointerException: null
        at models.Node.getHostname(Node.java:351) ~[graylog2-web-interface.graylog2-web-interface-0.20.3.jar:0.20.3]
        at views.html.system.inputs.index$$anonfun$10$$anonfun$apply$2.apply(index.template.scala:124) ~[graylog2-web-interface.graylog2-web-interface-0.20.3.jar:0.20.3]
        at views.html.system.inputs.index$$anonfun$10$$anonfun$apply$2.apply(index.template.scala:123) ~[graylog2-web-interface.graylog2-web-interface-0.20.3.jar:0.20.3]
        at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244) ~[org.scala-lang.scala-library-2.10.3.jar:na]
        at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244) ~[org.scala-lang.scala-library-2.10.3.jar:na]
        at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59) ~[org.scala-lang.scala-library-2.10.3.jar:na]

Is this a graylog2-web bug? or a Java issue that may be solved?

kroepke commented 10 years ago

this sounds like a timeout issue, where the resulting object isn't checked for being non-null.

should be a transient problem, but it would be good to inspect the code for this pattern.

jacubillo commented 10 years ago

I found out the issue was solved by adding the hostname to /etc/hosts. Im not sure why but that allowed me to use Graylog normaly. Anyways, thnkz for;the help! Regards,

juan On Jul 3, 2014 3:46 AM, "Kay Roepke" notifications@github.com wrote:

this sounds like a timeout issue, where the resulting object isn't checked for being non-null.

should be a transient problem, but it would be good to inspect the code for this pattern.

— Reply to this email directly or view it on GitHub https://github.com/Graylog2/graylog2-web-interface/issues/820#issuecomment-47886797 .

kroepke commented 10 years ago

This really would need placeholder objects, but unfortunately the following code kind of expects actual objects, that have things like correct timezones and various strings filled out. The resulting pages would be basically useless.

Rather I would like to display a "timeout occurred" page, instead of having half-correct information on the page. Basically whenver an API request ran into a timeout we would display that page. Needs a little discussion.

dennisoelkers commented 10 years ago

As the user posting this issue was able to solve the problem on its own and we are looking for a more "general" solution to things like this, I am moving this back to 0.21.1 for now.

karthiklml commented 9 years ago

This issue has fixed ? Could you Please share the solutions i have added in /etc/hosts but still its not working ..

joschi commented 9 years ago

Trying a best-effort fall-back right now to prevent the NullPointerException. We're probably going to replace the REST client implementation in the foreseeable future with a more robust implementation.