ungoogled-software / ungoogled-chromium

Google Chromium, sans integration with Google
BSD 3-Clause "New" or "Revised" License
20.77k stars 842 forks source link

Minified React error #185 in Grafana when clicking on dropdown input fields #2389

Closed Bixilon closed 1 year ago

Bixilon commented 1 year ago

OS/Platform

Debian, Ubuntu, and derivatives

Installed

Flatpak

Version

Version 114.0.5735.106 (Official Build, ungoogled-chromium) (64-Bit)

Have you tested that this is not an upstream issue or an issue with your configuration?

Description

When clicking on a dropdown in grafana, react crashes

How to Reproduce?

See https://github.com/grafana/grafana/issues/69324, https://github.com/grafana/grafana/issues/69068 and https://github.com/Checkmk/grafana-checkmk-datasource/issues/194 for more details and screenshots.

Importantly, this only happens on ungoogled chromium. It might also be a react issue.

Actual behaviour

An unexpected error happened
Details
Error: Minified React error #185; visit https://reactjs.org/docs/error-decoder.html?invariant=185 for the full message or use the non-minified dev environment for full errors and additional helpful warnings.

    at div
    at https://grafana-assets.grafana.net/grafana/10.0.1-cloud.2.a7a20fbf/public/build/5226.8f8087951654808d35d8.js:1:710
    at Ri (https://grafana-assets.grafana.net/grafana/10.0.1-cloud.2.a7a20fbf/public/build/5226.8f8087951654808d35d8.js:206:98760)
    at div
    at https://grafana-assets.grafana.net/grafana/10.0.1-cloud.2.a7a20fbf/public/build/5226.8f8087951654808d35d8.js:1:710
    at Ra (https://grafana-assets.grafana.net/grafana/10.0.1-cloud.2.a7a20fbf/public/build/5226.8f8087951654808d35d8.js:206:100103)
    at S (https://grafana-assets.grafana.net/grafana/10.0.1-cloud.2.a7a20fbf/public/build/3175.d5d8c8ebc23682a510be.js:2539:670)
    at oe (https://grafana-assets.grafana.net/grafana/10.0.1-cloud.2.a7a20fbf/public/build/5226.8f8087951654808d35d8.js:206:48329)
    at https://grafana-assets.grafana.net/grafana/10.0.1-cloud.2.a7a20fbf/public/build/5226.8f8087951654808d35d8.js:209:17191
    at G (https://grafana-assets.grafana.net/grafana/10.0.1-cloud.2.a7a20fbf/public/build/3175.d5d8c8ebc23682a510be.js:2557:1698)
    at V
    at div
    at a (https://grafana-assets.grafana.net/grafana/10.0.1-cloud.2.a7a20fbf/public/build/3175.d5d8c8ebc23682a510be.js:5:34463)
    at div
    at div
    at nav
    at div
    at nav
    at https://grafana-assets.grafana.net/grafana/10.0.1-cloud.2.a7a20fbf/public/build/3175.d5d8c8ebc23682a510be.js:2402:1055
    at div
    at Wa (https://grafana-assets.grafana.net/grafana/10.0.1-cloud.2.a7a20fbf/public/build/7658.937005d2cd066a1708ff.js:563:742)
    at div
    at div
    at V (https://grafana-assets.grafana.net/grafana/10.0.1-cloud.2.a7a20fbf/public/build/5226.8f8087951654808d35d8.js:140:13278)
    at a (https://grafana-assets.grafana.net/grafana/10.0.1-cloud.2.a7a20fbf/public/build/3175.d5d8c8ebc23682a510be.js:518:3183)
    at Ch (https://grafana-assets.grafana.net/grafana/10.0.1-cloud.2.a7a20fbf/public/build/7658.937005d2cd066a1708ff.js:1241:153)
    at tn (https://grafana-assets.grafana.net/grafana/10.0.1-cloud.2.a7a20fbf/public/build/5226.8f8087951654808d35d8.js:175:120702)
    at WithTheme(Connect(Ch))
    at div
    at Is (https://grafana-assets.grafana.net/grafana/10.0.1-cloud.2.a7a20fbf/public/build/7658.937005d2cd066a1708ff.js:1250:57)
    at tn (https://grafana-assets.grafana.net/grafana/10.0.1-cloud.2.a7a20fbf/public/build/5226.8f8087951654808d35d8.js:175:120702)
    at WithTheme(Connect(Is))
    at f (https://grafana-assets.grafana.net/grafana/10.0.1-cloud.2.a7a20fbf/public/build/3175.d5d8c8ebc23682a510be.js:1320:180)
    at d (https://grafana-assets.grafana.net/grafana/10.0.1-cloud.2.a7a20fbf/public/build/3175.d5d8c8ebc23682a510be.js:1320:754)
    at div
    at r (https://grafana-assets.grafana.net/grafana/10.0.1-cloud.2.a7a20fbf/public/build/2060.bc8dca0113c3ef0872b8.js:1:2292)
    at div
    at r (https://grafana-assets.grafana.net/grafana/10.0.1-cloud.2.a7a20fbf/public/build/2060.bc8dca0113c3ef0872b8.js:1:4276)
    at C (https://grafana-assets.grafana.net/grafana/10.0.1-cloud.2.a7a20fbf/public/build/2060.bc8dca0113c3ef0872b8.js:1:9630)
    at div
    at cs (https://grafana-assets.grafana.net/grafana/10.0.1-cloud.2.a7a20fbf/public/build/7658.937005d2cd066a1708ff.js:1256:21)
    at Suspense
    at f (https://grafana-assets.grafana.net/grafana/10.0.1-cloud.2.a7a20fbf/public/build/3175.d5d8c8ebc23682a510be.js:1320:180)
    at Qs (https://grafana-assets.grafana.net/grafana/10.0.1-cloud.2.a7a20fbf/public/build/3175.d5d8c8ebc23682a510be.js:4463:333)
    at Ke (https://grafana-assets.grafana.net/grafana/10.0.1-cloud.2.a7a20fbf/public/build/5226.8f8087951654808d35d8.js:206:23585)
    at Ci (https://grafana-assets.grafana.net/grafana/10.0.1-cloud.2.a7a20fbf/public/build/5226.8f8087951654808d35d8.js:197:4727)
    at An (https://grafana-assets.grafana.net/grafana/10.0.1-cloud.2.a7a20fbf/public/build/5226.8f8087951654808d35d8.js:197:10217)
    at Do (https://grafana-assets.grafana.net/grafana/10.0.1-cloud.2.a7a20fbf/public/build/5226.8f8087951654808d35d8.js:206:11746)
    at Ke (https://grafana-assets.grafana.net/grafana/10.0.1-cloud.2.a7a20fbf/public/build/5226.8f8087951654808d35d8.js:206:25781)
    at div
    at div
    at div
    at main
    at nt (https://grafana-assets.grafana.net/grafana/10.0.1-cloud.2.a7a20fbf/public/build/3175.d5d8c8ebc23682a510be.js:4460:2460)
    at Ci (https://grafana-assets.grafana.net/grafana/10.0.1-cloud.2.a7a20fbf/public/build/5226.8f8087951654808d35d8.js:197:4727)
    at An (https://grafana-assets.grafana.net/grafana/10.0.1-cloud.2.a7a20fbf/public/build/5226.8f8087951654808d35d8.js:197:10217)
    at Tn (https://grafana-assets.grafana.net/grafana/10.0.1-cloud.2.a7a20fbf/public/build/5226.8f8087951654808d35d8.js:197:9607)
    at es (https://grafana-assets.grafana.net/grafana/10.0.1-cloud.2.a7a20fbf/public/build/5226.8f8087951654808d35d8.js:206:12045)
    at Ke (https://grafana-assets.grafana.net/grafana/10.0.1-cloud.2.a7a20fbf/public/build/5226.8f8087951654808d35d8.js:206:19753)
    at div
    at o (https://grafana-assets.grafana.net/grafana/10.0.1-cloud.2.a7a20fbf/public/build/3175.d5d8c8ebc23682a510be.js:2337:3973)
    at g (https://grafana-assets.grafana.net/grafana/10.0.1-cloud.2.a7a20fbf/public/build/5226.8f8087951654808d35d8.js:46:13846)
    at l (https://grafana-assets.grafana.net/grafana/10.0.1-cloud.2.a7a20fbf/public/build/3175.d5d8c8ebc23682a510be.js:5156:18867)
    at f (https://grafana-assets.grafana.net/grafana/10.0.1-cloud.2.a7a20fbf/public/build/3175.d5d8c8ebc23682a510be.js:1320:180)
    at d (https://grafana-assets.grafana.net/grafana/10.0.1-cloud.2.a7a20fbf/public/build/3175.d5d8c8ebc23682a510be.js:1320:754)
    at E (https://grafana-assets.grafana.net/grafana/10.0.1-cloud.2.a7a20fbf/public/build/5226.8f8087951654808d35d8.js:175:118397)
    at yr (https://grafana-assets.grafana.net/grafana/10.0.1-cloud.2.a7a20fbf/public/build/3175.d5d8c8ebc23682a510be.js:4474:127)

Expected behaviour

Not crashing

Relevant log output

No response

Additional context

You can go here https://play.grafana.org/explore?orgId=1&left=%7B%22datasource%22:%22000000001%22,%22queries%22:%5B%7B%22refId%22:%22A%22,%22datasource%22:%7B%22type%22:%22graphite%22,%22uid%22:%22000000001%22%7D%7D%5D,%22range%22:%7B%22from%22:%22now-1h%22,%22to%22:%22now%22%7D%7D and then click on the "Graphite" dropdown in the upper left corner to reproduce it.

PF4Public commented 1 year ago

The only way forward is to try reproducing this issue on a non-minified development version. Please do so.

Bixilon commented 1 year ago
Error: Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.

    at div
    at http://10.121.163.147:3000/public/build/app.70478c149d082bbd8cde.js:76:23
    at MenuPortal (http://10.121.163.147:3000/public/build/app.70478c149d082bbd8cde.js:303066:24)
    at div
    at http://10.121.163.147:3000/public/build/app.70478c149d082bbd8cde.js:76:23
    at SelectContainer (http://10.121.163.147:3000/public/build/app.70478c149d082bbd8cde.js:303155:24)
    at SelectContainer (http://10.121.163.147:3000/public/build/app.70478c149d082bbd8cde.js:69910:5)
    at Select (http://10.121.163.147:3000/public/build/app.70478c149d082bbd8cde.js:300908:90)
    at http://10.121.163.147:3000/public/build/app.70478c149d082bbd8cde.js:303854:92
    at SelectBase (http://10.121.163.147:3000/public/build/app.70478c149d082bbd8cde.js:69626:3)
    at Select
    at div
    at div
    at div
    at ConfigEditor (http://10.121.163.147:3000/public/build/influxdbPlugin.e57760bef06f6327388e.js:125:5)
    at div
    at DataSourcePluginSettings (http://10.121.163.147:3000/public/build/Connections.bc92a475741f9561fc8f.js:1456:5)
    at DataSourcePluginContextProvider (http://10.121.163.147:3000/public/build/app.70478c149d082bbd8cde.js:28092:11)
    at form
    at EditDataSourceView (http://10.121.163.147:3000/public/build/Connections.bc92a475741f9561fc8f.js:2069:3)
    at EditDataSource (http://10.121.163.147:3000/public/build/Connections.bc92a475741f9561fc8f.js:2036:27)
    at PageContents (http://10.121.163.147:3000/public/build/app.70478c149d082bbd8cde.js:93924:25)
    at div
    at div
    at div
    at div
    at Scrollbars (http://10.121.163.147:3000/public/build/app.70478c149d082bbd8cde.js:246823:9)
    at CustomScrollbar (http://10.121.163.147:3000/public/build/app.70478c149d082bbd8cde.js:52667:3)
    at div
    at Page (http://10.121.163.147:3000/public/build/app.70478c149d082bbd8cde.js:93825:3)
    at EditDataSourcePage (http://10.121.163.147:3000/public/build/Connections.bc92a475741f9561fc8f.js:400:78)
    at Route (http://10.121.163.147:3000/public/build/app.70478c149d082bbd8cde.js:299225:29)
    at Switch (http://10.121.163.147:3000/public/build/app.70478c149d082bbd8cde.js:299427:29)
    at Connections (http://10.121.163.147:3000/public/build/Connections.bc92a475741f9561fc8f.js:189:74)
    at Suspense
    at ErrorBoundary (http://10.121.163.147:3000/public/build/app.70478c149d082bbd8cde.js:58294:5)
    at GrafanaRoute (http://10.121.163.147:3000/public/build/app.70478c149d082bbd8cde.js:100538:102)
    at Route (http://10.121.163.147:3000/public/build/app.70478c149d082bbd8cde.js:299225:29)
    at RenderedRoute (http://10.121.163.147:3000/public/build/app.70478c149d082bbd8cde.js:297987:5)
    at Routes (http://10.121.163.147:3000/public/build/app.70478c149d082bbd8cde.js:298510:5)
    at CompatRoute (http://10.121.163.147:3000/public/build/app.70478c149d082bbd8cde.js:296797:5)
    at Switch (http://10.121.163.147:3000/public/build/app.70478c149d082bbd8cde.js:299427:29)
    at div
    at div
    at div
    at main
    at AppChrome (http://10.121.163.147:3000/public/build/app.70478c149d082bbd8cde.js:88263:22)
    at RenderedRoute (http://10.121.163.147:3000/public/build/app.70478c149d082bbd8cde.js:297987:5)
    at Routes (http://10.121.163.147:3000/public/build/app.70478c149d082bbd8cde.js:298510:5)
    at Router (http://10.121.163.147:3000/public/build/app.70478c149d082bbd8cde.js:298442:15)
    at CompatRouter (http://10.121.163.147:3000/public/build/app.70478c149d082bbd8cde.js:296813:5)
    at Router (http://10.121.163.147:3000/public/build/app.70478c149d082bbd8cde.js:298844:30)
    at div
    at ModalsProvider (http://10.121.163.147:3000/public/build/app.70478c149d082bbd8cde.js:66566:5)
    at KBarProvider (http://10.121.163.147:3000/public/build/app.70478c149d082bbd8cde.js:210526:48)
    at ThemeProvider (http://10.121.163.147:3000/public/build/app.70478c149d082bbd8cde.js:103900:26)
    at ErrorBoundary (http://10.121.163.147:3000/public/build/app.70478c149d082bbd8cde.js:58294:5)
    at ErrorBoundaryAlert (http://10.121.163.147:3000/public/build/app.70478c149d082bbd8cde.js:58333:1)
    at Provider (http://10.121.163.147:3000/public/build/app.70478c149d082bbd8cde.js:293435:20)
    at AppWrapper (http://10.121.163.147:3000/public/build/app.70478c149d082bbd8cde.js:87036:5)

(and it is not only happening for me)

PF4Public commented 1 year ago

Tja, ich verstehe nur Bahnhof! :(

Well, it didn't get any better. We need someone who better understands train station Grafana and React. 🤷

Bixilon commented 1 year ago

Ich auch :)

Maybe ungoogled chromium limits the stack size more or so?

jstkdng commented 1 year ago

Can't reproduce on arch, maybe the issue is related to the compiler flags/libraries used on the flatpak version.

networkException commented 1 year ago

I know that I've had this issue on Arch before

Bixilon commented 1 year ago

Its important to note that it only happens in most cases, not in all.

Bixilon commented 1 year ago

Its not only grafana specific, this is also happening on github.com (in the new code browser) after a while:

Error: Minified React error #185; visit https://reactjs.org/docs/error-decoder.html?invariant=185 for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
    at uJ (react-dom.production.min.js:266:249)
    at l1 (react-dom.production.min.js:174:247)
    at lZ (react-dom.production.min.js:174:55)
    at ut (react-dom.production.min.js:244:332)
    at ip (react-dom.production.min.js:286:111)
    at id (react-dom.production.min.js:283:409)
    at ic (react-dom.production.min.js:281:398)
    at u8 (react-dom.production.min.js:273:439)
    at av (react-dom.production.min.js:127:105)
    at ip (react-dom.production.min.js:286:247)

(just visit e.g. https://github.com/Bixilon/Minosoft/blob/work/pre-flattening/src/main/java/de/bixilon/minosoft/gui/rendering/font/provider/BitmapFontProvider.kt for a while)

rany2 commented 1 year ago

I can't actually reproduce this with UGC

PF4Public commented 1 year ago

@Bixilon Have you tried to actually reproduce this issue in an empty profile? (It would have been dishonest to just tick the checkbox in issue template!)

It looks like it has something to do with your (and mine) profile as I couldn't reproduce this issue in an empty profile, while on my normal profile it has a 100% reproducibility: image

Bixilon commented 1 year ago

Screenshot_20230617_201505

I tried it on the guest profile. The screenshot shows an completely empty/new profile created one minute ago.

I am honest.

PF4Public commented 1 year ago

@rany2 Does --user-data-dir work in Flatpak? How one could run ungoogled-chromium with empty profile?

rany2 commented 1 year ago

@PF4Public Yes it does, but you'll need to create the temporary folder inside the Flatpak's sandbox.

So something like flatpak run --command=bash com.github.Eloston.UngoogledChromium and then setting it up from within would work.

Bixilon commented 1 year ago

I tried it on the guest profile. The screenshot shows an completely empty/new profile created one minute ago.

I clicked on the icon in the top right corner and created a new profile

@rany2 Does --user-data-dir work in Flatpak? How one could run ungoogled-chromium with empty profile?

Is that different? Should I try it?

PF4Public commented 1 year ago

Oh, right, that must be a semantics problem and misunderstanding.

The profile in Chromium interface is a more high-level thing. What we usually understand under "profile" is the profile directory on your drive itself. Changing high-level profile does not change this low-level profile directory. Therefore in order to triage issues it is most useful to start Chromium with empty profile, which has no history, no bookmarks, no extensions and all flags are set by default. So, yeah, it is different.

You could try running ungoogled-chromium with empty folder as profile as rany2 suggested to confirm that the issue exists solely in profile, but I don't know if it would be easy to identify the actual reason for this failure in profile, especially more so if it is not a fault of ungoogled-chromium.

Bixilon commented 1 year ago

Ah, sorry. Did not know that. Maybe we can change the issue template to link to some wiki page that explains that.

I tried (basically wiped ~/.var/app/com.github.Eloston.UngoogledChromium) and it worked.

The profile was originally taken from chromium on a different device, then copied to my current laptop (all cookies were cleared). Maybe it is a migration issue?

PF4Public commented 1 year ago

Maybe we can change the issue template to link to some wiki page that explains that.

I think mentioning --user-data-dir should suffice.

Maybe it is a migration issue?

It can be anything. My desktop profile was taken from laptop, but both are bugged.

PF4Public commented 1 year ago

I hope your question(-s) has(-ve) been answered, otherwise please let us know. Closing this issue for now.

Bixilon commented 1 year ago

I hope your question(-s) has(-ve) been answered, otherwise please let us know.

I don't really see how it was answered. I mean creating a blank profile can not be the execuse/workaround for everything. I don't want to resetup, relogin, ... everywhere.

Shouldn't that be tackled down and fixed? I mean the exact same profile used to work (it is copied from there and still 100% in tact) in stock chromium.

networkException commented 1 year ago

Is there any differences in the flags you activated when comparing profiles (check in chrome://flags or chrome://version perhaps)?

Bixilon commented 1 year ago

Indeed. Looks like #fingerprinting-client-rects-noise is causing this crash.

PF4Public commented 1 year ago

@Bixilon This is exactly the reason why I've written earlier: "I don't know if it would be easy to identify the actual reason for this failure in profile, especially more so if it is not a fault of ungoogled-chromium".

On the other hand it looks suspicious why would react need to measure rects…

Bixilon commented 1 year ago

especially more so if it is not a fault of ungoogled-chromium".

Isn't that flag ungoogled chromium specific? Maybe something else breaks with that flag.

On the other hand it looks suspicious why would react need to measure rects…

Sure, that is. Not going to blame them still, it normall is a legit operation.

networkException commented 1 year ago

I'm not a frontend dev but I assume this code is causing the issues here.

It seems like Grafana is relying on the react-select package for some of their components. Some of those library components assume Element#getBoundingClientRect to behave in a predictable way (probably at least for very fast subsequent calls in which no user interaction could change the results). If this assumption is not met too often the maximum recursion depth is reached.

https://github.com/JedWatson/react-select/blob/a465818786afd4857c9155bef1e9aa2fe3356097/packages/react-select/src/components/Menu.tsx#L613-L640

Bixilon commented 1 year ago

Sounds resonable.

I think the option should just "randomize" it when the tab loads/reloads and not on every call (as described).

I tested it and that seems to work (go to pretty much any site, e.g. https://bixilon.de) and enter document.getElementsByTagName("img")[0].getBoundingClientRect(). It returns the same value and it only changes when pressing F5.

How can this be broken? Is react somehow instantiating multiple document classes? Is that even possible?

PF4Public commented 1 year ago

FWIW I've replaced fingerprinting patches with uazo's ones and can no longer reproduce this issue. At the same time fingerprinting protection is verified to be functioning.

anyone00 commented 1 year ago

Having the same issue with GitHub online editor

https://github.com/ungoogled-software/ungoogled-chromium/assets/41706133/78f51ea9-fe60-454b-b4af-4629db56de60

PF4Public commented 1 year ago

@anyone00 try disabling fingerprinting-client-rects-noise as mentioned above.

anyone00 commented 1 year ago

Indeed that fixes the issue 👍

anyone00 commented 1 year ago

FWIW I've replaced fingerprinting patches with uazo's ones and can no longer reproduce this issue. At the same time fingerprinting protection is verified to be functioning.

Do you plan to integrate that and replace the current one?

PF4Public commented 1 year ago

Do you plan to integrate that and replace the current one?

No

PF4Public commented 7 months ago

@Bixilon @anyone00 This issue might be fixed in https://github.com/ungoogled-software/ungoogled-chromium/pull/2790#issuecomment-2041211484

Bixilon commented 7 months ago

@PF4Public Whoo! Can't update atm, something is really broken with ungoogled chromium 123+ (can not see any content rendered). No time to investigate it yet (not sure if it is flatpak, chromium or ungoogled chromium). Might file a but in some days...

networkException commented 7 months ago

can not see any content rendered

try removing the various GPU caches from your chromium config directory

PF4Public commented 7 months ago

@Bixilon Please note that that PR was just merged and will be available only with the next version bump.

Bixilon commented 7 months ago

@PF4Public Yes, I know. Thanks

@networkException worked just fine! Thanks!