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

[BUG] Error: page.goto: Navigation failed because page crashed! #6202

Closed
web-padawan opened this issue Apr 15, 2021 · 9 comments
Closed

[BUG] Error: page.goto: Navigation failed because page crashed! #6202

web-padawan opened this issue Apr 15, 2021 · 9 comments
Assignees
Labels
browser-webkit upstream This is a bug in something playwright depends on, like a browser.

Comments

@web-padawan
Copy link

web-padawan commented Apr 15, 2021

Context:

  • Playwright Version: 1.10.0
  • Operating System: Mac, Linux (GitHub Actions)
  • Node.js version: 12.x, 14.x
  • Browser: WebKit

Describe the bug

The problem occurs when running tests using @web/test-runner-playwright with Playwright 1.10.0

Here is the error message:

Error: page.goto: Navigation failed because page crashed!
=========================== logs ===========================
navigating to "about:blank", waiting until "load"
============================================================

Notably, only one of the test files in our project causes this failure. And it's not the heaviest one among our 190+ test files.

It does not feel random as the error goes away when skipping the test suite placed in that file.
But I could not pinpoint which parts of code and e.g. DOM API calls might be related.

Please see the full log with the DEBUG=pw:api flag enabled below:

Full log
$ yarn test:webkit --group vaadin-crud
yarn run v1.22.5
$ DEBUG=pw:api web-test-runner --config web-test-runner-webkit.config.js --group vaadin-crud
  pw:api => browserType.launch started +0ms

Webkit: |██████████                    | 0/3 test files | 0 passed, 0 failed

Running tests...

  pw:api <= browserType.launch succeeded +510ms
  pw:api => browser.newContext started +1ms
  pw:api <= browser.newContext succeeded +122ms
  pw:api => browserContext.newPage started +33ms
  pw:api <= browserContext.newPage succeeded +511ms
  pw:api => page.setViewportSize started +0ms
  pw:api <= page.setViewportSize succeeded +6ms
  pw:api => page.goto started +0ms
  pw:api navigating to "http://localhost:8000/?wtr-session-id=dcd377ac-ede8-4fc1-8c2f-cbd32f8fb00c", waiting until "load" +3ms
  pw:api   navigated to "http://localhost:8000/?wtr-session-id=dcd377ac-ede8-4fc1-8c2f-cbd32f8fb00c" +81ms
  pw:api   "load" event fired +246ms
  pw:api   "domcontentloaded" event fired +1ms
  pw:api <= page.goto succeeded +36ms
Webkit: |██████████                    | 1/3 test files | 16 passed, 0 failed

Running tests...

  pw:api => page.setViewportSize started +13ms
  pw:api <= page.setViewportSize succeeded +9ms
  pw:api => page.goto started +0ms
  pw:api navigating to "http://localhost:8000/?wtr-session-id=9ec4bd19-43ae-4bfc-ae73-0a85ea872ddf", waiting until "load" +10ms
  pw:api   navigated to "http://localhost:8000/?wtr-session-id=9ec4bd19-43ae-4bfc-ae73-0a85ea872ddf" +126ms
  pw:api   "domcontentloaded" event fired +5ms
  pw:api   "load" event fired +82ms
  pw:api <= page.goto succeeded +4ms
  pw:api   "networkidle" event fired +1s
Webkit: |████████████████████          | 2/3 test files | 43 passed, 0 failed

Running tests...

  pw:api => page.setViewportSize started +2ms
  pw:api <= page.setViewportSize succeeded +4ms
  pw:api => page.goto started +0ms
  pw:api navigating to "http://localhost:8000/?wtr-session-id=e074862f-fd73-4451-b565-6f98f2bc5086", waiting until "load" +0ms
  pw:api   navigated to "http://localhost:8000/?wtr-session-id=e074862f-fd73-4451-b565-6f98f2bc5086" +80ms
  pw:api   "domcontentloaded" event fired +101ms
  pw:api   "load" event fired +5ms
Webkit: |██████████████████████████████| 3/3 test files | 43 passed, 0 failed
packages/vaadin-crud/test/crud.test.js:

 ❌ Tests were interrupted because the browser disconnected.

 ❌ Error: page.goto: Navigation failed because page crashed!
=========================== logs ===========================
navigating to "about:blank", waiting until "load"
============================================================
Note: use DEBUG=pw:api environment variable to capture Playwright logs.
    page.goto: Navigation failed because page crashed!
    =========================== logs ===========================
    navigating to "about:blank", waiting until "load"
    ============================================================
    Note: use DEBUG=pw:api environment variable to capture Playwright logs.
    Error
        at Object.captureStackTrace (/Users/sergey/vaadin/vaadin-web-components/node_modules/playwright/lib/utils/stackTrace.js:48:19)
        at Connection.sendMessageToServer (/Users/sergey/vaadin/vaadin-web-components/node_modules/playwright/lib/client/connection.js:69:48)
        at Proxy.<anonymous> (/Users/sergey/vaadin/vaadin-web-components/node_modules/playwright/lib/client/channelOwner.js:64:61)
        at /Users/sergey/vaadin/vaadin-web-components/node_modules/playwright/lib/client/frame.js:102:65
        at Frame._wrapApiCall (/Users/sergey/vaadin/vaadin-web-components/node_modules/playwright/lib/client/channelOwner.js:77:34)
        at Frame.goto (/Users/sergey/vaadin/vaadin-web-components/node_modules/playwright/lib/client/frame.js:100:21)
        at /Users/sergey/vaadin/vaadin-web-components/node_modules/playwright/lib/client/page.js:296:60
        at Page._attributeToPage (/Users/sergey/vaadin/vaadin-web-components/node_modules/playwright/lib/client/page.js:231:20)
        at Page.goto (/Users/sergey/vaadin/vaadin-web-components/node_modules/playwright/lib/client/page.js:296:21)
        at PlaywrightLauncherPage.stopSession (/Users/sergey/vaadin/vaadin-web-components/node_modules/@web/test-runner-playwright/dist/PlaywrightLauncherPage.js:32:35)

Webkit: |██████████████████████████████| 3/3 test files | 43 passed, 0 failed

Error while running tests.

  pw:api <= browser.close succeeded +55ms
error Command failed with exit code 1.

Note

@mxschmitt
Copy link
Member

Could you try the latest dev version of Playwright? I remember a crash was fixed recently but it's not yet in a stable release.

npm install playwright@next

@web-padawan
Copy link
Author

web-padawan commented Apr 15, 2021

I have tried playwright@1.11.0-next-alpha-apr-15-2021 and the crash is still there.

Steps to reproduce:

  1. git clone https://github.com/vaadin/web-components
  2. git checkout playwright-next
  3. yarn
  4. yarn test:webkit --group vaadin-crud

The error message is the same.

@mxschmitt
Copy link
Member

Thanks for the reproducible, I can verify that it crashes on tip-of-tree. Extracted logs:

  pw:browser [pid=45024][err] 1   0x7f2eebb0b78f WTFCrash +2s
  pw:browser [pid=45024][err] 2   0x7f2ee92e3f43 WebCore::SlotAssignment::assignedNodesForSlot(WebCore::HTMLSlotElement const&, WebCore::ShadowRoot&) +1ms
  pw:browser [pid=45024][err] 3   0x7f2ee94e9fca WebCore::HTMLSlotElement::assignedNodes() const +2ms
  pw:browser [pid=45024][err] 4   0x7f2ee91d450d WebCore::ComposedTreeIterator::traverseNextInShadowTree() +2ms
  pw:browser [pid=45024][err] 5   0x7f2ee9ef2c0c WebCore::RenderTreeUpdater::tearDownRenderers(WebCore::Element&, WebCore::RenderTreeUpdater::TeardownType, WebCore::RenderTreeBuilder&) +2ms
  pw:browser [pid=45024][err] 6   0x7f2ee9ef2f80 WebCore::RenderTreeUpdater::tearDownRenderers(WebCore::Element&) +2ms
  pw:browser [pid=45024][err] 7   0x7f2ee924e325 WebCore::Element::insertedIntoAncestor(WebCore::Node::InsertionType, WebCore::ContainerNode&) +1ms
  pw:browser [pid=45024][err] 8   0x7f2ee91e571b /home/max/.cache/ms-playwright/webkit-1462/minibrowser-wpe/lib/libWPEWebKit-1.0.so.3(+0x360e71b) [0x7f2ee91e571b] +2ms
  pw:browser [pid=45024][err] 9   0x7f2ee91e5a78 WebCore::notifyChildNodeInserted(WebCore::ContainerNode&, WebCore::Node&) +2ms
  pw:browser [pid=45024][err] 10  0x7f2ee91cfa76 WebCore::ContainerNode::appendChildWithoutPreInsertionValidityCheck(WebCore::Node&) +2ms
  pw:browser [pid=45024][err] 11  0x7f2ee91d094e WebCore::ContainerNode::appendChild(WebCore::Node&) +1ms
  pw:browser [pid=45024][err] 12  0x7f2ee929bfd5 WebCore::Node::appendChild(WebCore::Node&) +3ms
  pw:browser [pid=45024][err] 13  0x7f2ee87a58f8 /home/max/.cache/ms-playwright/webkit-1462/minibrowser-wpe/lib/libWPEWebKit-1.0.so.3(+0x2bce8f8) [0x7f2ee87a58f8] +1ms
  pw:browser [pid=45024][err] 14  0x7f2ea03ff1d8 [0x7f2ea03ff1d8] 

@web-padawan
Copy link
Author

Based on the above stacktrace, it seems to be a regression to some slot distribution mechanism in WebKit.
That could explain why only this particular component fails, as it uses slots extensively.

What should be the action point here? Should we submit an issue to the WebKit bug tracker?
Or could this be an issue specific to the WebKit build that Playwright is using?

@mxschmitt
Copy link
Member

Seems like it was already reported in their bug tracker: https://bugs.webkit.org/show_bug.cgi?id=224408

@dgozman dgozman added the P2-bug label Apr 15, 2021
@mxschmitt mxschmitt added the upstream This is a bug in something playwright depends on, like a browser. label Apr 19, 2021
@web-padawan
Copy link
Author

This issue is apparently present in Safari 14.1.1.

@web-padawan
Copy link
Author

@mxschmitt the linked WebKit bug is now fixed. So I guess now it remains to update it to the latest version.

@mxschmitt
Copy link
Member

mxschmitt commented Jun 22, 2021

We update WebKit quite regularly. So it should be probably then included in v1.13 with the next roll.

@mxschmitt mxschmitt assigned aslushnikov and unassigned yury-s Jun 30, 2021
@mxschmitt
Copy link
Member

I verified this works now in the latest dev version. You can try it via the development releases via npm install playwright@next or wait for 1.13.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
browser-webkit upstream This is a bug in something playwright depends on, like a browser.
Projects
None yet
Development

No branches or pull requests

5 participants