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]: CDP NetworkInterceptor warning when reading request body/contents #15013

Open
MichailiK opened this issue Jan 2, 2025 · 3 comments
Labels
I-defect I-issue-template Applied to issues not following the template, or missing information. needs-triaging

Comments

@MichailiK
Copy link

MichailiK commented Jan 2, 2025

What happened?

Whenever the request contents of a request gets read, a warning message gets logged, which can be pretty huge, as it dumps the entire request, including headers & contents. For my usage, this doesn't seem to be causing any actual issues though.

How can we reproduce the issue?

See repository for a simple'ish example: https://github.com/MichailiK/NetworkInterceptorBug

(Build the project using mvn package, then run using java -jar target/NetworkInterceptorBug-1.0-SNAPSHOT-All.jar)

The repro is inconsistent & may require several runs. I believe this is a race condition.

If I had a semi-educated guess on what is going on: Because I am closing the network interceptor right after I receive the needed request body, Selenium may disable the Fetch domain before its entirely done processing (?) the last intercepted request.

Relevant log output

Log output
Jan 26, 2025 1:57:36 PM org.openqa.selenium.devtools.Connection$Listener lambda$onText$0
WARNING: Unable to process: {"method":"Fetch.requestPaused","params":{"requestId":"interception-job-4.0","request":{"url":"http://localhost:8080/favicon.ico","method":"GET","headers":{"Accept":"image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8","Referer":"http://localhost:8080/api/register","User-Agent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36","sec-ch-ua":"\"Not A(Brand\";v=\"8\", \"Chromium\";v=\"132\"","sec-ch-ua-mobile":"?0","sec-ch-ua-platform":"\"Linux\""},"initialPriority":"High","referrerPolicy":"strict-origin-when-cross-origin"},"frameId":"8428DA1E9F7D2E8145B16B07CD404D69","resourceType":"Other"},"sessionId":"38CE9D37707C4427FA42B5B89B0CC98F"}
org.openqa.selenium.devtools.DevToolsException: {"id":16,"error":{"code":-32000,"message":"Fetch domain is not enabled"},"sessionId":"38CE9D37707C4427FA42B5B89B0CC98F"}
Build info: version: '4.28.0', revision: 'ac342546e9'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.6.52', java.version: '17.0.13'
Driver info: driver.version: unknown
        at org.openqa.selenium.devtools.Connection.sendAndWait(Connection.java:195)
        at org.openqa.selenium.devtools.DevTools.send(DevTools.java:94)
        at org.openqa.selenium.devtools.DevTools.send(DevTools.java:89)
        at org.openqa.selenium.devtools.idealized.Network.lambda$prepareToInterceptTraffic$4(Network.java:236)
        at org.openqa.selenium.remote.http.Filter.lambda$andFinally$1(Filter.java:55)
        at org.openqa.selenium.devtools.idealized.Network.lambda$prepareToInterceptTraffic$5(Network.java:264)
        at org.openqa.selenium.devtools.DevTools.lambda$addListener$0(DevTools.java:108)
        at org.openqa.selenium.devtools.Connection.lambda$handle$5(Connection.java:348)
        at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
        at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
        at java.base/java.util.stream.ReferencePipeline$15$1.accept(ReferencePipeline.java:541)
        at java.base/java.util.HashMap$EntrySpliterator.forEachRemaining(HashMap.java:1850)
        at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
        at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
        at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
        at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
        at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
        at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
        at org.openqa.selenium.devtools.Connection.handle(Connection.java:311)
        at org.openqa.selenium.devtools.Connection$Listener.lambda$onText$0(Connection.java:239)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
        at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: org.openqa.selenium.WebDriverException: {"id":16,"error":{"code":-32000,"message":"Fetch domain is not enabled"},"sessionId":"38CE9D37707C4427FA42B5B89B0CC98F"}
Build info: version: '4.28.0', revision: 'ac342546e9'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.6.52', java.version: '17.0.13'
Driver info: driver.version: unknown
        at org.openqa.selenium.devtools.Connection.handle(Connection.java:275)
        ... 4 more

Exception in thread "CDP Connection" org.openqa.selenium.devtools.DevToolsException: {"id":16,"error":{"code":-32000,"message":"Fetch domain is not enabled"},"sessionId":"38CE9D37707C4427FA42B5B89B0CC98F"}
Build info: version: '4.28.0', revision: 'ac342546e9'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.6.52', java.version: '17.0.13'
Driver info: driver.version: unknown
        at org.openqa.selenium.devtools.Connection$Listener.lambda$onText$0(Connection.java:242)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
        at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: org.openqa.selenium.devtools.DevToolsException: {"id":16,"error":{"code":-32000,"message":"Fetch domain is not enabled"},"sessionId":"38CE9D37707C4427FA42B5B89B0CC98F"}
Build info: version: '4.28.0', revision: 'ac342546e9'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.6.52', java.version: '17.0.13'
Driver info: driver.version: unknown
        at org.openqa.selenium.devtools.Connection.sendAndWait(Connection.java:195)
        at org.openqa.selenium.devtools.DevTools.send(DevTools.java:94)
        at org.openqa.selenium.devtools.DevTools.send(DevTools.java:89)
        at org.openqa.selenium.devtools.idealized.Network.lambda$prepareToInterceptTraffic$4(Network.java:236)
        at org.openqa.selenium.remote.http.Filter.lambda$andFinally$1(Filter.java:55)
        at org.openqa.selenium.devtools.idealized.Network.lambda$prepareToInterceptTraffic$5(Network.java:264)
        at org.openqa.selenium.devtools.DevTools.lambda$addListener$0(DevTools.java:108)
        at org.openqa.selenium.devtools.Connection.lambda$handle$5(Connection.java:348)
        at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
        at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
        at java.base/java.util.stream.ReferencePipeline$15$1.accept(ReferencePipeline.java:541)
        at java.base/java.util.HashMap$EntrySpliterator.forEachRemaining(HashMap.java:1850)
        at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
        at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
        at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
        at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
        at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
        at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
        at org.openqa.selenium.devtools.Connection.handle(Connection.java:311)
        at org.openqa.selenium.devtools.Connection$Listener.lambda$onText$0(Connection.java:239)
        ... 3 more
Caused by: org.openqa.selenium.WebDriverException: {"id":16,"error":{"code":-32000,"message":"Fetch domain is not enabled"},"sessionId":"38CE9D37707C4427FA42B5B89B0CC98F"}
Build info: version: '4.28.0', revision: 'ac342546e9'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.6.52', java.version: '17.0.13'
Driver info: driver.version: unknown
        at org.openqa.selenium.devtools.Connection.handle(Connection.java:275)
        ... 4 more

Operating System

NixOS 24.11

Selenium version

Java 4.28.0

What are the browser(s) and version(s) where you see this issue?

Chromium 132.0.6834.110

What are the browser driver(s) and version(s) where you see this issue?

ChromeDriver 132.0.6834.110

Are you using Selenium Grid?

No response

Copy link

github-actions bot commented Jan 2, 2025

@MichailiK, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

@pujagani pujagani added the I-issue-template Applied to issues not following the template, or missing information. label Jan 10, 2025
Copy link

Hi, @MichailiK.
Please follow the issue template, we need more information to reproduce the issue.

Either a complete code snippet and URL/HTML (if more than one file is needed, provide a GitHub repo and instructions to run the code), the specific versions used, or a more detailed description to help us understand the issue.

Note: If you cannot share your code and URL/HTML, any complete code snippet and URL/HTML that reproduces the issue is good enough.

Reply to this issue when all information is provided, thank you.

@MichailiK
Copy link
Author

MichailiK commented Jan 26, 2025

I've just made this repo: https://github.com/MichailiK/NetworkInterceptorBug

(Make sure Chrome/Chromium 132+ is installed, cd into the repo, build the project using mvn package, then run using java -jar target/NetworkInterceptorBug-1.0-SNAPSHOT-All.jar)

The repro is inconsistent & may require several runs. I believe this is a race condition:

Image

If I had a semi-educated guess on what is going on: Once I find the request I want to intercept, I read its request body & then I try to close/cleanup Selenium immediately. As I close() the network interceptor, Selenium may disable the Fetch domain before its entirely done processing (?) the last intercepted request.

A workaround to avoid this warning could be to wait/sleep a little bit before cleaning up & thus closing the network interceptor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-defect I-issue-template Applied to issues not following the template, or missing information. needs-triaging
Projects
None yet
Development

No branches or pull requests

2 participants