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

loki_push_api does not like loki_alert_rules being an empty file. #98

Closed
PietroPasotti opened this issue Feb 18, 2022 · 2 comments · Fixed by #111
Closed

loki_push_api does not like loki_alert_rules being an empty file. #98

PietroPasotti opened this issue Feb 18, 2022 · 2 comments · Fixed by #111

Comments

@PietroPasotti
Copy link
Contributor

_is_official_alert_rule_format(rule_file)
raises an uncaught TypeError: argument of type 'NoneType' is not iterable
when loki_alert_rules is an empty file.

Is that a valid 'rules' file to begin with?
Either way, looks like we should return list() in _from_file even if the file is invalid/empty.

@PietroPasotti
Copy link
Contributor Author

note: underlying issue is that yaml.safe_load(stream) can and does return None in this case.

@Abuelodelanada
Copy link
Contributor

Thanks for the report Pietro!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants