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

[REGRESSION]: getting "Protocol error (Target.setDiscoverTargets): Target closed" after upgrading from v0.10 on CentOS7 #1140

Closed
tyler-graham-ck opened this issue Feb 27, 2020 · 6 comments

Comments

@tyler-graham-ck
Copy link

Took awhile to figure out why this is. Seems that in one of the newer chromium releases upgrade cups which doesn't play nice with CentOS7. Ultimately the solution is to build cups from source:

wget https://github.com/apple/cups/releases/download/release-1.7.5/cups-1.7.5-source.tar.gz
yum install -y rpm-build rpmdevtools gcc gcc-c++ libgcrypt-devel gnutls-devel pam-devel dbus-devel avahi-devel
yum erase cups-libs # if you're upgrading, this will remove gtk
rpmdev-setuptree
rpmbuild -ta --without libusb1 cups-1.7.5-source.tar.gz
yum install -y ~/rpmbuild/RPMS/x86_64/cups-libs-1.7.5-1.x86_64.rpm gtk3

Making an issue for future readers and since I'm not entirely sure how you'd like to go about updating the CentOS guide

@Junow
Copy link

Junow commented Mar 2, 2020

i got the same error. i struggled with this problem for past few days... i had an answer about this from here. it's same as your opinion. thank you!

@tyler-graham-ck
Copy link
Author

It me 😉

@aslushnikov
Copy link
Collaborator

We're not experts at CentOS; PRs are very welcome here!

@tyler-graham-ck
Copy link
Author

I see this as more of a knowledge gap issue (and discovery for people having the same problem). I know there are efforts to document more of this stuff (#1103) and figure this should tie into that. The only other solution I can think of would be updating chromium but I have no where near enough context to take that on.

@thernstig
Copy link
Contributor

thernstig commented Mar 11, 2020

I am getting this on Ubuntu 16.04.5 LTS. The chromium version downloaded is Chromium 82.0.4057.0.

const playwright = require('playwright');

(async () => {
  const browser = await playwright.chromium.launch({
    headless: false,
    slowMo: 25,
  });
  const context = await browser.newContext();
  const page = await context.newPage();
  await page.goto(`https://www.whatismybrowser.com/`);
})();

Gives

myuser@hostA ~/code/projectA (playwright)> node testPlaywright.js
(node:64824) UnhandledPromiseRejectionWarning: Error: Protocol error (Target.setDiscoverTargets): Target closed.
    at /home/myuser/code/projectA/node_modules/playwright-core/lib/chromium/crConnection.js:121:63
    at new Promise (<anonymous>)
    at CRSession.send (/home/myuser/code/projectA/node_modules/playwright-core/lib/chromium/crConnection.js:120:16)
    at Function.connect (/home/myuser/code/projectA/node_modules/playwright-core/lib/chromium/crBrowser.js:51:38)
    at Chromium.launch (/home/myuser/code/projectA/node_modules/playwright-core/lib/server/chromium.js:46:53)
    at async /home/myuser/code/projectA/testPlaywright.js:4:19
(node:64824) 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(). (rejection id: 1)
(node:64824) [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.

EDIT: This fault happened to me because I had headless: false, when running playwright on a remote ssh host. I assume in this case it is expected to not work, but the actual error message shown could be much better?

@tyler-graham-ck
Copy link
Author

Apparently a newer revision fixes the issue https://support.google.com/chrome/thread/29660240?hl=en&msgid=33421825

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

5 participants