diff --git a/pkg/promtail/positions/positions.go b/pkg/promtail/positions/positions.go index b1e325e711d244519a4d39c69c1883450c964b6a..c1bbee74acd58071d0b8ce0a37048ccb1bdd7ce2 100644 --- a/pkg/promtail/positions/positions.go +++ b/pkg/promtail/positions/positions.go @@ -138,12 +138,11 @@ func (p *Positions) cleanup() { if os.IsNotExist(err) { // File no longer exists. toRemove = append(toRemove, k) - return + } else { + // Can't determine if file exists or not, some other error. + level.Warn(p.logger).Log("msg", "could not determine if log file "+ + "still exists while cleaning positions file", "error", err) } - // Can't determine if file exists or not, some other error. - level.Warn(p.logger).Log("msg", "could not determine if log file "+ - "still exists while cleaning positions file", "error", err) - } } for _, tr := range toRemove {