# Elasticsearch watcher Error

**URL:** <https://discuss.elastic.co/t/elasticsearch-watcher-error/368562>\
**Category:** Elasticsearch\
**Tags:** dashboard\
**Created:** [October 9, 2024, 8:22pm UTC](https://discuss.elastic.co/t/elasticsearch-watcher-error/368562 "2024-10-09T20:22:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![0593098](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/0593098/32/133195_2.png) [@0593098](https://discuss.elastic.co/u/0593098)\
**Post date:** [October 9, 2024, 8:22pm UTC](https://discuss.elastic.co/t/elasticsearch-watcher-error/368562/1 "2024-10-09T20:22:25Z")

</div>

Below is my watcher code its simply to send report via email.

{  
"trigger": {  
"schedule": {  
"interval": "1m"  
}  
},  
"input": {  
"none": {}  
},  
"condition": {  
"always": {}  
},  
"actions": {  
"email\_admin": {  
"email": {  
"profile": "standard",  
"attachments": {  
"savedsearch.csv": {  
"reporting": {  
"url": "[https://qua.observability.dsv.com/s/edi/api/reporting/generate/csv\_searchsource?jobParams=(browserTimezone%3AAsia%2FCalcutta%2Ccolumns%3A!('%40timestamp'%2CSOURCE\_ID%2CTRANSACTION\_STATUS\_REASON%2CTRANSACTION\_STATUS%2CDOCUMENT\_TYPE)%2CobjectType%3Asearch%2CsearchSource%3A(fields%3A!((field%3A'%40timestamp'%2Cinclude\_unmapped%3Atrue)%2C(field%3ASOURCE\_ID%2Cinclude\_unmapped%3Atrue)%2C(field%3ATRANSACTION\_STATUS\_REASON%2Cinclude\_unmapped%3Atrue)%2C(field%3ATRANSACTION\_STATUS%2Cinclude\_unmapped%3Atrue)%2C(field%3ADOCUMENT\_TYPE%2Cinclude\_unmapped%3Atrue))%2Cfilter%3A!((meta%3A(field%3A'%40timestamp'%2Cindex%3A'29321186-ef40-4f37-b932-8308e234c04f'%2Cparams%3A())%2Cquery%3A(range%3A('%40timestamp'%3A(format%3Astrict\_date\_optional\_time%2Cgte%3Anow-24h%2Fh%2Clte%3Anow))))%2C('%24state'%3A(store%3AappState)%2Cmeta%3A(alias%3A!n%2Cdisabled%3A!f%2Cindex%3A'29321186-ef40-4f37-b932-8308e234c04f'%2Ckey%3ASOURCE\_ID%2Cnegate%3A!f%2Cparams%3A(query%3ASEPHORA)%2Ctype%3Aphrase)%2Cquery%3A(match\_phrase%3A(SOURCE\_ID%3ASEPHORA))))%2Cindex%3A'29321186-ef40-4f37-b932-8308e234c04f'%2Cquery%3A(language%3Akuery%2Cquery%3A'SOURCE\_ID.keyword%20%3A%20SEPHORA')%2Csort%3A!(('%40timestamp'%3A(format%3Astrict\_date\_optional\_time%2Corder%3Adesc))))%2Ctitle%3ASEPHORA%2Cversion%3A'8.13.4')](https://qua.observability.dsv.com/s/edi/api/reporting/generate/csv_searchsource?jobParams=%28browserTimezone%3AAsia%2FCalcutta%2Ccolumns%3A%21%28%27%40timestamp%27%2CSOURCE_ID%2CTRANSACTION_STATUS_REASON%2CTRANSACTION_STATUS%2CDOCUMENT_TYPE%29%2CobjectType%3Asearch%2CsearchSource%3A%28fields%3A%21%28%28field%3A%27%40timestamp%27%2Cinclude_unmapped%3Atrue%29%2C%28field%3ASOURCE_ID%2Cinclude_unmapped%3Atrue%29%2C%28field%3ATRANSACTION_STATUS_REASON%2Cinclude_unmapped%3Atrue%29%2C%28field%3ATRANSACTION_STATUS%2Cinclude_unmapped%3Atrue%29%2C%28field%3ADOCUMENT_TYPE%2Cinclude_unmapped%3Atrue%29%29%2Cfilter%3A%21%28%28meta%3A%28field%3A%27%40timestamp%27%2Cindex%3A%2729321186-ef40-4f37-b932-8308e234c04f%27%2Cparams%3A%28%29%29%2Cquery%3A%28range%3A%28%27%40timestamp%27%3A%28format%3Astrict_date_optional_time%2Cgte%3Anow-24h%2Fh%2Clte%3Anow%29%29%29%29%2C%28%27%24state%27%3A%28store%3AappState%29%2Cmeta%3A%28alias%3A%21n%2Cdisabled%3A%21f%2Cindex%3A%2729321186-ef40-4f37-b932-8308e234c04f%27%2Ckey%3ASOURCE_ID%2Cnegate%3A%21f%2Cparams%3A%28query%3ASEPHORA%29%2Ctype%3Aphrase%29%2Cquery%3A%28match_phrase%3A%28SOURCE_ID%3ASEPHORA%29%29%29%29%2Cindex%3A%2729321186-ef40-4f37-b932-8308e234c04f%27%2Cquery%3A%28language%3Akuery%2Cquery%3A%27SOURCE_ID.keyword%20%3A%20SEPHORA%27%29%2Csort%3A%21%28%28%27%40timestamp%27%3A%28format%3Astrict_date_optional_time%2Corder%3Adesc%29%29%29%29%2Ctitle%3ASEPHORA%2Cversion%3A%278.13.4%27%29)"  
}  
}  
},  
"to": [  
"[myemail@gmail.com](mailto:myemail@gmail.com)"  
],  
"subject": "Monitoring Report"  
}  
}  
}  
}

Getting below error :

"error": {  
"root\_cause": [  
{  
"type": "s\_s\_l\_handshake\_exception",  
"reason": "PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target"  
}  
],  
"type": "s\_s\_l\_handshake\_exception",  
"reason": "PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target",  
"caused\_by": {  
"type": "validator\_exception",  
"reason": "PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target",  
"caused\_by": {  
"type": "sun\_cert\_path\_builder\_exception",  
"reason": "unable to find valid certification path to requested target"

---

<div class="post-metadata">

**Author:** ![TimV](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timv/32/13162_2.png) [@TimV](https://discuss.elastic.co/u/TimV)\
**Post date:** [October 11, 2024, 2:20am UTC](https://discuss.elastic.co/t/elasticsearch-watcher-error/368562/2 "2024-10-11T02:20:45Z")

</div>

That indicates a certificate trust issue when making an outgoing connection, almost certainly the HTTPS connection to `https://qua.observability.dsv.com/`

There's a few different ways you could end up in that situation. The 2 most likely:

1. `https://qua.observability.dsv.com/` uses a certificate that is signed by a CA that is not trusted by your JVM.
2. You have configured `xpack.http.ssl.certifcate_authorities` or `xpack.http.ssl.truststore.path` to trust an explicit set of CA, and the CA for `https://qua.observability.dsv.com/` is not in that list.
