graylog2-server icon indicating copy to clipboard operation
graylog2-server copied to clipboard

Unknown Widget: aggregation error on different computers

Open r-duran opened this issue 5 years ago • 11 comments

I can create and view dashboards on my computer but any other team member can't view dashboards or create new one. We try same admin user on all computers but they all get errors about "Unknown Widget: aggregation" in the dashboard widgets.

Expected Behavior

It should work on other computers as well

Current Behavior

Ekran görüntüsü 2021-11-08 10-56-03

Possible Solution

Steps to Reproduce (for bugs)

  1. Use Turkish Windows and open "Sources Dashboard" in chrome. It will not work with Widget error. Change Chrome Language to English and restart Chrome, same dashboard works now.
  2. Use and English locale Linux distribution. Open "Sources Dashboard" in Chrome (default english language), it will work. Then close all chrome windows and open a linux terminal. execute command "export LANGUAGE=tr_TR", then execute command "google-chrome" from the same terminal window. Chrome will open in Trukish language. Open Graylog "Sources Dashboard" and it wont work with wdiget error.

Context

Your Environment

  • Graylog Version: 4.2.1
  • Java Version: OpenJDK Runtime Environment (build 11.0.13+8-post-Debian-1deb11u1)
  • Elasticsearch Version: 7.10.2
  • MongoDB Version: 5.0.3
  • Operating System: Debian 11
  • Browser version: Chrome 95.0.4638.69

r-duran avatar Nov 08 '21 11:11 r-duran

Hey @r-duran,

can you provide some steps how to reproduce this?

dennisoelkers avatar Nov 08 '21 12:11 dennisoelkers

Hi Dennis,

I am really lost here, very strange error indeed. It is not related only to dasboards we create. The problem also exist in the default "Sources" dasboard. I can open it without any error on my computer but no one can open it with admin same admin account on their computer. I can't open it too in Firefox in my computer but I can open it in konquerror (KDE default browser). When I search your github repo for error "Unfortunately we are not able to render this widget", I see that error comes from "graylog2-web-interface/src/views/components/widgets/UnknownWidget.tsx" file.

I also tried: stop graylog, drop mongodb database for graylog, start graylog to see if vanilla config has the issue. The same issue exists in "Sources" dashboard with vanilla config.

Any advice about what to try next?

r-duran avatar Nov 08 '21 13:11 r-duran

I'd suggest trying an older MongoDB version (e.g. 4.4, the newest version documented as supported @ https://docs.graylog.org/docs/installing#system-requirements).

coffee-squirrel avatar Nov 08 '21 13:11 coffee-squirrel

I'd suggest trying an older MongoDB version (e.g. 4.4, the newest version documented as supported @ https://docs.graylog.org/docs/installing#system-requirements).

I purged mongodb 5 and installed mongodb 4.4. Started Graylog service with vanilla db. Opened "sources" dashboard.

  • on my PC with Chrome, opens without any problem
  • on my PC with Konquerror, opens without any problem
  • on my PC with Firefox (78.15.0esr), widgets do not load with error "Unknown Widget: aggregation"
  • on Samsung smart phone with Samsung browser, opens without any problem
  • on Samsung smart phone with Chrome browser, widgets do not load with error "Unknown Widget: aggregation" Edit: tried on another Windows machice: Chrome, Opera, Edge browser widget error

r-duran avatar Nov 08 '21 14:11 r-duran

It might be best to continue troubleshooting this at https://community.graylog.org/ . Given things work fine in certain situations but not others, it seems likely that there's some sort of configuration/environment issue at play (rather than a bug in Graylog that'd need to be tracked here).

If you do choose to post a new topic there, select the "Graylog" category to get some default (useful for troubleshooting) content added to the message.

supahgreg avatar Nov 08 '21 15:11 supahgreg

Hi all,

It seems I found a common way to reproduce this. I tried Fedora Linux PC (English locale), both chrome and firefox works. Then tried Debian Linux PC (Turkish locale) both chrome and firefox have widget error. So I retired my windows 10 laptop (Turkish language) and changed chrome language with "chrome://settings/languages" to "English (US)", relaunched browser and reloaded "sources" dashboard. This fixed the widget error and I could view the dashboard. Then changed language back to "Turkish" in chrome, relaunced the browser and reloaded the dasboard and it is broken again with widget error.

I also found a similar topic about this issue: https://community.graylog.org/t/unknown-widget-aggregation-problem/18194 I guess he is also from Turkey (his name is Turkish name) so it should be a common problem?

Rahman

r-duran avatar Nov 08 '21 18:11 r-duran

Interesting. I get the same if I switch Firefox's language to Turkish and restart the browser. Just changing the "language for displaying pages" (resulting in the Accept-Language: tr request header being sent) is not enough.

Do you see a warning like the one below in your browser's console? Any other warnings/errors?

Warning: React does not recognize the `bsSize` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `bssize` instead. If you accidentally passed it from a parent component, remove it from the DOM element.
    in svg (created by FontAwesomeIcon)
    in FontAwesomeIcon (created by Icon)
    in Icon (created by UnknownWidget)
...

graylog_11596_bsSize_warning.txt

May or may not be related to https://mattryall.net/blog/the-infamous-turkish-locale-bug.

supahgreg avatar Nov 08 '21 20:11 supahgreg

Okay, so it does seem to be related to lowercase/uppercase conversions on the frontend. I did a direct search+replace (i.e. some may be incorrect) of the JavaScript lowercase/uppercase calls with versions that forced English (en) as the locale (e.g. str.toUpperCase() -> str.toLocaleUpperCase('en')), and verified dashboards showed up as expected. It looks like that's similar to what's being done on the backend (search results).

https://github.com/Graylog2/graylog2-server/compare/master...supahgreg:bugfix/frontend-force-english-locale?expand=1

Other stuff like capitalize from lodash might need to be addressed, as well.

supahgreg avatar Nov 08 '21 22:11 supahgreg

Console is too noisy (problably because live counter on the top-right) so I could not find errors.

Interesting. I get the same if I switch Firefox's language to Turkish and restart the browser. Just changing the "language for displaying pages" (resulting in the Accept-Language: tr request header being sent) is not enough.

Do you see a warning like the one below in your browser's console? Any other warnings/errors?

Warning: React does not recognize the `bsSize` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `bssize` instead. If you accidentally passed it from a parent component, remove it from the DOM element.
    in svg (created by FontAwesomeIcon)
    in FontAwesomeIcon (created by Icon)
    in Icon (created by UnknownWidget)
...

graylog_11596_bsSize_warning.txt

May or may not be related to https://mattryall.net/blog/the-infamous-turkish-locale-bug.

r-duran avatar Nov 09 '21 06:11 r-duran

Another way to reproduce if you have any English Linux distro.

  1. Use and English locale Linux distribution.
  2. Open "Sources Dashboard" in Chrome (default english language), it will work.
  3. Then close all chrome windows and open a linux terminal.
  4. Execute command "export LANGUAGE=tr_TR"
  5. Then execute command "google-chrome" from the same terminal window. Chrome will open in Trukish language.
  6. Open Graylog "Sources Dashboard" and it wont work with wdiget error.

r-duran avatar Nov 09 '21 06:11 r-duran

Okay, so it does seem to be related to lowercase/uppercase conversions on the frontend. I did a direct search+replace (i.e. some may be incorrect) of the JavaScript lowercase/uppercase calls with versions that forced English (en) as the locale (e.g. str.toUpperCase() -> str.toLocaleUpperCase('en')), and verified dashboards showed up as expected. It looks like that's similar to what's being done on the backend (search results).

https://github.com/Graylog2/graylog2-server/compare/master...supahgreg:bugfix/frontend-force-english-locale?expand=1

Other stuff like capitalize from lodash might need to be addressed, as well.

Thank you for your helps on this one. I hope they merge it and publish a quick bugfix release.

r-duran avatar Nov 09 '21 06:11 r-duran