question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
tyler-graham-ckcommented, Mar 16, 2020
0reactions
thernstigcommented, 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?

Read more comments on GitHub >

github_iconTop Results From Across the Web

(Puppeteer) Protocol error (Target.setDiscoverTargets)
The tab is visible but the page hasn't been loaded yet, or is going to be replaced due to the initial load of...
Read more >
Puppeteer - Protocol error (Page.navigate): Target closed
The Target closed exception is thrown when you are trying to run a function, but the target (tab) was already closed.
Read more >
[7.5.0] Problem with reporting feature (dependencies most likely)
Now, it fails with main error. Error spawning Chromium browser: [Error: Protocol error (Target.setDiscoverTargets): Target closed.].
Read more >
Playwright v1.2.0 release notes (2020-07-07) | LibHunt
#1140 - [REGRESSION]: getting "Protocol error (Target.setDiscoverTargets): Target closed" after upgrading from v0.10 on CentOS7
Read more >
Protocol error (Page.printToPDF): Target closed. - jsreport forum
I Seem to be getting this error quite a lot after updating to version 2.5.0: Protocol error (Page.printToPDF): Target closed.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found