playwright: [BUG] Playwright cannot find executables for all browsers in test runs this morning; no code changed over several days.

Context:

  • Playwright Version: 1.20.0
  • Operating System: Windows and Linux (via docker container)
  • Node.js version: 16.13.0
  • Browser: All

System:

  • OS: Windows 10 10.0.19043
  • Memory: 12.32 GB / 31.73 GB

Binaries:

  • Node: 16.13.0 - C:\Program Files\nodejs\node.EXE
  • Yarn: 1.22.17 - C:\Program Files\nodejs\yarn.CMD
  • npm: 8.1.3 - C:\Program Files\nodejs\npm.CMD

Code Snippet

No code snippet required, bug appears to be related to Playwright and it’s browsers that are installed; not a code bug.

Describe the bug

We have many UI projects that use Playwright to do integration and end-to-end testing that were fine up until sometime this morning. No code changes what so ever, just building existing code as it stood over the last several days.

This morning all of the UI builds (which use your Playwright docker images) are failing, stating it cannot find executable for the browser, see below…

1) [chromium] › app.spec.ts:64:1 › Example form integration ======================================
--
  |  
  | browserType.launch: Executable doesn't exist at /ms-playwright/chromium-965416/chrome-linux/chrome
  | ╔═════════════════════════════════════════════════════════════════════════╗
  | ║ Looks like Playwright Test or Playwright was just installed or updated. ║
  | ║ Please run the following command to download new browsers:              ║
  | ║                                                                         ║
  | ║     npx playwright install                                              ║
  | ║                                                                         ║
  | ║ <3 Playwright Team                                                      ║
  | ╚═════════════════════════════════════════════════════════════════════════╝
  |  
  |  
  |  
  |  
  | 2) [firefox] › app.spec.ts:64:1 › Example form integration =======================================
  |  
  | browserType.launch: Executable doesn't exist at /ms-playwright/firefox-1316/firefox/firefox
  | ╔═════════════════════════════════════════════════════════════════════════╗
  | ║ Looks like Playwright Test or Playwright was just installed or updated. ║
  | ║ Please run the following command to download new browsers:              ║
  | ║                                                                         ║
  | ║     npx playwright install                                              ║
  | ║                                                                         ║
  | ║ <3 Playwright Team                                                      ║
  | ╚═════════════════════════════════════════════════════════════════════════╝
  |  
  |  
  |  
  |  
  | 3) [webkit] › app.spec.ts:64:1 › Example form integration ========================================
  |  
  | browserType.launch: Executable doesn't exist at /ms-playwright/webkit-1609/pw_run.sh
  | ╔═════════════════════════════════════════════════════════════════════════╗
  | ║ Looks like Playwright Test or Playwright was just installed or updated. ║
  | ║ Please run the following command to download new browsers:              ║
  | ║                                                                         ║
  | ║     npx playwright install                                              ║
  | ║                                                                         ║
  | ║ <3 Playwright Team                                                      ║
  | ╚═════════════════════════════════════════════════════════════════════════╝

When running the tests locally with npx playwright test without using your Playwright docker images, it still fails the same way. I attempted to run npx playwright install as suggested in the error messages above, following this Chromium and Firefox work fine, however webkit fails all tests stating that it is unable to fine elements (running it headed, the page is blank and nothing is loading).

Unable to find any issues relating to this issue I want to know if there is ongoing problems being resolved as we speak, how long that will be and if there are any work around(s) at the moment?

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 9
  • Comments: 16 (4 by maintainers)

Commits related to this issue

Most upvoted comments

In case any future readers are wondering, I’d like to document here what was never actually stated in the short responses to this issue.

Each Docker image includes browsers in a unique location, e.g. /ms-playwright/chromium-965416 for one version, or /ms-playwright/chromium-1000 for another.

Each version of the Playwright package seems hardcoded to point to that particular location.

Because of this, your installed Playwright package version must match your Docker image version. If it doesn’t, when the tests are run, they will use the wrong location for the browser, and it will not be found.

Pinning the Docker image is the solution here to ensure those two versions don’t accidentally become out of sync.

Please make sure you always pin your docker images like so:

mcr.microsoft.com/playwright:v1.20.0-focal

Could the docs be updated then?

We are running in Circle CI with the following image:

docker:
      - image: mcr.microsoft.com/playwright:focal

previously we have never needed to run any update commands on this docker image?

Thank you! This is a far more useful answer. Can we have this added to the documentation?

On Thu, Apr 14, 2022 at 2:50 PM Ari @.***> wrote:

In case any future readers are wondering, I’d like to document here what was never actually stated in the short responses to this issue.

Each Docker image includes browsers in a unique location, e.g. /ms-playwright/chromium-965416 for one version, or /ms-playwright/chromium-1000 for another.

Each version of the Playwright package seems hardcoded to point to that particular location.

Because of this, your installed Playwright package version must match your Docker image version. If it doesn’t, when the tests are run, they will use the wrong location for the browser, and it will not be found.

Pinning the Docker image is the solution here to ensure those two versions don’t accidentally become out of sync.

— Reply to this email directly, view it on GitHub https://github.com/microsoft/playwright/issues/12772#issuecomment-1099658004, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAA7USZGP2GKJEXJ6K6IRFLVFCHJVANCNFSM5QYMPDLQ . You are receiving this because you commented.Message ID: @.***>

Please make sure you always pin your docker images like so:

mcr.microsoft.com/playwright:v1.20.0-focal

Edit: also we switched to use mcr.microsoft.com/playwright/python:focal to see if it was a caching issue, but the python image is also giving the same error message

I re-ran the CircleCI Job with SSH to check out what’s going on, but it looks like the chromium version that playwright is looking for does not match what is installed in the docker container (Note we also tried running playwright install, and that did not do anything)

Specifically, the error message states

Executable doesn't exist at /ms-playwright/chromium-965416/chrome-linux/chrome

And running ls /ms-playwright in the docker container returns

chromium-978106  ffmpeg-1007  firefox-1319  webkit-1616

+1, we used the focal image yesterday at 5pm ET, which worked. Nothing has changed since then and it failed today at 10m ET