"error":{"type":"missing_references","references":[{"type":"search","id":"dfd3ea60-0154-11eb-8672-4ba31b1f4ee1"}]

Hi, I'm importing a dashboard from one kibana to another kibana, While importing I'm got the error "missing_references". Here dashboard having 8 visualizations. Here I have a doubt that, when importing the dashboard, the visualizations will import automatically? or do I need to import the visualizations separately? And could you pls help on the given error also. I'm providing curl commands, which I used for importing and error solving, and the dashboard JSON formate here.

Curl commds: curl -X POST -u elastic:passwrd "http://node1:5601/s/padma/api/saved_objects/_import" -H "kbn-xsrf: true" --form file=@file.ndjson

curl -X POST -u elastic:passwrd http://node1:5601/s/padma/api/saved_objects/_resolve_import_errors -H "kbn-xsrf: true" --form file=@file.ndjson --form retries='[{"type":"dashboard","id":"2fd2f580-0153-11eb-8672-4ba31b1f4ee0","overwrite":true}]'

   {
  "attributes":{
     "description":"",
     "hits":0,
     "kibanaSavedObjectMeta":{
        "searchSourceJSON":"{\"query\":{\"language\":\"kuery\",\"query\":\"\"},\"filter\":[]}"
     },
     "optionsJSON":"{\"hidePanelTitles\":false,\"useMargins\":true}",
     "panelsJSON":"[{\"embeddableConfig\":{},\"gridData\":{\"x\":0,\"y\":12,\"w\":24,\"h\":13,\"i\":\"1\"},\"panelIndex\":\"1\",\"version\":\"7.2.1\",\"panelRefName\":\"panel_0\"},{\"embeddableConfig\":{},\"gridData\":{\"x\":33,\"y\":0,\"w\":15,\"h\":12,\"i\":\"2\"},\"panelIndex\":\"2\",\"version\":\"7.2.1\",\"panelRefName\":\"panel_1\"},{\"embeddableConfig\":{},\"gridData\":{\"x\":0,\"y\":40,\"w\":25,\"h\":11,\"i\":\"3\"},\"panelIndex\":\"3\",\"version\":\"7.2.1\",\"panelRefName\":\"panel_2\"},{\"embeddableConfig\":{},\"gridData\":{\"x\":24,\"y\":12,\"w\":24,\"h\":13,\"i\":\"4\"},\"panelIndex\":\"4\",\"version\":\"7.2.1\",\"panelRefName\":\"panel_3\"},{\"embeddableConfig\":{},\"gridData\":{\"x\":0,\"y\":0,\"w\":33,\"h\":12,\"i\":\"5\"},\"panelIndex\":\"5\",\"version\":\"7.2.1\",\"panelRefName\":\"panel_4\"},{\"embeddableConfig\":{},\"gridData\":{\"x\":25,\"y\":40,\"w\":23,\"h\":11,\"i\":\"6\"},\"panelIndex\":\"6\",\"version\":\"7.2.1\",\"panelRefName\":\"panel_5\"},{\"embeddableConfig\":{\"columns\":[]},\"gridData\":{\"x\":0,\"y\":51,\"w\":48,\"h\":13,\"i\":\"7\"},\"panelIndex\":\"7\",\"version\":\"7.2.1\",\"panelRefName\":\"panel_6\"},{\"embeddableConfig\":{},\"gridData\":{\"x\":0,\"y\":25,\"w\":48,\"h\":15,\"i\":\"8\"},\"panelIndex\":\"8\",\"version\":\"7.2.1\",\"panelRefName\":\"panel_7\"}]",
     "timeRestore":false,
     "title":"Fortigate Dashboard",
     "version":1
  },
  "id":"2fd2f580-0153-11eb-8672-4ba31b1f4ee0",
  "migrationVersion":{
     "dashboard":"7.0.0"
  },
  "references":[
     {
        "id":"6c4c9580-014d-11eb-8672-4ba31b1f4ee1",
        "name":"panel_0",
        "type":"visualization"
     },
     {
        "id":"34b13e40-014e-11eb-8672-4ba31b1f4ee1",
        "name":"panel_1",
        "type":"visualization"
     },
     {
        "id":"9e9bc3d0-014d-11eb-8672-4ba31b1f4ee1",
        "name":"panel_2",
        "type":"visualization"
     },
     {
        "id":"c08c5030-014e-11eb-8672-4ba31b1f4ee1",
        "name":"panel_3",
        "type":"visualization"
     },
     {
        "id":"2e875820-0152-11eb-8672-4ba31b1f4ee1",
        "name":"panel_4",
        "type":"visualization"
     },
     {
        "id":"fa0b6950-0152-11eb-8672-4ba31b1f4ee1",
        "name":"panel_5",
        "type":"visualization"
     },
     {
        "id":"dfd3ea60-0154-11eb-8672-4ba31b1f4ee1",
        "name":"panel_6",
        "type":"search"
     },
     {
        "id":"b2302640-0155-11eb-8672-4ba31b1f4ee1",
        "name":"panel_7",
        "type":"visualization"
     }
  ],
  "type":"dashboard",
  "updated_at":"2020-09-28T07:42:16.862Z",
  "version":"WzIzNTUzLDIyMF0="
}```

Yes, the dashboard requires the visualizations to be imported ahead of time or as part of the same request. You have two options for how to export the dashboard in the right format:

  1. Use the dashboard export API https://www.elastic.co/guide/en/kibana/current/dashboard-api-export.html
  2. Set the includeReferencesDeep flag on the saved object export API https://www.elastic.co/guide/en/kibana/current/saved-objects-api-export.html

I have exported the dashboard using this API

curl -X POST -u elastic:passwrd http://node1:5601/s/padma/api/saved_objects/_export -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d '
{
"objects": [
{
"type": "dashboard",
"id": "2fd2f580-0153-11eb-8672-4ba31b1f4ee0"
}
]
}'
and in kibana dashboards I'm seeing the proper visualizations, i understand that the visualizations are not imported properly, what could be the reason for this? I'm seeing visualization error "could not located the index-pattern-id". what is this error meaning? i changed the index-pattern here(previously adcesf-fortigate-* , I changed to cte-fortigate-*), because of this error came?

Changing the index is a problem, yes. Here's one way to do it Change visualization index under saved objects

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