You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Deploy the Synthetic monitor to the Private Location
Test in 8.12 (but works similarly in 8.11 and 8.10)
Add a browser monitor which uses JS Template strings with variables placeholders ${...}
The monitor will never run 🔴
The Synthetic UI will report the monitor is pending first run 🔴
Elastic Agent stays healthy 🟡 , but the status reports no error even if there is a unit completely ignored
The policy with the synthetic monitor is received by Elastic Agent as it's in pre-config.yml, but the synthetics/browser-default component is never started 🔴
Logs do not report ANY error regarding this even in debug 🔴
This might be related to elastic/kibana#169963 but here the point is Heartbeat is not even started as component, nor errors are exposed in diags or logs.
Add an HTTP Monitor
Adding an HTTP monitor to the same Private location will trigger the spawn of Heartbeat and HTTP monitor will be running fine. 🟢
Add another Browser monitor which doesn't make use of ${...}
Adding a second browser monitor without any ${...}, will make the component synthetics/browser-default spawn, but its generated configuration will only contain the Browser monitor without the ${...}. 🟢
Add another Browser monitor with formatting issues
Adding another Browser monitor which contains this payload below (literal copy paste into the Synthetic Monitor editor in Kibana):
step('Go somewhere',
async () => {\r\n await page.goto('https://google.com');\r\n});\r\n\r\n//
Log all uncaught errors to the terminal\r\ncontext.on('weberror', webError =>
{\r\n console.log(`Uncaught exception: \"${webError.error()}\"`);\r\n});
Makes the Elastic Agent unhealthy (Invalid component model: rendering inputs failed: starting ${ is missing ending } as Last checkin message) 🟡
The logs will start to be flooded by:
{"log.level":"error","@timestamp":"2024-01-24T18:29:01.312Z","log.origin":{"file.name":"coordinator/coordinator.go","file.line":894},"message":"applying new policy: generating component model: rendering inputs failed: starting ${ is missing ending }","log":{"source":"elastic-agent"},"ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2024-01-24T18:29:03.969Z","log.origin":{"file.name":"upgrade/upgrade.go","file.line":111},"message":"Source URI changed from \"https://artifacts.elastic.co/downloads/\" to \"https://artifacts.elastic.co/downloads/\"","log":{"source":"elastic-agent"},"ecs.version":"1.6.0"}
{"log.level":"error","@timestamp":"2024-01-24T18:29:03.970Z","log.origin":{"file.name":"coordinator/coordinator.go","file.line":894},"message":"applying new policy: generating component model: rendering inputs failed: starting ${ is missing ending }","log":{"source":"elastic-agent"},"ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2024-01-24T18:29:06.361Z","log.origin":{"file.name":"upgrade/upgrade.go","file.line":111},"message":"Source URI changed from \"https://artifacts.elastic.co/downloads/\" to \"https://artifacts.elastic.co/downloads/\"","log":{"source":"elastic-agent"},"ecs.version":"1.6.0"}
{"log.level":"error","@timestamp":"2024-01-24T18:29:06.363Z","log.origin":{"file.name":"coordinator/coordinator.go","file.line":894},"message":"applying new policy: generating component model: rendering inputs failed: starting ${ is missing ending }","log":{"source":"elastic-agent"},"ecs.version":"1.6.0"}
Given all the units will report healthy and the error is generated at coordinator level, this will make impossible to apply other changes.
I tried:
changing the log level of the EA - works 🟢
removing monitors - works 🟢
adding another random integration to the private location (e.g. 1password) - fails 🔴
the 1password integration is only in pre-config.yaml, but not in the state.yaml etc... - fails 🔴
Still, I consider the fact the variable substitution fails a "light" problem as a user shouldn't escape the JS code in the Synthetics JS code editor.
TL;DR:
I think from this issue we should have 2 outcomes:
[ENHANCEMENT] Elastic Agent should not attempt to replace variables on the whole policy at once and "attempt" to process the policy component by component (or unit by unit) in order to avoid a wrong input in one of the integrations to block other actions/integrations -> Isolate the integrations configurations / scoped processing of the policy
[BUGFIX?] Understand why the Synthetic monitor which uses the ${...} properly is completely ignored and not even reported as unhealthy or logged
FYI
@pierrehilbert (as discussed in our sync, for a check by your team)
@andrewvc (as this was discussed in an internal Slack thread of Synthetics)
Reproducible on 8.12, 8.11 and 8.10 at least.
Test in 8.12 (but works similarly in 8.11 and 8.10)
Add a browser monitor which uses JS Template strings with variables placeholders
${...}
synthetic monitor
is received by Elastic Agent as it's inpre-config.yml
, but thesynthetics/browser-default
component is never started 🔴debug
🔴pre-config.yml
contains 🟢This might be related to elastic/kibana#169963 but here the point is Heartbeat is not even started as component, nor errors are exposed in diags or logs.
Add an HTTP Monitor
Add another Browser monitor which doesn't make use of
${...}
${...}
, will make the componentsynthetics/browser-default
spawn, but its generated configuration will only contain the Browser monitor without the${...}
. 🟢Add another Browser monitor with formatting issues
Invalid component model: rendering inputs failed: starting ${ is missing ending }
asLast checkin message
) 🟡Given all the units will report healthy and the error is generated at
coordinator
level, this will make impossible to apply other changes.I tried:
pre-config.yaml
, but not in thestate.yaml
etc... - fails 🔴Still, I consider the fact the variable substitution fails a "light" problem as a user shouldn't escape the JS code in the Synthetics JS code editor.
TL;DR:
I think from this issue we should have 2 outcomes:
${...}
properly is completely ignored and not even reported as unhealthy or loggedFYI
CC @psanz-estc as he reported this initially
The text was updated successfully, but these errors were encountered: