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] Cannot find a MiniBrowser.app in neither location #2660

Closed
antony opened this issue Jun 21, 2020 · 9 comments
Closed

[BUG] Cannot find a MiniBrowser.app in neither location #2660

antony opened this issue Jun 21, 2020 · 9 comments
Assignees

Comments

@antony
Copy link

antony commented Jun 21, 2020

Context:

  • Playwright Version: v1.1.1
  • Operating System: Ubuntu 20.04
  • Node version: 14
  • Browser: WebKit
  • Extra: I've run node ./node_modules/playwright/install.js since the original install resulted in having no browsers installed.

Code Snippet

const { webkit } = require('playwright')

async function run () {
  const browser = await webkit.launch()
  const page = await browser.newPage()
  await page.goto('http://whatsmyuseragent.org/')
  await page.screenshot({ path: `example.png` })
  await browser.close()
}

run()

Describe the bug

I don't appear to run anything, since the browser says it was closed.

ant@machine  /home/me/Projects/acceptance   npm run test                                                                                                                                                                                             16:01:35 

> @beyonk/[email protected] test /home/ant/Projects/acceptance
> DEBUG=pw:browser* node tests/homepage.spec.js

  pw:browser   <launching> /home/me/.cache/ms-playwright/webkit-1269/pw_run.sh --inspector-pipe --headless --no-startup-window +0ms
  pw:browser   <launched> pid=599506 +5ms
  pw:browser:err   Cannot find a MiniBrowser.app in neither location +0ms
  pw:browser   <process did exit: exitCode=1, signal=null> +10ms
  pw:browser <gracefully close start> +10ms
  pw:browser <kill> +1ms
  pw:browser <gracefully close end> +3ms
(node:599495) UnhandledPromiseRejectionWarning: Protocol error (Playwright.enable): Browser has been closed.
==================== webkit.launch logs ====================
<launching> /home/me/.cache/ms-playwright/webkit-1269/pw_run.sh --inspector-pipe --headless --no-startup-window
<launched> pid=599506
Cannot find a MiniBrowser.app in neither location
<process did exit: exitCode=1, signal=null>
============================================================
@yury-s
Copy link
Member

yury-s commented Jun 22, 2020

Extra: I've run node ./node_modules/playwright/install.js since the original install resulted in having no browsers installed.

Can you tell us more about how you installed playwight originally when it ended up having not browsers downloaded?

I also noticed that you are running tests under user ant while playwright browser binaries are under /home/me/ (different user), can it be a permission issue?

@antony
Copy link
Author

antony commented Jun 27, 2020

Apologies for the delay in getting back to you. I tried to censor my homedir name for the bug report, but clearly caused more confusion!

Here's an installation log, as per the instructions on the site. The initial npm i -D where I assume browsers are expected to download, is very quick, and no browsers are downloaded:

ant@apse  /home/ant/Projects/playwright-test   npm i -D playwright                                                                                       
> [email protected] install /home/ant/Projects/playwright-test/node_modules/playwright
> node install.js

npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN [email protected] No description
npm WARN [email protected] No repository field.

+ [email protected]
added 37 packages from 82 contributors and audited 37 packages in 4.085s

2 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

 ant@apse  /home/ant/Projects/playwright-test   vim script.js
 ant@apse  /home/ant/Projects/playwright-test   node script.js
(node:1338426) UnhandledPromiseRejectionWarning: Error: Failed to launch browser: Error: spawn /home/ant/.cache/ms-playwright/chromium-775089/chrome-linux/chrome ENOENT
=================== chromium.launch logs ===================
<launching> /home/ant/.cache/ms-playwright/chromium-775089/chrome-linux/chrome --disable-background-networking --enable-features=NetworkService,NetworkServiceInProcess --disable-background-timer-throttling --disable-backgrounding-occluded-windows --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-background-pages --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=TranslateUI,BlinkGenPropertyTrees,ImprovedCookieControls,SameSiteByDefaultCookies --disable-hang-monitor --disable-ipc-flooding-protection --disable-popup-blocking --disable-prompt-on-repost --disable-renderer-backgrounding --disable-sync --force-color-profile=srgb --metrics-recording-only --no-first-run --enable-automation --password-store=basic --use-mock-keychain --user-data-dir=/tmp/playwright_chromiumdev_profile-FgBsBG --remote-debugging-pipe --headless --hide-scrollbars --mute-audio --no-startup-window
============================================================
Note: use DEBUG=pw:api environment variable and rerun to capture Playwright logs.
    at ChildProcess.<anonymous> (/home/ant/Projects/playwright-test/node_modules/playwright/lib/server/processLauncher.js:51:20)
    at Object.onceWrapper (events.js:422:26)
    at ChildProcess.emit (events.js:315:20)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:274:12)
    at onErrorNT (internal/child_process.js:468:16)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:1338426) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:1338426) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

@antony
Copy link
Author

antony commented Jun 28, 2020

Just as further useful information:

ant@apse  /home/ant/Projects/playwright-test   ls /home/ant/.cache/ms-playwright/chromium-775089/chrome-linux/                                           
chrome_100_percent.pak
 ant@apse  /home/ant/Projects/playwright-test   ls /home/ant/.cache/ms-playwright/firefox-1106/firefox                                                    
libmozsandbox.so
 ant@apse  /home/ant/Projects/playwright-test   ls /home/ant/.cache/ms-playwright/webkit-1269                                                             
pw_run.sh
 ant@apse  /home/ant/Projects/playwright-test   du -hs ~/.cache/ms-playwright/*                                                                          
840K	/home/ant/.cache/ms-playwright/chromium-775089
152K	/home/ant/.cache/ms-playwright/firefox-1106
8.0K	/home/ant/.cache/ms-playwright/webkit-1269

@aslushnikov aslushnikov self-assigned this Jul 16, 2020
aslushnikov added a commit to aslushnikov/playwright that referenced this issue Jul 17, 2020
Currently, Ctrl-C while extracting browser might yield users in
a bad place.

This patch adds a marker file inside browser directory to make
sure that browser extraction completed.

Note: this was already attempted in microsoft#2489, but was eventually
reverted in microsoft#2534.

References microsoft#2660
aslushnikov added a commit that referenced this issue Jul 17, 2020
Currently, Ctrl-C while extracting browser might yield users in
a bad place.

This patch adds a marker file inside browser directory to make
sure that browser extraction completed.

Note: this was already attempted in #2489, but was eventually
reverted in #2534.

References #2660
@aslushnikov
Copy link
Collaborator

@antony Can you please try one more time with Playwright@next? It supports atomic installation now, so browsers should download just fine.

However, our WebKit doesn't yet run on ubuntu 20.04 - this will be tracked by #2559.

@antony
Copy link
Author

antony commented Jul 22, 2020

will do as soon as I get a minute! thanks :)

@antony
Copy link
Author

antony commented Jul 23, 2020

I think... I have a different error. Still an error though.

 ant@apse  /home/ant/Projects/pw-test   npm i -D playwright@next                                                                  23:28:13 

> [email protected] install /home/ant/Projects/pw-test/node_modules/playwright
> node install.js

Removing unused browser at /home/ant/.cache/ms-playwright/chromium-782078
Downloading chromium v790602 - 126.9 Mb [====================] 100% 0.0s 
npm WARN saveError ENOENT: no such file or directory, open '/home/ant/Projects/pw-test/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/home/ant/Projects/pw-test/package.json'
npm WARN pw-test No description
npm WARN pw-test No repository field.
npm WARN pw-test No README data
npm WARN pw-test No license field.

+ [email protected]
updated 1 package and audited 49 packages in 103.925s

2 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities


 ant@apse  /home/ant/Projects/pw-test   ls                                                                                        23:30:00 
hello.js  node_modules  package-lock.json

 ant@apse  /home/ant/Projects/pw-test   node hello.js                                                                             23:32:20 
(node:39883) UnhandledPromiseRejectionWarning: Error: browserType.launch: Failed to launch browser: Error: spawn /home/ant/.cache/ms-playwright/chromium-790602/chrome-linux/chrome ENOENT
=========================== logs ===========================
[browser] <launching> /home/ant/.cache/ms-playwright/chromium-790602/chrome-linux/chrome --disable-background-networking --enable-features=NetworkService,NetworkServiceInProcess --disable-background-timer-throttling --disable-backgrounding-occluded-windows --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-background-pages --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=TranslateUI,BlinkGenPropertyTrees,ImprovedCookieControls,SameSiteByDefaultCookies --disable-hang-monitor --disable-ipc-flooding-protection --disable-popup-blocking --disable-prompt-on-repost --disable-renderer-backgrounding --disable-sync --force-color-profile=srgb --metrics-recording-only --no-first-run --enable-automation --password-store=basic --use-mock-keychain --user-data-dir=/tmp/playwright_chromiumdev_profile-ItcJwW --remote-debugging-pipe --headless --hide-scrollbars --mute-audio --no-startup-window
============================================================
Note: use DEBUG=pw:api environment variable and rerun to capture Playwright logs.
    at ChildProcess.<anonymous> (/home/ant/Projects/pw-test/node_modules/playwright/lib/server/processLauncher.js:47:20)
    at Object.onceWrapper (events.js:422:26)
    at ChildProcess.emit (events.js:315:20)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:274:12)
    at onErrorNT (internal/child_process.js:468:16)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:39883) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:39883) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

In the chromium download dir:

/home/ant/.cache/ms-playwright/chromium-790602/chrome-linux/

firefox:

 ant@apse  /home/ant/.cache/ms-playwright/firefox-1106/firefox   ls                                                               23:34:00 
libmozsandbox.so

Not going to enumerate webkit as you've said it doesn't work.

@aslushnikov
Copy link
Collaborator

aslushnikov commented Jul 31, 2020

@antony this is very peculiar. I see there's the following NPM error:

npm WARN saveError ENOENT: no such file or directory, open '/home/ant/Projects/pw-test/package.json'

Which means you're installing to a directory without package.json. So I'm trying to reproduce this the following way:

~/prog$ mkdir tmp
~/prog/tmp$ npm init -y
~/prog/tmp$ npm i is-admin # install simple package to create package-lock.json
~/prog/tmp$ rm package.json # remove package.json
~/prog/tmp$ npm i -D playwright@next

But it still installs nicely for me... I'm running node v14.4.0 & npm v6.14.5. Any chance you can lead me step-by-step? Anything unusual in your setup that might help me reproduce your issue locally? Also, our WebKit now support Ubuntu-20.04, so feel free to try it out.

@antony
Copy link
Author

antony commented Aug 1, 2020

I figured it out!

I was using node v14 as I've been upgrading a bunch of my projects. I dropped to v12 and it works absolutely fine.

I hope I haven't wasted anyone's time. Is it worth adding some messaging if you try to install on an (I assume) unsupported node version?

@aslushnikov
Copy link
Collaborator

@antony ah! Was it node 14.0.0? That was a known issue! #1988

Newer node versions should be working just fine.

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