Graylog2 / Graylog2/graylog2-server

Adding New Stream Rule fails with validation error

Open
#5,486 1 comment 0 reactions 0 assignees View on GitHub
to-verify
Dominant language
Java
Stars
8.1k
Forks
1.1k
Avg merge
1d 20h
Merged PRs (30d)
217

Description

Issue is happening while trying to add new or edit existing stream rule on cluster with large number of fields.
Form doesn't submit value of a field "field" if it's populated while AJAX GET request is still pending to fetch list of all fields in the cluster.

Receiving this error notification
> Could not create Stream Rule
> Creating Stream Rule failed with status: Error: cannot POST https://\/api/streams/\/rules (400)

## Expected Behavior
Form should recheck field value before sending and wait if AJAX is still pending.

## Current Behavior
Form sends empty value in POST request on form submit and API returns HTTP 400 with validation error:
`{"type":"ValidationApiError","message":"Validation failed!","validation_errors":{"field":[{"error":"Value \"\" is not a valid non-empty String!"}]}}`

## Steps to Reproduce (for bugs)
1. Open the "Streams" page
2. Select "Manage Rules" for any Stream
3. Select "Add stream rule"
4. Type full name of any field, e.g. "source" (focus should be moved away from this field while AJAX is in pending state)
5. Type anything in value
6. Click Save

## Context
Trying to add new rule to existing Stream.

## Your Environment

* Graylog Version: 2.4.6+ceaa7e4
* Elasticsearch Version: 5.6.11+bc3eef4
* MongoDB Version: 3.4.18
* Operating System: Debian
* Browser version: Chrome 71.0.3578.98

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.