Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign uptargets.html: predefined escaper "html" disallowed in template (with go1.9rc2) #3046
Comments
brian-brazil
added
the
component/ui
label
Aug 9, 2017
This comment has been minimized.
This comment has been minimized.
|
I'm not sure the proposed fix is correct. Can you confirm it continues to correctly escape single and double quotes? |
This comment has been minimized.
This comment has been minimized.
|
As I've mentioned: This is a local hotfix to get it running and not a proposed correct fix. The tooltips look fine though. I'll try to create an escape test tomorrow. (I'm a little bit in a hurry right now.) |
This comment has been minimized.
This comment has been minimized.
|
@brian-brazil Okay, I've added these two extra labels to a server:
With the hotfix the labels are rendered correctly in the browser - both in the targets table and in the tooltip. The html page source looks like this:
LGTM. |
This comment has been minimized.
This comment has been minimized.
|
That looks fine, can you send a PR? |
This comment has been minimized.
This comment has been minimized.
|
Status update: I've now also tested the hotfix (on the I'll test the |
knweiss
referenced this issue
Aug 10, 2017
Merged
Fix 'predefined escaper "html" disallowed in template' (#3046) #3050
knweiss
added a commit
to knweiss/prometheus
that referenced
this issue
Aug 11, 2017
juliusv
added a commit
that referenced
this issue
Aug 11, 2017
brian-brazil
closed this
Aug 21, 2017
This comment has been minimized.
This comment has been minimized.
lock
bot
commented
Mar 23, 2019
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
knweiss commentedAug 9, 2017
What did you do?
I've tested prometheus 1.7.1 compiled with go1.9rc2.
What did you expect to see?
I wanted to open the usual "Targets" page in the web ui.
What did you see instead? Under which circumstances?
The "Targets" page now always shows the following error:
error executing template targets.html: html/template:targets.html:99:207: predefined escaper "html" disallowed in templateEnvironment
CentOS 7.3, x86-64, go1.9rc2 or go1.9rc1
This error seems to be related to a html/template fix in go1.9. Quoting the Go 1.9 Release Notes:
I was able to get it running again with this little hotfix (followed my
make assetsto rebuildweb/ui/bindata.go):However, I'm not familiar with the templating engine and someone should please determine the correct fix.
(Also, I haven't tested this hotfix with go1.8.3 yet!)