Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setup.dashboards.always_kibana doesn't work with Kibana 5.6 #6090

Closed
andrewkroh opened this issue Jan 17, 2018 · 2 comments
Closed

setup.dashboards.always_kibana doesn't work with Kibana 5.6 #6090

andrewkroh opened this issue Jan 17, 2018 · 2 comments

Comments

@andrewkroh
Copy link
Member

Attempts to use -E setup.dashboards.always_kibana=true with Kibana 5.6 always result in an error. This is the code in question:

// The response returned by /api/status is different in Kibana 5.x than in Kibana 6.x
err5x := json.Unmarshal(result, &kibanaVersion5x)
if err5x != nil {
return fmt.Errorf("fail to unmarshal the response from GET %s/api/status. Response: %s. Kibana 5.x status api returns: %v. Kibana 6.x status api returns: %v",
client.Connection.URL, truncateString(result), err5x, err)
}
client.version = kibanaVersion5x.Version
return fmt.Errorf("fail to unmarshal the response from GET %s/api/status: %v. Response: %s",
client.Connection.URL, err, truncateString(result))

After it successfully falls back to unmarshaling with the 5.x data type the code path always hits line 181 which is to return an error like the one below.

Exiting: Error importing Kibana dashboards: fail to create the Kibana loader: Error creating Kibana client: fail to get the Kibana version:fail to unmarshal the response from GET http://localhost:5601/api/status: json: cannot unmarshal string into Go struct field kibanaVersionResponse.version of type struct { Number string "json:\"number\""; Snapshot bool "json:\"build_snapshot\"" }. Response: {"name":"kibana","version":"5.6.6","buildNum":15605,"buildSha":"b67ac57661fc94df6ee476d0af6b3734211df61c","uuid":"25e5ec36-a8a6-4934-9010-5e78e2e345eb","status":{"overall":{"state":"green","title":"Green","nickname":"Looking good","icon":"success","s... (truncated)
@andrewkroh
Copy link
Member Author

@jdambly
Copy link

jdambly commented Jan 20, 2018

+1 I am also having this issue with metricbeat

ansible@sv5knfs04:~$ sudo metricbeat setup --dashboards -E setup.dashboards.always_kibana=true -E setup.dashboards.kibana_index=.kibana-5.x
Exiting: Error importing Kibana dashboards: fail to create the Kibana loader: Error creating Kibana client: fail to get the Kibana version:fail to unmarshal the response from GET http://kibana01.mgt.sv5.nskope.net:5601/api/status: json: cannot unmarshal string into Go struct field kibanaVersionResponse.version of type struct { Number string "json:\"number\""; Snapshot bool "json:\"build_snapshot\"" }. Response: {"name":"kibana01","version":"5.6.5","buildNum":15592,"buildSha":"80f98787eb860a4e7ef9b6500cf84b65e331d1fc","uuid":"dd391d64-8a93-4821-a09a-5ed999f4e38b","status":{"overall":{"state":"green","title":"Green","nickname":"Looking good","icon":"success",... (truncated)
ansible@sv5knfs04:~$

andrewkroh added a commit to andrewkroh/beats that referenced this issue Jan 30, 2018
In order to handle the different Kibana /api/status response formats in 5.x and 6.x the client attempts to parse it as 6.x and then falls back to the 5.x format on error. However if it was successful at parsing it was a 5.x response type is still always reported that an error had occurred.

Fixes elastic#6090
ruflin pushed a commit that referenced this issue Jan 31, 2018
In order to handle the different Kibana /api/status response formats in 5.x and 6.x the client attempts to parse it as 6.x and then falls back to the 5.x format on error. However if it was successful at parsing it was a 5.x response type is still always reported that an error had occurred.

Fixes #6090
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants