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

bugfix: template: nil pointer dereference, e.g. if non-ASCII space #3854

Merged
merged 1 commit into from
Feb 17, 2018
Merged

bugfix: template: nil pointer dereference, e.g. if non-ASCII space #3854

merged 1 commit into from
Feb 17, 2018

Conversation

Dominik-K
Copy link
Contributor

If you have a non-ASCII space, e.g. the non-breaking space  , in a text template action, Prometheus returns as label/annotation value:

<error expanding template: runtime error: invalid memory address or nil pointer dereference>

The correct parsing error should be

error parsing template test: template: test:1: unexpected unrecognized character in action: U+00A0 in command

as the Go text/template lexer only accepts ASCII spaces \t\r\n.

A failure on Prometheus start resp. promtool check config for this would be good, as well.

@brian-brazil

@brian-brazil brian-brazil merged commit 67c13ba into prometheus:master Feb 17, 2018
@brian-brazil
Copy link
Contributor

Thanks!

#835 covers catching this sort of thing earlier.

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

Successfully merging this pull request may close these issues.

2 participants