Graylog2 / Graylog2/graylog2-server

Metric undefined under high load leads to error page

Open
#7,673 0 comments 0 reactions 0 assignees View on GitHub
bug triaged
Dominant language
Java
Stars
8.1k
Forks
1.1k
Avg merge
1d 20h
Merged PRs (30d)
217

Description

## Expected Behavior
Even if a metric is undefined, the UI should catch the error and not go to the fallback error page.

## Current Behavior
The server seemed to have missed responding with a metric and the UI code, in this case on the System/Nodes detail page, ended up with an undefined value and crashed.

![image](https://user-images.githubusercontent.com/52014/76520283-ea60b380-6462-11ea-8944-cbf2de32ad21.png)

Stacktrace:

```
Cannot read property 'org.graylog2.buffers.input.usage' of undefined

Stack Trace:

TypeError: Cannot read property 'org.graylog2.buffers.input.usage' of undefined
at t.render (http://127.0.0.1:9000/assets/app.14963c994440e94bd8e6.js:68:415751)
at go (http://127.0.0.1:9000/assets/vendor.5452e7a2fdfb6282da0a.js:18:65535)
at yo (http://127.0.0.1:9000/assets/vendor.5452e7a2fdfb6282da0a.js:18:65330)
at Qs (http://127.0.0.1:9000/assets/vendor.5452e7a2fdfb6282da0a.js:18:99620)
at Is (http://127.0.0.1:9000/assets/vendor.5452e7a2fdfb6282da0a.js:18:83906)
at Rs (http://127.0.0.1:9000/assets/vendor.5452e7a2fdfb6282da0a.js:18:80933)
at Ps (http://127.0.0.1:9000/assets/vendor.5452e7a2fdfb6282da0a.js:18:79506)
at http://127.0.0.1:9000/assets/vendor.5452e7a2fdfb6282da0a.js:18:41771
at exports.unstable_runWithPriority (http://127.0.0.1:9000/assets/vendor.5452e7a2fdfb6282da0a.js:42:3998)
at fi (http://127.0.0.1:9000/assets/vendor.5452e7a2fdfb6282da0a.js:18:41500)
at _i (http://127.0.0.1:9000/assets/vendor.5452e7a2fdfb6282da0a.js:18:41717)
at mi (http://127.0.0.1:9000/assets/vendor.5452e7a2fdfb6282da0a.js:18:41652)
at Ds (http://127.0.0.1:9000/assets/vendor.5452e7a2fdfb6282da0a.js:18:78497)
at Object.enqueueSetState (http://127.0.0.1:9000/assets/vendor.5452e7a2fdfb6282da0a.js:18:46463)
at t.b.setState (http://127.0.0.1:9000/assets/vendor.5452e7a2fdfb6282da0a.js:26:1438)
at a.n (http://127.0.0.1:9000/assets/vendor.5452e7a2fdfb6282da0a.js:10:1594)
at a.emit (http://127.0.0.1:9000/assets/vendor.5452e7a2fdfb6282da0a.js:78:244340)
at f.trigger (http://127.0.0.1:9000/assets/vendor.5452e7a2fdfb6282da0a.js:10:2469)
at http://127.0.0.1:9000/assets/builtins.14963c994440e94bd8e6.js:76:111552
at l (http://127.0.0.1:9000/assets/builtins.14963c994440e94bd8e6.js:76:90514)
at O._settlePromiseFromHandler (http://127.0.0.1:9000/assets/builtins.14963c994440e94bd8e6.js:76:63769)
at O._settlePromise (http://127.0.0.1:9000/assets/builtins.14963c994440e94bd8e6.js:76:64569)
at O._settlePromise0 (http://127.0.0.1:9000/assets/builtins.14963c994440e94bd8e6.js:76:65268)
at O._settlePromises (http://127.0.0.1:9000/assets/builtins.14963c994440e94bd8e6.js:76:66595)
at http://127.0.0.1:9000/assets/builtins.14963c994440e94bd8e6.js:76:20215

Component Stack:

in BufferUsage
in div
in t
in div
in t
in div
in t
in div
in t
in div
in t
in div
in t
in ShowNodePage
in n
in div
in t
in div
in t
in div
in l
in div
in i
in t
in withRouter(t)
in c
in d
in ConnectStoresWrapper[d] stores=currentUser
in t
in withRouter(t)
in RouterContext
in Router
in m
in t
in n
in t
in c
in AppFacade
```

## Possible Solution
Unclear, probably an undefined check missing when handling the server response.

## Steps to Reproduce (for bugs)
Probably difficult, in this case the server was under high load (400k messages in journal, with processing on a relatively slow machine).

1. Put server under high load.
2. Keep UI open on System/Node detail page.
3. Occasionally the above error happens.

## Context
The error looks very important, but really all that happened was that the server didn't respond in time for a metric. The UI should probably just ignore that metric update then.

## Your Environment

* Graylog Version: 3.2.3
* Elasticsearch Version: 6.8
* Browser version: Chrome, but seems unrelated

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.