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

Protocol error (Target.createTarget): Target closed #8

Closed
jiripospisil opened this issue Dec 17, 2018 · 1 comment
Closed

Protocol error (Target.createTarget): Target closed #8

jiripospisil opened this issue Dec 17, 2018 · 1 comment

Comments

@jiripospisil
Copy link

jiripospisil commented Dec 17, 2018

Hello, I'm getting the following error while trying to take a screenshot on Lambda:

  const page = await incognitoContext.newPage();
  // ...
  return page.screenshot();
2018-12-17T10:07:15.426Z 856540b8-01e3-11e9-b71f-a1bd004ededf Error: Protocol error (Target.createTarget): Target closed.
at Promise (/opt/nodejs/node_modules/puppeteer-core/lib/Connection.js:73:56)
at new Promise (<anonymous>)
at Connection.send (/opt/nodejs/node_modules/puppeteer-core/lib/Connection.js:72:12)
at Browser._createPageInContext (/opt/nodejs/node_modules/puppeteer-core/lib/Browser.js:174:47)
at BrowserContext.newPage (/opt/nodejs/node_modules/puppeteer-core/lib/Browser.js:368:26)
at takeScreenshot (/var/task/index.js:35:41)
at exports.handler (/var/task/index.js:100:28)
at <anonymous>
at process._tickDomainCallback (internal/process/next_tick.js:228:7)

If I try to run the binary locally (Ubuntu 18.04.1 LTS) and open https://example.com, it indeed closes almost immediately:

time ./chromium-72.0.3617.0 --disable-accelerated-2d-canvas --disable-background-timer-throttling --disable-breakpad --disable-client-side-phishing-detection --disable-cloud-import --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-gesture-typing --disable-gpu --disable-hang-monitor --disable-infobars --disable-notifications --disable-offer-store-unmasked-wallet-cards --disable-offer-upload-credit-cards --disable-popup-blocking --disable-print-preview --disable-prompt-on-repost --disable-setuid-sandbox --disable-software-rasterizer --disable-speech-api --disable-sync --disable-tab-for-desktop-share --disable-translate --disable-voice-input --disable-wake-on-wifi --enable-async-dns --enable-simple-cache-backend --enable-tcp-fast-open --hide-scrollbars --media-cache-size=33554432 --metrics-recording-only --mute-audio --no-default-browser-check --no-first-run --no-pings --no-sandbox --no-zygote --password-store=basic --prerender-from-omnibox=disabled --use-mock-keychain --single-process https://example.com
[1217/114728.139380:WARNING:resource_bundle.cc(346)] locale_file_path.empty() for locale 
./chromium-72.0.3617.0 --disable-accelerated-2d-canvas  --disable-breakpad     0,12s user 0,03s system 26% cpu 0,560 total

If I try to open https://twitter.com instead, the process segfaults:

Thread 3 "Chrome_IOThread" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff4b0f700 (LWP 22900)]
0x000055555993e872 in ?? ()
(gdb) bt
#0  0x000055555993e872 in ?? ()
#1  0x0000555558cd9630 in ?? ()
#2  0x00005555589c5bad in ?? ()
#3  0x0000555558bd325c in ?? ()
#4  0x0000555558bd3033 in ?? ()
#5  0x0000555558bd76ad in ?? ()
#6  0x0000555558be137f in ?? ()
#7  0x000055555ab12897 in ?? ()
#8  0x0000555558359547 in ?? ()
#9  0x00005555583593e6 in ?? ()
#10 0x000055555a269684 in ?? ()
#11 0x000055555a268e88 in ?? ()
#12 0x000055555a2637c3 in ?? ()
#13 0x000055555a263f91 in ?? ()
#14 0x000055555a27633a in ?? ()
#15 0x0000555559913d78 in ?? ()
#16 0x000055555991337f in ?? ()
#17 0x00005555599138a2 in ?? ()
#18 0x00005555599a02f9 in ?? ()
#19 0x000055555992da45 in ?? ()
#20 0x00005555589e8354 in ?? ()
#21 0x00005555599668df in ?? ()
#22 0x000055555999b18e in ?? ()
#23 0x00007ffff79b96db in start_thread (arg=0x7ffff4b0f700) at pthread_create.c:463
#24 0x00007ffff633b88f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

If I remove --single-process, it doesn't segfault anymore but again closes with a slight delay:

time ./chromium-72.0.3617.0 --disable-accelerated-2d-canvas --disable-background-timer-throttling --disable-breakpad --disable-client-side-phishing-detection --disable-cloud-import --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-gesture-typing --disable-gpu --disable-hang-monitor --disable-infobars --disable-notifications --disable-offer-store-unmasked-wallet-cards --disable-offer-upload-credit-cards --disable-popup-blocking --disable-print-preview --disable-prompt-on-repost --disable-setuid-sandbox --disable-software-rasterizer --disable-speech-api --disable-sync --disable-tab-for-desktop-share --disable-translate --disable-voice-input --disable-wake-on-wifi --enable-async-dns --enable-simple-cache-backend --enable-tcp-fast-open --hide-scrollbars --media-cache-size=33554432 --metrics-recording-only --mute-audio --no-default-browser-check --no-first-run --no-pings --no-sandbox --no-zygote --password-store=basic --prerender-from-omnibox=disabled --use-mock-keychain https://twitter.com
[1217/115133.515117:WARNING:resource_bundle.cc(346)] locale_file_path.empty() for locale 
[1217/115133.540260:WARNING:resource_bundle.cc(346)] locale_file_path.empty() for locale 
./chromium-72.0.3617.0 --disable-accelerated-2d-canvas  --disable-breakpad     0,18s user 0,10s system 17% cpu 1,551 total

I've tried the previous release as well (chromium-71.0.3563.0) with the same results. I would expect the browser to stay open. I tried the release that comes with Puppeteer and it does stay open with the same flags. Any ideas?

The report looks similar to #3 but the error message is different so I thought I would open another one.

@jiripospisil
Copy link
Author

It looks like the main issue is that incognito is not compatible with single-process. There's an issue about it at puppeteer/puppeteer#2608 which I somehow missed. Closing for now.

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

1 participant