Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[QUESTION] Chromium versions are mismatched in docker, leading to launch failures #3122

Closed
hinzed1127 opened this issue Jul 23, 2020 · 4 comments

Comments

@hinzed1127
Copy link

Context:
I was getting a browser launch failure when trying to run within a Docker container.

The displayed error saidError: Failed to launch browser: Error: spawn /home/pwuser/.cache/ms-playwright/chromium-782078/chrome-linux/chrome ENOENT

Taking a closer look, I found that chromium-790602 was the version in my /home/pwuser/.cach/ms-playwright/ directory
#3087 led me to try modifying my dockerfile to this, using the dev tag instead of bionic:

FROM mcr.microsoft.com/playwright:dev

COPY . /src/project

WORKDIR /src/project

USER root

RUN npm install

USER pwuser

and updating my package.json dependencies to use playwright@next instead of "^1.2.0":

"dependencies": {
    "expect-playwright": "^0.2.5",
    "jest": "^25.1.0",
    "jest-playwright-preset": "^1.2.1",
    "playwright": "next" 
  }

for some reason npm install was only working with the root user for playwright@next.

Question

Is there a way to make chromium versions match using the more stable releases? Specifically, I'd like to just use FROM mcr.microsoft.com/playwright:dev and playwright@latest, but I was not having any success figuring that out.

@aslushnikov
Copy link
Contributor

Is there a way to make chromium versions match using the more stable releases? Specifically, I'd like to just use FROM mcr.microsoft.com/playwright:dev and playwright@latest, but I was not having any success figuring that out.

@hinzed1127 We're half-way through finalizing our docker story. With the 1.3 release, we will start versioning our docker images. So if you use playwright 1.3, you'll be able to do FROM mcr.microsoft.com/playwright:v1.3.0-bionic.

Note though that you'll have to pin your playwright version in package.json and update docker image version simultaneously with Playwright version.

for some reason npm install was only working with the root user for playwright@next.

Can you clarify this? This sounds like something unexpected to me.

@hinzed1127
Copy link
Author

@aslushnikov Thanks for clarifying! I'll keep an eye out for the version updates, that should be much easier to keep sync.

As far as the second part, I'm seeing permissions issues when trying to install playwright in docker when running as pwuser. This is the error output from npm install:

npm WARN checkPermissions Missing write access to /src/project/node_modules/playwright
npm WARN checkPermissions Missing write access to /src/project/node_modules/playwright/node_modules
npm WARN checkPermissions Missing write access to /src/project/node_modules
npm WARN va-sso-smoketests@0.0.1 No repository field.

npm ERR! code EACCES
npm ERR! syscall access
npm ERR! path /src/project/node_modules/playwright
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, access '/src/project/node_modules/playwright'
npm ERR!  [Error: EACCES: permission denied, access '/src/project/node_modules/playwright'] {
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'access',
npm ERR!   path: '/src/project/node_modules/playwright'
npm ERR! }
npm ERR! 
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR! 
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.

Strangely, I'm only seeing this error when attempting to install playwright@^1.2.0, but no issues arise with playwright@next. In any case, switching to root in the dockerfile before installing solved that issue (i.e., installing `playwright@^1.2.0).

USER root

RUN npm install

USER pwuser

@aslushnikov
Copy link
Contributor

As far as the second part, I'm seeing permissions issues when trying to install playwright in docker when running as pwuser. This is the error output from npm install:

@hinzed1127 Could it be due to the copy command that happens under root? You can actually chown files in docker when copying them:

COPY --chown=pwuser . /src/project

@arjunattam
Copy link
Contributor

Hi @isudilovskiy – docker images are now versioned. For example, you can use mcr.microsoft.com/playwright:v1.5.2-bionic for current latest based on Ubuntu 18.04 (Bionic). All available tags are here.

I'll close this issue since it's stale. Please feel free to open a new issue if we're missing anything!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants