Skip to content

Ruler is not correctly returning 404 for missing rule groups #4012

Closed
@jtlisi

Description

@jtlisi

This line checks for an exact equivalence of a rule group. However, it does not work if the returned error is wrapped.

I tracked the regression back to this PR:

cortex/pkg/ruler/api.go

Lines 429 to 436 in 5501aa6

if err != nil {
if err == rulestore.ErrGroupNotFound {
http.Error(w, err.Error(), http.StatusNotFound)
return
}
http.Error(w, err.Error(), http.StatusBadRequest)
return
}

Since this will break behaviour for the cortextool or any rules client that depends on 404 behaviour on the get rule group endpoint, this may be worth fixing in master and 1.8.1.

cc/ @gouthamve @pracucci @pstibrany

Metadata

Metadata

Assignees

Labels

component/rulesBits & bobs todo with rules and alerts: the ruler, config service etc.type/bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions