Error restoring state from URL rison decoder error: missing ':'

Hi, since updated from 6.8.8 to 7.12.0, always get this message "Error restoring state from URL". I have used a scripted field as URL to link one dashboard to another.

See below for the URL (sample.com). I've verified with "preview results", looks good. However, it gave error when click the URL from dashboard.

"https://sample.com/app/dashboards#/view/592e3930-b33a-11ed-b979-9fc371e5aeba?_g=(filters:!())&_a=(description:'xxx%20Changes%20with%20Code%20and%20Actual%20Version',filters:!(('$state':(store:appState),meta:(alias:!n,disabled:!f,index:e62f85b0-c801-11ed-b979-9fc371e5aeba,key:updater_build_num,negate:!f,params:(query:doc['updater_build_num'].value),type:phrase),query:(match_phrase:(updater_build_num:doc['updater_build_num'].value)))),fullScreenMode:!f,options:(darkTheme:!f,hidePanelTitles:!f,useMargins:!t),query:(language:kuery,query:''),tags:!(),timeRestore:!t,title:'xxx%20xxx%20xxx%20Change%20Details',viewMode:view)"

It sounds to me like it's an issue with sanitizing URL from the scripted fields or with a missing escaped character in the scripted field. Can you try this?
Paste the correct url on a line in a text editor and then paste the wrong url that opens from the scripted field right underneath it. This will make it easier to spot any difference and that will hint towards the problem.

Here's the correct one. Appreciate your help. I couldn't spot any difference.

https://sample.com/app/dashboards#/view/592e3930-b33a-11ed-b979-9fc371e5aeba?_g=(filters:!())&_a=(description:'xxx%20Changes%20with%20Code%20and%20Actual%20Version',filters:!(('$state':(store:appState),meta:(alias:!n,disabled:!f,index:e62f85b0-c801-11ed-b979-9fc371e5aeba,key:updater_build_num,negate:!f,params:(query:34567),type:phrase),query:(match_phrase:(updater_build_num:34567)))),fullScreenMode:!f,options:(darkTheme:!f,hidePanelTitles:!f,useMargins:!t),query:(language:kuery,query:''),tags:!(),timeRestore:!t,title:'xxx%20xxx%20xxx%20Change%20Details',viewMode:view)

Here's the error details.

    at rison.parser.errcb [as errorHandler] (https://sample.com/39309/bundles/plugin/kibanaUtils/kibanaUtils.plugin.js:1:76189)
    at rison.parser.parse (https://sample.com/39309/bundles/plugin/kibanaUtils/kibanaUtils.plugin.js:1:76933)
    at rison.decode (https://sample.com/39309/bundles/plugin/kibanaUtils/kibanaUtils.plugin.js:1:76331)
    at decodeState (https://sample.com/39309/bundles/plugin/kibanaUtils/kibanaUtils.plugin.js:1:16760)
    at https://sample.com/39309/bundles/plugin/kibanaUtils/kibanaUtils.plugin.js:1:19629
    at Array.forEach (<anonymous>)
    at getStatesFromKbnUrl (https://sample.com/39309/bundles/plugin/kibanaUtils/kibanaUtils.plugin.js:1:19596)
    at getStateFromKbnUrl (https://sample.com/39309/bundles/plugin/kibanaUtils/kibanaUtils.plugin.js:1:19730)
    at Object.get (https://sample.com/39309/bundles/plugin/kibanaUtils/kibanaUtils.plugin.js:1:37075)
    at dashboard_state_manager_DashboardStateManager.getInitialViewMode (https://sample.com/39309/bundles/plugin/dashboard/dashboard.chunk.1.js:1:160550)

I see one difference between them, first one seems to have a scripted field in the query. Not sure how that would make it not work, but I'll try to reproduce this on my end. If you change the query to be the same, does it work?

You're right, that's the difference. The intention is to use document value (not hardcoded) in the URL.

The use case is to allow clicking the URL link from one dashboard and load another dashboard with value passed from selected document. Hence, doc['updater_build_num'].value replacing the hardcoded value 34567.

If I used the hardcoded value 34567 in the URL, it works.

Please advise, what's the correct expected syntax to pass document value to the URL (scripted field).

Can you try and use a runtime field instead of a scripted one there? It's not a common way of doing it so I am just exploring to see what works best for your situation.

Please educate me the runtime field use case. How does it different from scripted field. A pointer to some examples will be helpful.

@Marius_Dragomir I found this post and it is exactly the use case that I'd like to implement, pass multiple values from data table to the drilldown dashboard. Is this the right approach still?

I was able to resolve the issue using syntax below. And use "if (doc['updater_build_num'].size() == 0); return null" to handle the document that does not has the mentioned field.

"https://sample.com/app/dashboards#/view/592e3930-b33a-11ed-b979-9fc371e5aeba?_g=(filters:!())&_a=(description:'xxx%20Changes%20with%20Code%20and%20Actual%20Version',filters:!(('$state':(store:appState),meta:(alias:!n,disabled:!f,index:e62f85b0-c801-11ed-b979-9fc371e5aeba,key:updater_build_num,negate:!f,params:(query:"+doc['updater_build_num'].value+"),type:phrase),query:(match_phrase:(updater_build_num:"+doc['updater_build_num'].value+")))),fullScreenMode:!f,options:(darkTheme:!f,hidePanelTitles:!f,useMargins:!t),query:(language:kuery,query:''),tags:!(),timeRestore:!t,title:'xxx%20xxx%20xxx%20Change%20Details',viewMode:view)"
1 Like

The error message you're encountering, "Error restoring state from URL," typically occurs when there is an issue with the URL parameters or syntax in Kibana. In your case, it seems that the URL you provided contains complex query parameters and configuration settings.

Here are a few suggestions to troubleshoot and resolve the issue:

Verify URL syntax: Double-check the URL syntax to ensure that it is valid and properly formed. Make sure there are no missing or incorrect characters, and that all parentheses, brackets, and quotes are correctly balanced.

Simplify the URL: Temporarily remove or simplify the query parameters and configuration settings in the URL to isolate the issue. Test the URL without any filters or complex options to see if it works. If it does, gradually add back the components until you identify the specific part causing the problem.

Test URL parameters individually: If possible, test each URL parameter individually to identify if any specific parameter is causing the issue. This will help narrow down the problematic parameter and allow you to focus on troubleshooting that particular part.

Check compatibility with Kibana version: Ensure that the scripted field URL and its syntax are compatible with the Kibana version you are using (7.12.0). There might be changes in URL handling or query syntax between different versions of Kibana.

Review Kibana logs: Inspect the Kibana logs for any relevant error messages or warnings that could shed light on the issue. Look for any details about URL parsing or restoration errors that might provide insights into the problem.

Test the URL in a different environment: Try opening the URL in a different browser or on a different machine to see if the issue is specific to your current environment. This can help determine if there are any browser or network-related factors contributing to the error.

Consult Kibana documentation or community: Check the official Kibana documentation or reach out to the Kibana community or support team for specific guidance regarding complex URLs and syntax. They may have additional insights or suggestions to resolve the issue.

Remember to provide relevant details, such as the version of Kibana you are using, the complete error message, and any relevant logs, when seeking support. This information will help the support team or community members better understand the problem and provide appropriate solutions.

Please note that troubleshooting complex URLs and Kibana configurations may require deeper knowledge of your specific setup, so consulting official documentation or seeking support from the Kibana community is recommended for more precise assistance.

I hope these suggestions help you troubleshoot and resolve the "Error restoring state from URL" issue in Kibana.

Regards,
Rachel Gomez

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.