OpenSearch-Dashboards
OpenSearch-Dashboards copied to clipboard
[BUG] Startup fails with theme overrides
Describe the bug
A clear and concise description of what the bug is.
To Reproduce Steps to reproduce the behavior:
- Go to '...'
- Click on '....'
- Scroll down to '....'
- See error
Expected behavior A clear and concise description of what you expected to happen.
OpenSearch Version Please list the version of OpenSearch being used.
Dashboards Version Please list the version of OpenSearch Dashboards being used.
Plugins
Please list all plugins currently enabled.
Screenshots
If applicable, add screenshots to help explain your problem.
Host/Environment (please complete the following information):
- OS: [e.g. iOS]
- Browser and version [e.g. 22]
Additional context
Add any other context about the problem here.
checkout a commit older than this PR would resolve thus narrow down to this PR https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5652
Different from the screen recording in the PR https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6703
The dashboard in future playground won't display anything
Found issue still happening, thus re-opened
@BionIT Can you provide some repro details? If I visit https://future.playground.opensearch.org, this is what I see
Yep, @joshuarrrr this is after switching to an older commit than the PR which introduced the bug, otherwise, we see empty page. Please check future playground for the empty page and error now.
I just need more info to be able to debug it, so if there was a version that included https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6703 and https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5652, that would be really helpful, because it doesn't repro running locally. I can also provide some additional context:
The issue is likely not in /bootstrap.js (source: https://github.com/opensearch-project/OpenSearch-Dashboards/blob/main/src/legacy/ui/ui_render/bootstrap/bootstrap.js.hbs ), despite that being the failure point. To start up correctly, that application requires /startup.js ( source: https://github.com/opensearch-project/OpenSearch-Dashboards/blob/main/src/legacy/ui/ui_render/bootstrap/startup.js.hbs )to successfully load and execute first. You can see in the console that startup.js failed on an unexpected token on L15: https://github.com/opensearch-project/OpenSearch-Dashboards/blob/main/src/legacy/ui/ui_render/bootstrap/startup.js.hbs#L15
That means that there's likely an issue with this block of code:
https://github.com/opensearch-project/OpenSearch-Dashboards/blob/b5121d37a66f067148056ca9a404634f3a682f94/src/legacy/ui/ui_render/ui_render_mixin.js#L174-L177
which wasn't edited, but moved in https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5652
@BionIT same question here, is there a way to reproduce locally or could you help to add some repro steps?
To repro:
- add the commit, see empty page and error in future playground
- remove the commit, OSD bootstraps correctly in playground
I don't have bandwidth to look further, and I wonder if the change would behave different when it is in container?
i think cache issue. that supercedes the cache buster for plugins.
2.13 navigate to playground/app/plugin HTML dom gets loaded with only reference to script bootstrap HTML dom downloads new bootstrap script due to cache busting mechanism bootstrap statically sets that window osdThemeTag
2.14 navigate to playground/app/plugin HTML dom gets loaded from cache since visiting again. but it only has the reference to bootstrap, and does not include startup.js HTML dom downloads new bootstrap script due to cache busting mechanism bootstrap expected startup.js to be downloaded and ran to set that global window value. get undefined exception
expected: HTML dom gets loaded with both startup and bootstrap.
tbh i'm not sure if this normal issue or something special about docker's caching optimization. we could consider just adding a default value to that osdThemeTag in bootstrap if window.osdThemeTag is undefined. @joshuarrrr @ananzh.
reverted in 2.14 in 2.x as @joshuarrrr is addressing existing issue that got exposed by this work but not from this work.
@joshuarrrr Do we still target this fix for 2.15 or 2.16?