Hi All,

i'm getting same error as above as i'm trying to create custom template for 
email.
 Is there any solution available now?

*ERRO[16307] Notify for 1 alerts failed: Cancelling notify retry for 
"email" due to unrecoverable error: executing email html template: *

*html/template::1:48: no such template 
"/etc/alertmanager/template/email.tmpl" source="dispatch.go:261"*


Thanks


On Wednesday, August 2, 2017 at 8:17:20 PM UTC+5:30 dmitry.ryk...@gmail.com 
wrote:

> Raised an issue in the bugtracker - 
> https://github.com/prometheus/alertmanager/issues/936
>
>
> On Wednesday, August 2, 2017 at 4:33:11 PM UTC+3, Dmitry Rykov wrote:
>>
>> I tried so many times different configurations but no luck.
>>
>> The parser throws an error message when you modify -template clause and 
>> trying to place the full file name email.tmpl:
>>
>> INFO[183114] Loading configuration file                   
>>  file="./alertmanager.yml" source="main.go:221"
>> ERRO[183114] Loading configuration file failed: template: email.tmpl:1: 
>> unexpected <.> in define clause  file="./alertmanager.yml" 
>> source="main.go:224"
>>
>> But when it's removed then everything is fine.
>>
>> I will report a bug for the development team since I was researching the 
>> source code and found some bugs in it.
>>
>>
>> Thanks for your help anyway.
>>
>>
>> On Wednesday, August 2, 2017 at 3:30:40 PM UTC+3, Chandra Sekar K R wrote:
>>>
>>> The templates: section in alertmanager.yml does not point to email.tmpl (- 
>>> '/etc/alertmanager/template/.tmpl') file. Can you replace it with below 
>>> line & give it a try ?
>>>
>>> - /etc/alertmanager/template/email.tmpl
>>>
>>> On Wednesday, August 2, 2017 at 4:06:12 PM UTC+5:30, Dmitry Rykov wrote:
>>>>
>>>> Yes, I have attached yml config file and html template. Please check 
>>>> whether everything is correct. 
>>>>
>>>>
>>>>
>>>> On Tuesday, August 1, 2017 at 2:23:10 PM UTC+3, Chandra Sekar K R wrote:
>>>>>
>>>>> Can you paste/show the contents of your email.tmpl/email.html file and 
>>>>> alertmanager.yml configuration ? The alert manager error says it's not 
>>>>> able 
>>>>> to find email template.
>>>>>
>>>>> On Tuesday, August 1, 2017 at 3:24:42 PM UTC+5:30, Dmitry Rykov wrote:
>>>>>>
>>>>>> Hi Chandra,
>>>>>>
>>>>>> This is what I get from debug logging:
>>>>>>
>>>>>> *DEBU[12710] flushing 
>>>>>> [Average_CPU_Load_On_All_Cores[061858c][active]] 
>>>>>>  
>>>>>> aggrGroup={}/{service=~"^(?:^.*$)$"}:{alertname="Average_CPU_Load_On_All_Cores"}
>>>>>>  
>>>>>> source="dispatch.go:425"*
>>>>>> *DEBU[12710] Notify attempt 1 for "email.tmpl" failed: executing 
>>>>>> email html template: html/template::1:12: no such template "email.tmpl" 
>>>>>>  source="notify.go:585"*
>>>>>> *ERRO[12710] Error on notify: Cancelling notify retry for 
>>>>>> "email.tmpl" due to unrecoverable error: executing email html template: 
>>>>>> html/template::1:12: no such template "email.tmpl"  
>>>>>> source="notify.go:283"*
>>>>>>
>>>>>> I changed this file name into email.html and nothing helps. I set 
>>>>>> access rights to the folder where it resides to 777 and set the access 
>>>>>> rights to
>>>>>> this file as 777 as well and nothing helps. Still I can see an empty 
>>>>>> e-mail.
>>>>>>
>>>>>> I think this is a bug. The problem is that alert manager doesn't even 
>>>>>> find this template. If template would be incorrect then I would
>>>>>> see errors like you have a syntax error or bad character error as 
>>>>>> well. But I have never seen it which means the issue is in golang code. 
>>>>>> My 
>>>>>> template is correct and I'm able to open it in browser.
>>>>>> It doesn't even differ very much from a default html template only 
>>>>>> with background color and picture in it.
>>>>>>
>>>>>> I spent a lot of time trying to get this working. But nothing helps. 
>>>>>>
>>>>>>
>>>>>> Thanks.
>>>>>>
>>>>>> - Dmitry
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Tuesday, August 1, 2017 at 11:36:48 AM UTC+3, Chandra Sekar K R 
>>>>>> wrote:
>>>>>>>
>>>>>>> I have seen this behaviour with AlertManager and the blank messages 
>>>>>>> usually appear when the email template has errors in it. Can you please 
>>>>>>> run 
>>>>>>> the Alert Manager in DEBUG mode (using -log.level debug) and check. If 
>>>>>>> the 
>>>>>>> error is related to bad template, it would appear in the log messages.
>>>>>>>
>>>>>>>
>>>>>>> On Monday, July 31, 2017 at 4:23:53 PM UTC+5:30, Dmitry Rykov wrote:
>>>>>>>>
>>>>>>>> Hi Chandra,
>>>>>>>>
>>>>>>>> Thanks a lot for your help, but it still doesn't work although I 
>>>>>>>> performed all steps
>>>>>>>> you mentioned. Still I get an empty e-mail and when I open it via 
>>>>>>>> right-click I see
>>>>>>>> an empty email with email.txt file name on it.
>>>>>>>>
>>>>>>>> It looks like a bug in alertmanager source code.
>>>>>>>>
>>>>>>>>
>>>>>>>> Thanks.
>>>>>>>>
>>>>>>>>
>>>>>>>> On Friday, July 28, 2017 at 7:27:13 PM UTC+3, Dmitry Rykov wrote:
>>>>>>>>>
>>>>>>>>> Hi All,
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> I still cannot realize how I can apply my own custom html template 
>>>>>>>>> for e-mail alert in alert-manager config. Currently, I receive an 
>>>>>>>>> empty 
>>>>>>>>> e-mail alert.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Can you help me with that?
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> My current config alert-manager config:
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> html: '{{ define "email.tmpl" }} {{ end }}
>>>>>>>>> {{ template "email.tmpl" . }}'
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> I receive the following error although email.tmpl exists in that 
>>>>>>>>> folder.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> *ERRO[16307] Notify for 1 alerts failed: Cancelling notify retry 
>>>>>>>>> for "email" due to unrecoverable error: executing email html 
>>>>>>>>> template: *
>>>>>>>>>
>>>>>>>>> *html/template::1:48: no such template 
>>>>>>>>> "/etc/alertmanager/template/email.tmpl" source="dispatch.go:261"*
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Thanks in advance.
>>>>>>>>>
>>>>>>>>

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to prometheus-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/607fd752-2f43-43cf-be2e-947e583687c5n%40googlegroups.com.

Reply via email to