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
It seems that sometimes the synthetics package can get into a state where our code runs, but the version of the playwright library used references a chrome version that is not installed. @paulb-elastic got his system in such a state once, but we couldn't repro it.
My hunch is this can happen on only some systems after playwright releases a new version. I'm somewhat unsure beyond that, since my system can't repro this.
My hunch is that it would be a good thing to run the playwright post-install script on each run to ensure that the chrome binary is present, and attempt download if not. I can't think of a reason not to try downloading it vs. a straight-up failure.
This only seems to happen with npx running a globally installed package. For a local project this circumstance can be fixed with npm i && npm install playwright. See microsoft/playwright#3712 for more context on that situation
The text was updated successfully, but these errors were encountered:
After some analysis, I would not call this a bug in our package. Instead it's a result of how our examples work at the moment with heartbeat.
Our docker image installs the latest version of @elastic/synthetics@alpha package which installs the chromium browser on specified global location, in heartbeat this would be in /usr/share/heartbeat/.cache/ms-playwright/chromium-<version>.
Now, when heartbeat runs, it will cd in to our examples/todos directory and installs the dependencies specified in package.json
On every scheduled interval, heartbeat runs the examples with already installed node_modules, As both of the global/local @elastic/synthetics packages use the global ms-playwright cache directory for launching chromium, any intermediate state of updating one or the other would always end up in the issue mentioned above.
Solutions
There are multiple solutions to this problem
Use hermetic install of playwright for examples/todos as it would install the browsers under node_modules/.local_browsers/chromium-<version> and would not use the global package under any circumstance. This can be achieved by setting ENV PLAYWRIGHT_BROWSERS_PATH=0
Use the same version of @elastic/synthetics in the example also like how we did before. This means we have to modify the todos/package.json to use file urls.
wipe out the global docker npm cache and always point to the latest version in examples/todos
It seems that sometimes the synthetics package can get into a state where our code runs, but the version of the playwright library used references a chrome version that is not installed. @paulb-elastic got his system in such a state once, but we couldn't repro it.
My hunch is this can happen on only some systems after playwright releases a new version. I'm somewhat unsure beyond that, since my system can't repro this.
My hunch is that it would be a good thing to run the playwright post-install script on each run to ensure that the chrome binary is present, and attempt download if not. I can't think of a reason not to try downloading it vs. a straight-up failure.
This only seems to happen with
npx
running a globally installed package. For a local project this circumstance can be fixed withnpm i && npm install playwright
. See microsoft/playwright#3712 for more context on that situationThe text was updated successfully, but these errors were encountered: