Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

500 Error during add a new source with regex #277

Closed
leafchild0 opened this issue Nov 6, 2018 · 5 comments
Closed

500 Error during add a new source with regex #277

leafchild0 opened this issue Nov 6, 2018 · 5 comments

Comments

@leafchild0
Copy link

leafchild0 commented Nov 6, 2018

Wanted to add a new source with the regex for parsing. It may be related to bad regex, but still, 500 error is not informative. Here is my configuration:

1) Version: td-agent 1.2.6, fluent-ui 1.2.0.
2) OS: MacOs, Linux Debian
3) A new source in the configuration file

<source>
  @type tail
  tag webapp-parsed
  read_from_head true
  path /path-to-file.log
  pos_file /var/lib/fluentd/pos/tomcat-parsed.pos
  <parse>
    @type regexp
    expression /(?<time>[^ ]* [^ ]*) *(?<level>[^ ]*) *(?<thread>\[.*\]) *(?<class>[^ ]*) *(?<message>(.*[\s\S]))/
    time_format %Y-%d-%m %H:%M:%S
  </parse>
</source>

4) Example of the log message to parse
2018-11-06 15:07:31,940 INFO [Delayed executor] DelayedEngine:123 DelayedExecutor started...

5) How to reproduce
Try to use UI to add a new source, select a log file (create a dummy file with a message from point 4).
Select regex and add regex mentioned in point 3. Observe that data has been colored (it's a cool feature). Click next and observe error.

6) Error from fluent-ui logs

F, [2018-11-06T19:14:33.724464 #91986] FATAL -- : [7cdd8704-9acf-49e8-97de-0d06742dcf31]
F, [2018-11-06T19:14:33.724555 #91986] FATAL -- : [7cdd8704-9acf-49e8-97de-0d06742dcf31] ActionView::Template::Error (undefined method `assert_valid_value' for nil:NilClass):
F, [2018-11-06T19:14:33.724765 #91986] FATAL -- : [7cdd8704-9acf-49e8-97de-0d06742dcf31]     12:
[7cdd8704-9acf-49e8-97de-0d06742dcf31]     13: .form-group
[7cdd8704-9acf-49e8-97de-0d06742dcf31]     14:   %label= setting.parse_type
[7cdd8704-9acf-49e8-97de-0d06742dcf31]     15:   - parse_config = setting.create_parser
[7cdd8704-9acf-49e8-97de-0d06742dcf31]     16:   = hidden_field_tag("setting[parse[0]][type]", form.object.parse_type)
[7cdd8704-9acf-49e8-97de-0d06742dcf31]     17:   = form.fields("parse[0]", model: parse_config, builder: FluentdFormBuilder) do |f|
[7cdd8704-9acf-49e8-97de-0d06742dcf31]     18:     - f.object.common_options.each do |key|
F, [2018-11-06T19:14:33.724833 #91986] FATAL -- : [7cdd8704-9acf-49e8-97de-0d06742dcf31]
F, [2018-11-06T19:14:33.724866 #91986] FATAL -- : [7cdd8704-9acf-49e8-97de-0d06742dcf31] app/models/concerns/fluentd/setting/configurable.rb:31:in `initialize'

Please help to resolve the problem with either regex or setup of fluentd.

@okkez
Copy link
Contributor

okkez commented Nov 7, 2018

@leafchild0 Could you try #278 ?

@leafchild0
Copy link
Author

@okkez Thanks for the fix, built fluentd-ui with your PR, same error.

@okkez
Copy link
Contributor

okkez commented Nov 7, 2018

@leafchild0 Did you restart you fluentd-ui ?
On my environment, it works well with both development mode and production mode.

@leafchild0
Copy link
Author

@okkez Yes, I was using the built gem, then downloaded your PR and re-built everything. Then run the new version.
I guess your fix does the trick, but there may be something else there (i.e. error during regex parsing). I will double check it and let you know in a few days of testing.

@leafchild0
Copy link
Author

@okkez Was able to make it work with your fix. Thank you!
This issue can be closed and PR merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants