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

[Fix] Do not hide error on http failure #11604

Merged
merged 4 commits into from
Apr 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
8 changes: 4 additions & 4 deletions x-pack/libbeat/licenser/elastic_fetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down