playwright icon indicating copy to clipboard operation
playwright copied to clipboard

[BUG] Webkit problem with libwebp-1.1.0-1, error while loading shared libraries: libwebp.so.6

Open tahmid-shahriar opened this issue 6 years ago • 40 comments

Context:

  • Playwright Version: ^1.1.1
  • Operating System: Arch Linux x86_64
  • Kernel: 5.7.2-arch1-1
  • Node version: v14.4.0
  • Browser: WebKit
  • Extra: libwebp-1.1.0-1

Code Snippet

const playwright = require('playwright')

;(async () => {
  for (const browserType of ['webkit']) {
    const browser = await playwright[browserType].launch()
    const context = await browser.newContext()
    const page = await context.newPage()
    await page.goto('http://whatsmyuseragent.org/')
    await page.screenshot({ path: `example-${browserType}.png` })
    await browser.close()
  }
})()

Describe the bug error while loading shared libraries: libwebp.so.6

 pw:api => webkit.launch started +0ms
  pw:api <= webkit.launch failed +23ms
(node:329099) UnhandledPromiseRejectionWarning: Protocol error (Playwright.enable): Browser has been closed.
==================== webkit.launch logs ====================
<launching> /home/thesorryguy/.cache/ms-playwright/webkit-1269/pw_run.sh --inspector-pipe --headless --no-startup-window
<launched> pid=329110
/home/thesorryguy/.cache/ms-playwright/webkit-1269/minibrowser-wpe/MiniBrowser: error while loading shared libraries: libwebp.so.6: cannot open shared object file: No such file or directory
<process did exit: exitCode=127, signal=null>
============================================================
Note: use DEBUG=pw:api environment variable and rerun to capture Playwright logs.Error
    at /home/thesorryguy/Documents/youtube-stream/node_modules/playwright/lib/webkit/wkConnection.js:104:63
    at new Promise (<anonymous>)
    at WKSession.send (/home/thesorryguy/Documents/youtube-stream/node_modules/playwright/lib/webkit/wkConnection.js:103:16)
    at Function.connect (/home/thesorryguy/Documents/youtube-stream/node_modules/playwright/lib/webkit/wkBrowser.js:50:37)
    at WebKit._connectToTransport (/home/thesorryguy/Documents/youtube-stream/node_modules/playwright/lib/server/webkit.js:33:38)
    at WebKit._innerLaunch (/home/thesorryguy/Documents/youtube-stream/node_modules/playwright/lib/server/browserType.js:86:36)
    at async ProgressController.run (/home/thesorryguy/Documents/youtube-stream/node_modules/playwright/lib/progress.js:76:28)
    at async WebKit.launch (/home/thesorryguy/Documents/youtube-stream/node_modules/playwright/lib/server/browserType.js:61:25)
    at async /home/thesorryguy/Documents/youtube-stream/src/index.js:5:21
(Use `node --trace-warnings ...` to show where the warning was created)
(node:329099) 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:329099) [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.

which I fixed by creating the symbolic link manually. sudo ln /usr/lib/libwebp.so.7 /usr/lib/libwebp.so.6

Then again running into

 pw:api => webkit.launch started +0ms
  pw:api <= webkit.launch failed +24ms
(node:330939) UnhandledPromiseRejectionWarning: Protocol error (Playwright.enable): Browser has been closed.
==================== webkit.launch logs ====================
<launching> /home/thesorryguy/.cache/ms-playwright/webkit-1269/pw_run.sh --inspector-pipe --headless --no-startup-window
<launched> pid=330950
/home/thesorryguy/.cache/ms-playwright/webkit-1269/minibrowser-wpe/MiniBrowser: error while loading shared libraries: libpcre.so.3: cannot open shared object file: No such file or directory
<process did exit: exitCode=127, signal=null>
============================================================
Note: use DEBUG=pw:api environment variable and rerun to capture Playwright logs.Error
    at /home/thesorryguy/Documents/youtube-stream/node_modules/playwright/lib/webkit/wkConnection.js:104:63
    at new Promise (<anonymous>)
    at WKSession.send (/home/thesorryguy/Documents/youtube-stream/node_modules/playwright/lib/webkit/wkConnection.js:103:16)
    at Function.connect (/home/thesorryguy/Documents/youtube-stream/node_modules/playwright/lib/webkit/wkBrowser.js:50:37)
    at WebKit._connectToTransport (/home/thesorryguy/Documents/youtube-stream/node_modules/playwright/lib/server/webkit.js:33:38)
    at WebKit._innerLaunch (/home/thesorryguy/Documents/youtube-stream/node_modules/playwright/lib/server/browserType.js:86:36)
    at async ProgressController.run (/home/thesorryguy/Documents/youtube-stream/node_modules/playwright/lib/progress.js:76:28)
    at async WebKit.launch (/home/thesorryguy/Documents/youtube-stream/node_modules/playwright/lib/server/browserType.js:61:25)
    at async /home/thesorryguy/Documents/youtube-stream/src/index.js:5:21
(Use `node --trace-warnings ...` to show where the warning was created)
(node:330939) 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:330939) [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.

Which I solved by creating the symbolic link manually again. sudo ln /usr/lib/libpcre.so.1 /usr/lib/libpcre.so.3

Is it because of the latest libwebp-1.1.0-1 ?

tahmid-shahriar avatar Jun 18 '20 08:06 tahmid-shahriar

Which Linux distribution are you using?

yury-s avatar Jun 18 '20 21:06 yury-s

@yury-s Arch Linux x86_64

tahmid-shahriar avatar Jun 19 '20 05:06 tahmid-shahriar

I am also using Arch, and got same errors.

nbyavuz avatar Jun 19 '20 11:06 nbyavuz

Is it because of the latest libwebp-1.1.0-1 ?

@somoy99 It might be! But i wouldn't say anything for sure.

All in all, our recent effort at making launch experience smoother should help you here: you'll get a list of all missing dependencies, at least as of our upcoming 1.3 release.

We don't consider missing dependency a bug in this case since ArchLinux support is out of scope for us at the moment. Closing this since it's not actionable on our side.

aslushnikov avatar Jul 22 '20 22:07 aslushnikov

Arch support would be nice!

I had missing .so errors, which I solved with

cd /usr/lib
sudo ln -s libicui18n.so.67 libicui18n.so.66
sudo ln -s libicuuc.so.67 libicuuc.so.66
sudo ln -s libwebp.so.7 libwebp.so.6

Now I have this error:

[err] /home/trusktr/.cache/ms-playwright/webkit-1343/minibrowser-wpe/bin/MiniBrowser: symbol lookup error: /home/trusktr/.cache/ms-playwright/webkit-1343/minibrowser-wpe/lib/libWPEWebKit-1.0.so.3: undefined symbol: u_strToUpper_66

Any ideas? Maybe the new errors is due to linking to the wrong versions, which I know isn't the actual solution.

trusktr avatar Oct 01 '20 20:10 trusktr

Arch support would be nice!

I had missing .so errors, which I solved with

cd /usr/lib
sudo ln -s libicui18n.so.67 libicui18n.so.66
sudo ln -s libicuuc.so.67 libicuuc.so.66
sudo ln -s libwebp.so.7 libwebp.so.6

Now I have this error:

[err] /home/trusktr/.cache/ms-playwright/webkit-1343/minibrowser-wpe/bin/MiniBrowser: symbol lookup error: /home/trusktr/.cache/ms-playwright/webkit-1343/minibrowser-wpe/lib/libWPEWebKit-1.0.so.3: undefined symbol: u_strToUpper_66

Any ideas? Maybe the new errors is due to linking to the wrong versions, which I know isn't the actual solution.

Same issue, did you manage to solve it?

knaitas avatar Oct 28 '20 13:10 knaitas

I had the same issue in ubuntu 18.04 LTS.

I run following command and solved it.

sudo apt update
sudo apt upgrade
sudo apt update
sudo apt-get install libgles2
sudo apt-get install gstreamer1.0-libav
sudo apt-get install libharfbuzz-icu0
sudo apt-get install libwoff1
sudo apt-get install libgstreamer-plugins-bad1.0-0
sudo apt-get install libgstreamer-gl1.0-0
sudo apt-get install libwebp-dev

Can you please include everything when we install?

Cheers

allgrowsm avatar Oct 29 '20 09:10 allgrowsm

same issue here on arch linux

Missing libraries are:
libicui18n.so.66
libicuuc.so.66
libgstcodecparsers-1.0.so.0
libwebp.so.6
libenchant.so.1

After linking system libraries with above i get the error below

[err] /home/username/.cache/ms-playwright/webkit-1402/minibrowser-wpe/bin/MiniBrowser: symbol lookup error: 

/home/username/.cache/ms-playwright/webkit-1402/minibrowser-wpe/lib/libWPEWebKit-1.0.so.3: undefined symbol: u_strToLower_66

fuzunspm avatar Dec 21 '20 17:12 fuzunspm

I'm running Manjaro and I'm encountering the same issue:

Error: Host system is missing dependencies!

  Missing libraries are:
      libwebp.so.6
      libenchant.so.1
      libicui18n.so.66
      libicuuc.so.66

Is Arch support on the roadmap? Has anyone found a workaround?

DahliaWitt avatar Mar 05 '21 18:03 DahliaWitt

With Ubuntu 20.04.2 LTS (minimal installation) + Playwright 1.10.0 when running WebKit you get this error:

libgstcodecparsers-1.0.so.0: cannot open shared object file: No such file or directory

Protocol error (Playwright.enable): Browser closed.
==================== Browser output: ====================
<launching> /home/tanguy/.cache/ms-playwright/webkit-1446/pw_run.sh --inspector-pipe --headless --no-startup-window
<launched> pid=22226
[pid=22226][err] /home/tanguy/.cache/ms-playwright/webkit-1446/minibrowser-wpe/bin/MiniBrowser: error while loading shared libraries: libgstcodecparsers-1.0.so.0: cannot open shared object file: No such file or directory
[pid=22226] <process did exit: exitCode=127, signal=null>Error
    at /home/tanguy/dev/flex-wrap-layout/examples/node_modules/playwright/lib/server/webkit/wkConnection.js:105:63
    at new Promise (<anonymous>)
    at WKSession.send (/home/tanguy/dev/flex-wrap-layout/examples/node_modules/playwright/lib/server/webkit/wkConnection.js:104:16)
    at Function.connect (/home/tanguy/dev/flex-wrap-layout/examples/node_modules/playwright/lib/server/webkit/wkBrowser.js:72:37)
    at WebKit._connectToTransport (/home/tanguy/dev/flex-wrap-layout/examples/node_modules/playwright/lib/server/webkit/webkit.js:32:38)
    at WebKit._innerLaunch (/home/tanguy/dev/flex-wrap-layout/examples/node_modules/playwright/lib/server/browserType.js:131:36)
    at async ProgressController.run (/home/tanguy/dev/flex-wrap-layout/examples/node_modules/playwright/lib/server/progress.js:79:28)
    at async WebKit.launch (/home/tanguy/dev/flex-wrap-layout/examples/node_modules/playwright/lib/server/browserType.js:78:25)
    at async BrowserServerLauncherImpl.launchServer (/home/tanguy/dev/flex-wrap-layout/examples/node_modules/playwright/lib/browserServerImpl.js:58:25)
    at async PlaywrightRunner.launchServer (/home/tanguy/dev/flex-wrap-layout/examples/node_modules/jest-playwright-preset/lib/PlaywrightRunner.js:68:44)

Solution:

sudo apt-get install gstreamer1.0-plugins-bad

tkrotoff avatar Apr 20 '21 19:04 tkrotoff

same issue here on arch linux

Missing libraries are:
libicui18n.so.66
libicuuc.so.66
libgstcodecparsers-1.0.so.0
libwebp.so.6
libenchant.so.1

After linking system libraries with above i get the error below

[err] /home/username/.cache/ms-playwright/webkit-1402/minibrowser-wpe/bin/MiniBrowser: symbol lookup error: 

/home/username/.cache/ms-playwright/webkit-1402/minibrowser-wpe/lib/libWPEWebKit-1.0.so.3: undefined symbol: u_strToLower_66

Install the correct version of libicu manually:

wget 'http://security.ubuntu.com/ubuntu/pool/main/i/icu/libicu66_66.1-2ubuntu2_amd64.deb' -O /tmp/libicu66.deb
dpkg -i /tmp/libicu66.deb

Evidlo avatar Jun 23 '21 03:06 Evidlo

Missing libraries are:
libicui18n.so.66
libicuuc.so.66
libwebp.so.6
libenchant.so.1

Manjaro: I solved it by installing the following libs: aur/enchant1.6 aur/icu66 aur/libwebp052

dmitriiweb avatar Sep 30 '21 17:09 dmitriiweb

Missing libraries are:
libicui18n.so.66
libicuuc.so.66
libwebp.so.6
libenchant.so.1

Manjaro: I solved it by installing the following libs: aur/enchant1.6 aur/icu66 aur/libwebp052

I did that too, but I still had some missing libraries, so I had to also install aur/libffi7 And run this command: sudo ln -s /usr/lib/libpcre.so /usr/lib/libpcre.so.3 After that the problem was gone

vaziliybober avatar Jun 25 '22 08:06 vaziliybober

I ended up installing a bunch more dependencies than the ones described here and here what I did it pretty much put the name of the dependency and "arch" on google to see the parent package and install each one of them.

rromanv avatar Oct 11 '22 19:10 rromanv

using arch wsl, I installed these package and solved it yay -S enchant icu66 libwebp gtk3 nss alsa-lib dbus-glib

tendertree avatar Dec 01 '22 02:12 tendertree

using arch wsl, I installed these package and solved it yay -S enchant icu66 libwebp gtk3 nss alsa-lib dbus-glib

can everyone confirm this?

Microsoft should provide also an option for Arch based operative systems.

SalahAdDin avatar Dec 03 '22 20:12 SalahAdDin

❯ uname -r
6.0.1-arch2-1
yay -S libffi7 enchant1.6 icu66 libwebp052

sudo ln -s libicui18n.so.67 libicui18n.so.66
sudo ln -s libicuuc.so.67 libicuuc.so.66
sudo ln -s libwebp.so.7 libwebp.so.6
sudo ln -s /usr/lib/libffi /usr/lib/libffi.so.8.1.2

jorgelaranjo avatar Dec 05 '22 13:12 jorgelaranjo

i wouldn't call it "runs everywhere" :laughing: Anyways, my arch error after all comments in this thread is:

  1) [webkit] › example.spec.ts:3:5 › has title ────────────────────────────────────────────────────

    browserType.launch: 
    ╔══════════════════════════════════════════════════════╗
    ║ Host system is missing dependencies to run browsers. ║
    ║ Missing libraries:                                   ║
    ║     libflite_cmu_us_awb.so.1                         ║
    ║     libflite_cmu_us_kal.so.1                         ║
    ║     libflite_cmu_us_rms.so.1                         ║
    ╚══════════════════════════════════════════════════════╝

Playwright - 1.31.0 Arch - 6.1.12-arch1-1

slch avatar Feb 23 '23 11:02 slch

@slch Had the exact same missing dependencies. Here's how to add the missing libraries:

  1. Download flite1 package from: https://builds.garudalinux.org/repos/chaotic-aur/x86_64/flite1-1.4-5-x86_64.pkg.tar.zst
  2. Extract the tar (7z x flite1-1.4-5-x86_64.pkg.tar.zst)
  3. Copy the required files to /usr/lib:
cd <extract_location>/usr/lib
sudo cp libflite_cmu_us_awb.so.1 libflite_cmu_us_kal.so.1 libflite_cmu_us_rms.so.1 /usr/lib

Where extract_location is where you extracted the package.

lazypolymath avatar Mar 08 '23 06:03 lazypolymath

Related ref: https://github.com/microsoft/playwright/issues/8100#issuecomment-1554876306

nandgator avatar May 19 '23 16:05 nandgator