opensearch-project / OpenSearch-Dashboards

đź“Š Open source visualization dashboards for OpenSearch.
https://opensearch.org/docs/latest/dashboards/index/
Apache License 2.0
1.63k stars 849 forks source link

[BUG] Unable to use shared links when Store URLs in session storage is enabled #5588

Open albgus opened 8 months ago

albgus commented 8 months ago

Describe the bug The share links feature does not work when using the store URLs in session storage setting is enabled. This used to work with Kibana 7.x

Creating the shared link to a search appears to work, but when opening the link an error will be presented and the default discovery view will load instead, without any of the parameters that were supposed to be shared.

To Reproduce Steps to reproduce the behavior:

  1. Go to Dashboads management -> Advanced settings
  2. Enable Store URLs in session storage
  3. Go to the discover view and search for something.

Expected behavior Shared links should be saved with this feature enabled.

OpenSearch Version 2.11.0

Dashboards Version 2.11.0

Plugins

N/A

Stack trace

throwUnableToRestoreUrlError@https://opensearch.infra.euw1.i.example.com/6665/bundles/plugin/opensearchDashboardsUtils/opensearchDashboardsUtils.plugin.js:1:116617
retrieveState@https://opensearch.infra.euw1.i.example.com/6665/bundles/plugin/opensearchDashboardsUtils/opensearchDashboardsUtils.plugin.js:1:116887
decodeState@https://opensearch.infra.euw1.i.example.com/6665/bundles/plugin/opensearchDashboardsUtils/opensearchDashboardsUtils.plugin.js:1:117980
getStatesFromOsdUrl/<@https://opensearch.infra.euw1.i.example.com/6665/bundles/plugin/opensearchDashboardsUtils/opensearchDashboardsUtils.plugin.js:1:121054
getStatesFromOsdUrl@https://opensearch.infra.euw1.i.example.com/6665/bundles/plugin/opensearchDashboardsUtils/opensearchDashboardsUtils.plugin.js:1:121008
getStateFromOsdUrl@https://opensearch.infra.euw1.i.example.com/6665/bundles/plugin/opensearchDashboardsUtils/opensearchDashboardsUtils.plugin.js:1:121217
get@https://opensearch.infra.euw1.i.example.com/6665/bundles/plugin/opensearchDashboardsUtils/opensearchDashboardsUtils.plugin.js:1:128300
connectStorageToQueryState@https://opensearch.infra.euw1.i.example.com/6665/bundles/plugin/data/data.plugin.js:1:109931
TopNav@https://opensearch.infra.euw1.i.example.com/6665/bundles/plugin/discover/discover.chunk.4.js:1:42837
$i@https://opensearch.infra.euw1.i.example.com/6665/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:435:57931
gs@https://opensearch.infra.euw1.i.example.com/6665/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:435:104170
uc@https://opensearch.infra.euw1.i.example.com/6665/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:435:96720
sc@https://opensearch.infra.euw1.i.example.com/6665/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:435:96643
Qs@https://opensearch.infra.euw1.i.example.com/6665/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:435:93673
Vo/<@https://opensearch.infra.euw1.i.example.com/6665/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:435:45315
__osdSharedDeps__</t.unstable_runWithPriority@https://opensearch.infra.euw1.i.example.com/6665/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:443:3844
Xo@https://opensearch.infra.euw1.i.example.com/6665/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:435:45024
Vo@https://opensearch.infra.euw1.i.example.com/6665/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:435:45262
B@https://opensearch.infra.euw1.i.example.com/6665/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:443:2784
__osdSharedDeps__</y.port1.onmessage@https://opensearch.infra.euw1.i.example.com/6665/bundles/osd-ui-shared-deps/osd-ui-shared-deps.js:443:1540

Host/Environment (please complete the following information):

Additional context

Workaround for now is to disable Store URLs in session storage

kishor82 commented 8 months ago

@albgus , I attempted to replicate the issue but was unsuccessful. Could you please include screenshots for better clarity?

abbyhu2000 commented 5 months ago

Was able to reproduce this issue, and this bug still exists in 2.12.

https://github.com/opensearch-project/OpenSearch-Dashboards/assets/43937633/bfc2f220-3184-4750-aa5c-0f0a3162c070

ssantichaivekin commented 4 months ago

This solves the issue. It seems like AWS OSS enables this by default for some reason.

ananzh commented 2 months ago

Issue still persists in 2.15

jcolebrand commented 1 month ago

The URL can sometimes grow to be too large for some browsers to handle. To counter-act this we are testing if storing parts of the URL in session storage could help. Please let us know how it goes!

Assuming that this is a place to "let us know how it goes" I can confirm that with a fairly robust instance group on AWS, we fell victim to this setting as well, and it's not working as desired, as far as we can tell. It may be related to user perms on who is initiating the action, but we aren't well enough versed in the code internals to know for sure

Changing that setting to false did resolve our issue.

ashwin-pc commented 1 month ago

@ssantichaivekin @jcolebrand Is this setting on by default for you? As you can see in my screenshot below from 2.13 (also verified this in 2.15 and main, we never changed the default behaviour here. And if the user did change the setting, the default value for the field would still be visible. Can you provide an additional information you have about this issue? Do you see a default value as shown here? Screenshot 2024-07-09 at 9 59 23 AM