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

[Bug]: Fails to run in GitLab CI / mcr.microsoft.com/playwright:focal Docker image #7867

Closed
Vinnl opened this issue Jul 27, 2021 · 7 comments

Comments

@Vinnl
Copy link

Vinnl commented Jul 27, 2021

Playwright version

1.13.0

Operating system

Linux

What browsers are you seeing the problem on?

Firefox

Other information

It's running in GitLab CI/CD using the mcr.microsoft.com/playwright:focal Docker image.

What happened? / Describe the bug

Running a script that calls playwright-firefox terminates with the following error message:

Error: Cannot find module '/root/.npm/_npx/10/lib/node_modules/feed-me-up-scotty/node_modules/playwright-firefox/install.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
    at Function.Module._load (internal/modules/cjs/loader.js:746:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
    at internal/main/run_main_module.js:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

This has been happening in a job that runs a couple of times a day since Jul 22, 2021 7:05am GMT+0200 - the last job before that that ran successfully ran on Jul 21, 2021 3:25pm GMT+0200. Since version 1.13.0 of playwright-firefox was released on Jul 21, 2021 5:38pm GMT+0200, it seems likely that a change there caused this.

Code snippet to reproduce your bug

If this doesn't ring a bell w.r.t. what the issue could be, let me know, and I can see if I can set up a minimal reproduction repository on GitLab.

Relevant log output

No response

@dgozman
Copy link
Contributor

dgozman commented Jul 27, 2021

The link to gitlab-ci.yml requires me to sign in. Could you please share something publicly accessible?

@Vinnl
Copy link
Author

Vinnl commented Jul 28, 2021

Ah sorry, made it public, but essentially it's just this CI config that shows that I'm using the mcr.microsoft.com/playwright:focal Docker image.

pages:
  stage: deploy
  image: mcr.microsoft.com/playwright:focal
  script:
  - npx feed-me-up-scotty
  artifacts:
    paths:
    - public
    expire_in: 1 day
  only:
  - main
  retry:
    max: 2
    when: always

The script it's running (npx feed-me-up-scotty) is this one, if it's relevant.

@mxschmitt
Copy link
Member

I tried to reproduce it on my Mac and with the Docker image but was not able to. Maybe GitLab is doing some magic internally. We recommend also to pin the Docker images, so the browser does not need to get downloaded all the time: mcr.microsoft.com/playwright:v1.13.0-focal. Could you verify that you face the issue still with this Docker image?

@Vinnl
Copy link
Author

Vinnl commented Jul 29, 2021

Unfortunately with the pinned Docker image it still fails. Pinning it to 1.12.3, as expected, does work.

Unfortunately I'm not too familiar with Docker, so I'm not sure how to run that locally properly. If you could share the code you used to reproduce and the command to run I'd be happy to try to reproduce it myself though. Otherwise it indeed does seem likely that something in GitLab's environment is throwing a spanner into the works :/

@mxschmitt
Copy link
Member

mxschmitt commented Jul 29, 2021

This seems related, so using the pwuser user instead should fix it, not sure if its something which we can fix on our side. Since GitLab does not support custom users via the config, you need to leverage "su" manually.

// Edit: upstream bug on NPM side. Workaround is to use the pwuser: npm/cli#3123

@mxschmitt
Copy link
Member

Closing since it works with the pwuser and its an upstream NPM bug, please upvote npm/cli#3123.

@Vinnl
Copy link
Author

Vinnl commented Aug 7, 2021

Unfortunately I'm getting the same error if I run su pwuser first. It's also curious that the problem disappears with Playwright 1.12.3, implying it might be the interaction with something Playwright has started doing that's causing the issue?

Vinnl added a commit to Vinnl/feeds that referenced this issue Aug 13, 2021
Vinnl added a commit to Vinnl/huizenfeed that referenced this issue Feb 17, 2025
Vinnl added a commit to Vinnl/huizenfeed that referenced this issue Feb 17, 2025
Vinnl added a commit to Vinnl/huizenfeed2 that referenced this issue Feb 17, 2025
To check whether this bug is solved:
microsoft/playwright#7867
Vinnl added a commit to Vinnl/huizenfeed2 that referenced this issue Feb 17, 2025
This reverts commit 09223e5.

Unfortunately microsoft/playwright#7867
is not resolved yet.
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