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

Browser module panic: panic: GoError: attaching iframe: attaching iframe target #4568

Open
oleiade opened this issue Feb 20, 2025 · 2 comments
Labels

Comments

@oleiade
Copy link
Member

oleiade commented Feb 20, 2025

Brief summary

We recently encountered a panic in production, where the browser module was involved, and the panic message was: panic: GoError: attaching iframe: attaching iframe target ID 1CBA32F4B61E5DA9F9152E2054197AB8 to session ID 6E55DF7D9B0CC0A14B4AB572496A19D3: getting page frame tree: websocket: close 1006 (abnormal closure): unexpected EOF. See 👇 for more details.

Happy to share more context to internals on demand 🙇🏻

k6 version

v0.57.0

OS

Linux

Docker version and image (if applicable)

No response

Steps to reproduce the problem

Execution parameters and configuration in general looks rather normal, and the source script, despite having multiple scenarios, does some pretty standard stuff involving the browser module. Most of the scenario functions look somewhat like the following:

export async function myFunction() {
  const context = await browser.newContext();
  const page = await context.newPage();
  await page.setViewportSize({ width: 1425, height: 1818 });

  try {
    await page.goto(`${BASE_URL[env]}/search?term=Left+Right`);

    await check(page.locator('h1.globalSearch__header:nth-child(3)'), {
      header: async (lo) =>
        (await lo.textContent()) == 'Showing X results for Left Right',
    });
    await page.screenshot({ path: 'screenshots/gs.png' });
  } finally {
    await page.close();
  }
}

Expected behaviour

Actual behaviour

It led to the following stacktrace:

panic: GoError: attaching iframe: attaching iframe target ID 1CBA32F4B61E5DA9F9152E2054197AB8 to session ID 6E55DF7D9B0CC0A14B4AB572496A19D3: getting page frame tree: websocket: close 1006 (abnormal closure): unexpected EOF

goroutine 223961 [running]:
go.k6.io/k6/js/common.Throw(...)
go.k6.io/k6/js/common/util.go:17
go.k6.io/k6/internal/js/modules/k6/browser/k6ext.Panic.func1(0xc0006ea008, {0xc0055f3560?, 0x1f9a710?, 0xc004a22301?})
go.k6.io/k6/internal/js/modules/k6/browser/k6ext/panic.go:35 +0x74
go.k6.io/k6/internal/js/modules/k6/browser/k6ext.sharedPanic({0x1fbb688, 0xc004a402d0}, 0xc0077e9c88, {0xc0055f3560, 0x2, 0x2})
go.k6.io/k6/internal/js/modules/k6/browser/k6ext/panic.go:64 +0x274
go.k6.io/k6/internal/js/modules/k6/browser/k6ext.Panic({0x1fbb688?, 0xc004a402d0?}, {0x1c500b2?, 0x2fa5640?}, {0xc0055f3560?, 0x0?, 0xc0077e9e08?})
go.k6.io/k6/internal/js/modules/k6/browser/k6ext/panic.go:37 +0x4b
go.k6.io/k6/internal/js/modules/k6/browser/common.(*FrameSession).onAttachedToTarget(0xc0005a0e40, 0xc004aac4e0)
go.k6.io/k6/internal/js/modules/k6/browser/common/frame_session.go:998 +0x619
go.k6.io/k6/internal/js/modules/k6/browser/common.(*FrameSession).initEvents.func1()
go.k6.io/k6/internal/js/modules/k6/browser/common/frame_session.go:305 +0x233
created by go.k6.io/k6/internal/js/modules/k6/browser/common.(*FrameSession).initEvents in goroutine 220948
go.k6.io/k6/internal/js/modules/k6/browser/common/frame_session.go:241 +0x19b
@oleiade oleiade added the bug label Feb 20, 2025
@oleiade oleiade assigned inancgumus and ankur22 and unassigned inancgumus and ankur22 Feb 20, 2025
@oleiade
Copy link
Member Author

oleiade commented Feb 20, 2025

For your eyes @inancgumus @ankur22. I tried looking on it, but I feel a bit like stabbing in the dark 🙇🏻

@inancgumus
Copy link
Member

I can't reproduce it locally. This might be a glitch, as the other tests run without issues. Still, it might make sense to run this on the previous version to be sure we didn't break anything.

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

No branches or pull requests

3 participants