I'm following the documentation here to create a watcher to automate some weekly reports. When I try to simulate the watcher I get the following error:
{
"watch_id": "_inlined_",
"node": "gdVCszd8SaO5-xSmFM2Gsw",
"state": "executed",
"user": "1251094200",
"status": {
"state": {
"active": true,
"timestamp": "2023-10-25T17:07:20.027Z"
},
"last_checked": "2023-10-25T17:07:20.027Z",
"last_met_condition": "2023-10-25T17:07:20.027Z",
"actions": {
"email_admin": {
"ack": {
"timestamp": "2023-10-25T17:07:20.027Z",
"state": "awaits_successful_execution"
},
"last_execution": {
"timestamp": "2023-10-25T17:07:20.027Z",
"successful": false,
"reason": ""
}
}
},
"execution_state": "executed",
"version": -1
},
"trigger_event": {
"type": "manual",
"triggered_time": "2023-10-25T17:07:20.027Z",
"manual": {
"schedule": {
"scheduled_time": "2023-10-25T17:07:20.027Z"
}
}
},
"input": {
"none": {}
},
"condition": {
"always": {}
},
"metadata": {
"name": "Weekly Error PDF",
"xpack": {
"type": "json"
}
},
"result": {
"execution_time": "2023-10-25T17:07:20.027Z",
"execution_duration": 22,
"input": {
"type": "none",
"status": "success",
"payload": {}
},
"condition": {
"type": "always",
"status": "success",
"met": true
},
"actions": [
{
"id": "email_admin",
"type": "email",
"status": "failure",
"error": {
"root_cause": [
{
"type": "exception",
"reason": "Watch[_inlined_] reporting[error_report.pdf] Error response when trying to trigger reporting generation host[healthsnap-blue-audit.kb.us-east-1.aws.found.io], port[9243] method[POST], path[/api/reporting/generate/printablePdfV2], response[status=[403], headers=[[date: [Wed, 25 Oct 2023 17:07:20 GMT]], [content-length: [35]], [content-type: [application/json; charset=UTF-8]], [x-found-handling-cluster: [61f0f42851a44539845f845dbd997a47]], [x-cloud-request-id: [_5ehbJ9tRTyJQUoW0C_DiQ]]], body=[{\"ok\":false,\"message\":\"Forbidden\"}\n]]"
}
],
"type": "exception",
"reason": "Watch[_inlined_] reporting[error_report.pdf] Error response when trying to trigger reporting generation host[healthsnap-blue-audit.kb.us-east-1.aws.found.io], port[9243] method[POST], path[/api/reporting/generate/printablePdfV2], response[status=[403], headers=[[date: [Wed, 25 Oct 2023 17:07:20 GMT]], [content-length: [35]], [content-type: [application/json; charset=UTF-8]], [x-found-handling-cluster: [61f0f42851a44539845f845dbd997a47]], [x-cloud-request-id: [_5ehbJ9tRTyJQUoW0C_DiQ]]], body=[{\"ok\":false,\"message\":\"Forbidden\"}\n]]"
}
}
]
},
"messages": []
}
My configuration for the watcher is the following:
{
"trigger" : {
"schedule": {
"weekly" : { "on" : "monday", "at" : "6:00" }
}
},
"actions" : {
"email_admin" : {
"email": {
"to": "'Audit Team <audit@company.com>'",
"subject": "Weekly Audit Errors Report",
"attachments" : {
"error_report.pdf" : {
"reporting" : {
"url": "https://myserver.aws.found.io:9243/api/reporting/generate/printablePdfV2?jobParams=%28browserTimezone%3AAmerica%2FNew_York%2Clayout%3A%28dimensions%3A%28height%3A1212%2Cwidth%3A1499%29%2Cid%3Apreserve_layout%29%2ClocatorParams%3A%21%28%28id%3ADASHBOARD_APP_LOCATOR%2Cparams%3A%28dashboardId%3A%276ca912a0-90db-11ec-a901-07b1f786920c%27%2CpreserveSavedFilters%3A%21t%2CtimeRange%3A%28from%3Anow-1w%2Cto%3Anow%29%2CuseHash%3A%21f%2CviewMode%3Aview%29%2Cversion%3A%277.17.9%27%29%29%2CobjectType%3Adashboard%2Ctitle%3A%27Audit%20Dashboard%27%2Cversion%3A%277.17.9%27%29",
"retries":3,
"interval":"30s",
"auth":{
"basic":{
"username":"elastic",
"password":"****"
}
}
}
}
}
}
}
}
}
When I try to access the same URL via CURL it works using the basic auth. Any idea on what the issue could be.