Skip to content

Commit

Permalink
Change the wording on the Licenser.Enforce when the endpoint is not r…
Browse files Browse the repository at this point in the history
…eachable. (elastic#13771)

* Change the wording on the Licenser.Enforce when the endpoint is not
reachable.

The original wrapped errors did not make it clear what was our intend to
call the _xpack api.
  • Loading branch information
ph authored Oct 2, 2019
1 parent 1792d6b commit cda40ae
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
- Fix mapping for kubernetes.labels and kubernetes.annotations in add_kubernetes_metadata. {issue}12638[12638] {pull}13226[13226]
- Fix case insensitive regular expressions not working correctly. {pull}13250[13250]
- Disable `add_kubernetes_metadata` if no matchers found. {pull}13709[13709]
- Better wording for xpack beats when the _xpack endpoint is not reachable. {pull}13771[13771]
- Recover from panics in the javascript process and log details about the failure to aid in future debugging. {pull}13690[13690]

*Auditbeat*

- Process dataset: Fixed a memory leak under Windows. {pull}12100[12100]
Expand Down
7 changes: 6 additions & 1 deletion x-pack/libbeat/licenser/es_callback.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package licenser

import (
"fmt"
"strings"

"github.com/pkg/errors"

Expand All @@ -16,12 +17,16 @@ import (
// Enforce setups the corresponding callbacks in libbeat to verify the license on the
// remote elasticsearch cluster.
func Enforce(log *logp.Logger, name string, checks ...CheckFunc) {
name = strings.Title(name)

cb := func(client *elasticsearch.Client) error {
fetcher := NewElasticFetcher(client)
license, err := fetcher.Fetch()

if err != nil {
return errors.Wrapf(err, "cannot retrieve the elasticsearch license")
return errors.Wrapf(err, "cannot retrieve the elasticsearch license from the /_xpack endpoint, "+
"%s requires the default distribution of Elasticsearch. Please make the endpoint accessible "+
"to %s so it can verify the license.", name, name)
}

if license == OSSLicense {
Expand Down

0 comments on commit cda40ae

Please sign in to comment.