Graylog2 / Graylog2/graylog2-server
Improve rule editor feedback for parse errors (reserved word)
- Dominant language
- Java
- Stars
- 8.1k
- Forks
- 1.1k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 217
Description
The pipeline rule editor silently fails when it encounters a reserved word.
## Expected Behavior
Editor should display an error message that identifies the offending variable and tells the user how to fix the problem.
Documentation should prominently highlight all syntax limitations, such as reserved words.
## Current Behavior
When the rule contains certain reserved words, the request `system/pipelines/rule/parse` fails with this 500 error:
`{"type":"ApiError","message":"Cannot invoke \"org.antlr.v4.runtime.Token.getText()\" because \"ctx.varName\" is null"}`
However, the editor does not surface this error. The only visible indication is that `create rule` and `update rule` buttons do nothing when clicked.
## Steps to Reproduce (for bugs)
Attempt to create a new pipeline rule with the following content:
```
rule "test"
when
true
then
let msg = "test";
let match = regex("(\\([^\\s]+\\))", msg);
end
```
Observe that you cannot save the rule, even though there is no error flag in the left margin.
Renaming `match` to e.g. `x` resolves the problem.
## Context
Rules are hard enough. Error states that do not give any actionable feedback are unacceptable. Users should not need to resort to trial and error to figure out what is causing a problem.
## Your Environment
* Graylog Version: 5.0
Contributor guide
Assessment
This issue has not been assessed yet.