diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index 0627ac9ad5b5..8da58b43cc4e 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -47,6 +47,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d - Report faulting file when config reload fails. {pull}[11304]11304 - Fix a typo in libbeat/outputs/transport/client.go by updating `c.conn.LocalAddr()` to `c.conn.RemoteAddr()`. {pull}11242[11242] - Management configuration backup file will now have a timestamps in their name. {pull}11034[11034] +- Not hiding error in case of http failure using elastic fetcher {pull}11604[11604] - Relax validation of the X-Pack license UID value. {issue}11640[11640] - Fix a parsing error with the X-Pack license check on 32-bit system. {issue}11650[11650] - Fix ILM policy always being overwritten. {pull}11671[11671] diff --git a/x-pack/libbeat/licenser/elastic_fetcher.go b/x-pack/libbeat/licenser/elastic_fetcher.go index 520da3913937..57b0c118794c 100644 --- a/x-pack/libbeat/licenser/elastic_fetcher.go +++ b/x-pack/libbeat/licenser/elastic_fetcher.go @@ -124,14 +124,14 @@ func (f *ElasticFetcher) Fetch() (*License, error) { return nil, errors.New("unauthorized access, could not connect to the xpack endpoint, verify your credentials") } - if status != http.StatusOK { - return nil, fmt.Errorf("error from server, response code: %d", status) - } - if err != nil { return nil, errors.Wrap(err, "could not retrieve the license information from the cluster") } + if status != http.StatusOK { + return nil, fmt.Errorf("error from server, response code: %d", status) + } + license, err := f.parseJSON(body) if err != nil { f.log.Debugw("Invalid response from server", "body", string(body))