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

Error: Attempted to use detached Frame #12294

Open
2 tasks
JayKaku opened this issue Apr 18, 2024 · 18 comments
Open
2 tasks

Error: Attempted to use detached Frame #12294

JayKaku opened this issue Apr 18, 2024 · 18 comments

Comments

@JayKaku
Copy link

JayKaku commented Apr 18, 2024

Minimal, reproducible example

const puppeteer = require("puppeteer");

(async () => {
  // Set up Puppeteer
  const browser = await puppeteer.launch({
    headless: true,
    args: ["--disable-features=site-per-process"],
  });
  let page = await browser.newPage();

  // Navigate to LinkedIn
  await page.goto("https://www.linkedin.com/", { waitUntil: "networkidle2" });

  // Set the viewport's width and height
  await page.setViewport({ width: 1920, height: 1080 });

  // Login
  await page.waitForSelector("#session_key");
  await page.type("#session_key", "xxxxxxx");
  await page.type("#session_password", "xxxxxxxx");
  await page.click(".sign-in-form__submit-btn--full-width");


  await page.goto("https://www.linkedin.com/feed/");

  // Wait for the feed to load
  await page.$(".feed-shared-update-v2");

Error string

Error: Attempted to use detached Frame '17600A3A4D0A80CA2CEBA03B03BD7DFB'

Bug behavior

  • Flaky
  • PDF

Background

No response

Expectation

Scrapping the element directly

Reality

Error: Attempted to use detached Frame '17600A3A4D0A80CA2CEBA03B03BD7DFB'

Puppeteer configuration file (if used)

No response

Puppeteer version

22.6.4

Node version

20.12.2

Package manager

npm

Package manager version

10.5.2

Operating system

Windows

Copy link

This issue has an outdated Puppeteer version: 22.6.4. Please verify your issue on the latest 22.6.5 version. Then update the form accordingly.


Analyzer run

@OrKoN
Copy link
Collaborator

OrKoN commented Apr 18, 2024

I am not able to reproduce using the script. Could you provide a non-password protected reproducible example?

@OrKoN
Copy link
Collaborator

OrKoN commented Apr 18, 2024

Tried with my LinkedIn account and it does not reproduce as well. Could you provide a CDP log as described here https://pptr.dev/guides/debugging#log-devtools-protocol-traffic ? Make sure to remove your passwords from the log or other personal information.

@JayKaku
Copy link
Author

JayKaku commented Apr 18, 2024

I am not able to reproduce using the script. Could you provide a non-password protected reproducible example?

So it's working perfectly?

@JayKaku
Copy link
Author

JayKaku commented Apr 18, 2024

Tried with my LinkedIn account and it does not reproduce as well. Could you provide a CDP log as described here https://pptr.dev/guides/debugging#log-devtools-protocol-traffic ? Make sure to remove your passwords from the log or other personal information.

I'll try it out

@OrKoN
Copy link
Collaborator

OrKoN commented Apr 18, 2024

@JayKaku yeah, I had to adjust selectors because the linkedin page accessible to me had a different layout but yeah it logged in, went to the feed and there were no errors

@JayKaku
Copy link
Author

JayKaku commented Apr 18, 2024

  await page.$(".feed-shared-update-v2");

so this is where the error comes for me login and feed is all good, I might've missed to mention this

@JayKaku
Copy link
Author

JayKaku commented Apr 18, 2024

scraper_log.txt
Is this the type of file you were expecting @OrKoN ? This is the 4th command that is being run

@OrKoN
Copy link
Collaborator

OrKoN commented Apr 19, 2024

This log filtered out all CDP messages, we would need one with protocol messages, e.g., env DEBUG="puppeteer:*"

@JayKaku
Copy link
Author

JayKaku commented Apr 19, 2024

@OrKoN here, is this the one?
scraper_log_full.txt

@OrKoN
Copy link
Collaborator

OrKoN commented Apr 22, 2024

Thanks! I can see that there is a message in

2024-04-19T16:10:10.237Z puppeteer:protocol:RECV ◀ [
  '{"method":"Inspector.detached","params":{"reason":"Render process gone."},"sessionId":"B43DC6AB5A76928A2BDD988BFBF40F9B"}'
]

Which indicates that the renderer page has crashed. Can you try to reproduce using the latest version of Puppeteer 22.6.5?

@JayKaku
Copy link
Author

JayKaku commented Apr 22, 2024

Thanks! I can see that there is a message in

2024-04-19T16:10:10.237Z puppeteer:protocol:RECV ◀ [
  '{"method":"Inspector.detached","params":{"reason":"Render process gone."},"sessionId":"B43DC6AB5A76928A2BDD988BFBF40F9B"}'
]

Which indicates that the renderer page has crashed. Can you try to reproduce using the latest version of Puppeteer 22.6.5?

Just tried it out same error persists in the latest version as well

@OrKoN
Copy link
Collaborator

OrKoN commented Apr 22, 2024

@JayKaku could you try with the latest Canary build of Chrome?

@EwertonDiniz
Copy link

I have the same error! on version 22.6.5 and Latest build of Chrome.

@JayKaku
Copy link
Author

JayKaku commented Apr 27, 2024

@JayKaku could you try with the latest Canary build of Chrome?

Canary builds looks a little more unstable, await page.goto("https://www.linkedin.com/feed/"); too leads to Attempted to used detached Frame error so I removed that line and tried it failed again at await page.$(".feed-shared-update-v2");

@OrKoN
Copy link
Collaborator

OrKoN commented Apr 28, 2024

@JayKaku could you test without the args: ["--disable-features=site-per-process"]?

@OrKoN
Copy link
Collaborator

OrKoN commented Apr 28, 2024

When running with Canary, re-use the same userDataDir and enable crash reporting at chrome://crashes/ after a crash you can restart the browser, and get the crash ID from chrome://crashes Share the crash ID so that we could get more details about why the browser crashes.

@JayKaku
Copy link
Author

JayKaku commented Apr 29, 2024

@JayKaku could you test without the args: ["--disable-features=site-per-process"]?

Let me try this out and get back

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants