Code Monkey home page Code Monkey logo

Comments (13)

route avatar route commented on June 4, 2024 1

@tisba I'm pretty sure you started to use new Chrome 119 which broke something. Check your logs before on the successful build and after it started to fail for Chrome version.

from ferrum.

route avatar route commented on June 4, 2024 1

Chrome 119 started to send:

{"method":"Page.frameStoppedLoading","params":{"frameId":"69FE7B40C52D828E8A4681686395EAC8"}}

for the main request which was always missing before. In fact Chrome was always returning an error for the main request:

◀ 0.6014469999936409 {"method":"Network.loadingFailed","params":{"requestId":"B6E447A057194D37B4873953C9448868","timestamp":353280.996004,"type":"Document","errorText":"net::ERR_ABORTED","canceled":true}}
◀ 0.6015239999978803 {"id":1011,"result":{"frameId":"69FE7B40C52D828E8A4681686395EAC8","loaderId":"B6E447A057194D37B4873953C9448868","errorText":"net::ERR_ABORTED"}}

but was missing to send Page.frameStoppedLoading this is why it broke now.

I believe it works like this because it downloads file in the subprocess, and it doesn't make sense for it to continue main request since it's the same file, so it always cancels main request and starts subprocess to download file. When download is finished the browser gets notification or in case of headless instance Page.downloadProgress is returned with status completed.

  1. Technically speaking page.go_to("/filename") is always failing when we download file because errorText's returned and by protocol it means: User friendly error message, present if and only if navigation has failed. So we must raise an error. I understand that it's frustrating, I think in this case we can consider net::ERR_ABORTED as due to user action or download and not raise an error.
  2. A file can be 100Kb or 1Gb and currently there's no option to wait until download is finished. We must implement this feature.

/cc @tisba @nickhammond

from ferrum.

nickhammond avatar nickhammond commented on June 4, 2024 1

@route Nice work! I'll update our app to point to this version.

from ferrum.

route avatar route commented on June 4, 2024

I assume you are opening file directly with go_to?

from ferrum.

nickhammond avatar nickhammond commented on June 4, 2024

@route Yes, to the https://example.com/download/data.xlsx URL after we've figured out what other parameters that need to be added to it.

from ferrum.

tisba avatar tisba commented on June 4, 2024

I'm not 100% sure if I see the same issue. When updating to ferrum 0.14 (from 0.13) which I'm using indirectly via cuprite (0.14.3 → 0.15).

On GitHub Actions we now have a test consistently failing, although I'm having a hard time reproducing it locally. It is failing here:

visit download_file_fixture_path(file)

with:

[…]
Ferrum::StatusError:
  Request to http://app.localhost:41805//ds/94ty7cwb/download failed (net::ERR_ABORTED)
[…]

EDIT: Interestingly I can reproduce it on my x86 MacBook Pro 🤔

from ferrum.

tisba avatar tisba commented on June 4, 2024

Good point, I totally forgot about Chrome itself 🤦‍♂️

Can't access my M1 MacBook Pro right now to check the version where it worked. On my x86 MacBook Pro (using Docker) I can reproduce the issue with:

  • Chromium 118.0.5993.0 - that's the version I had initially; exact same version I'm getting at GitHub Actions
  • Chromium 119.0.6045.105 - fails also

Downgrading to Chromium 116.0.5845.180 fixed the issue locally.

I can find references to ERR_ABORTED in logs for all versions. It's a lot of output, anything in particular you want me to look for, @route?

from ferrum.

tisba avatar tisba commented on June 4, 2024

Maybe there is an issue with Chrome versions, but this feels more related to upgrading ferrum (0.13 -> 0.14) and/or cuprite (0.14.3 → 0.15). With the identical Chrome version it works before the update and breaks consistently after.

from ferrum.

route avatar route commented on June 4, 2024

I doubt that because you can see latest builds of ferrum https://github.com/rubycdp/ferrum/commits/main

from ferrum.

tisba avatar tisba commented on June 4, 2024

Need some more time building a simplified example. At least in our case, the issue is not occuring when staying at ferrum 0.13 and cuprite 0.14.3, both locally on my MacBook Pro (x86) as well as on GitHub Actions 🤷

from ferrum.

route avatar route commented on June 4, 2024

@nickhammond can you tell me your Chrome version?

from ferrum.

nickhammond avatar nickhammond commented on June 4, 2024

@route I'll have to test again to ensure it's still happening since I ended up patching and pointing to my own fork.

Chrome: 118.0.5993.70
Patch: nickhammond@b2bc606

from ferrum.

nickhammond avatar nickhammond commented on June 4, 2024

@route Nice digging, appreciate the context! Yah, when I was looking through that network log I wasn't entirely sure what looked normal and what didn't.

from ferrum.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.