Open srvraja opened 1 year ago
Hi @srvraja thank you for creating the issue. Hmm you get error messages from "Failed parsing rule" - I haven't seen that either before.
I guess ECONNREFUSED 127.0.0.1:51177 is for Chrome dev tools, but it seems like high port number.
If you upgrade to use latest sitespeed.io (that way you will get newer versions of Chromedriver) do you get the same error?
Best Peter
@soulgalore
Thanks for your time.
I downloaded the latest version(sitespeed v27.6.4, Node.js v18.16.0) and got the below error. Are any other configurations missing?
node:internal/errors:490 ErrorCaptureStackTrace(err); ^
TypeError [ERR_INVALID_URL_SCHEME]: The URL must be of scheme file at open (node:internal/fs/promises:538:10) at readFile (node:internal/fs/promises:909:20) at parseCommandLine (file:///C:/SitespeedioMain/sitespeed.io-main/lib/cli/cli.js:2050:13) at start (file:///C:/SitespeedioMain/sitespeed.io-main/bin/sitespeed.js:119:22) at file:///C:/SitespeedioMain/sitespeed.io-main/bin/sitespeed.js:178:7 { code: 'ERR_INVALID_URL_SCHEME' }
@soulgalore
The above 'ERR_INVALID_URL_SCHEME' got resolved when I renamed the scripted file from demo.js to demo.cjs.
The initial reported issue persisted in the latest sitespeed version.
[2023-05-22 10:14:30] INFO: Versions OS: win32 10.0.14393 nodejs: v18.16.0 sitespeed.io: 25.7.3 browsertime: ^16.13.3 coach: 7.1.2 [2023-05-22 10:14:31] INFO: Running tests using Chrome - 3 iteration(s) [4300:2448:0522/101431.865:ERROR:host_mapping_rules.cc(146)] Failed parsing rule: "MAP cache.pack.google.com 127.0.0.1" [4300:2448:0522/101431.881:ERROR:host_mapping_rules.cc(146)] Failed parsing rule: "MAP clients1.google.com 127.0.0.1" [4300:2448:0522/101431.881:ERROR:host_mapping_rules.cc(146)] Failed parsing rule: "MAP update.googleapis.com 127.0.0.1" [4300:2448:0522/101431.881:ERROR:host_mapping_rules.cc(146)] Failed parsing rule: "MAP redirector.gvt1.com 127.0.0.1" [4300:2448:0522/101431.881:ERROR:host_mapping_rules.cc(146)] Failed parsing rule: "MAP laptop-updates.brave.com 127.0.0.1" [4300:2448:0522/101431.881:ERROR:host_mapping_rules.cc(146)] Failed parsing rule: "MAP offlinepages-pa.googleapis.com 127.0.0.1" [4300:2448:0522/101431.881:ERROR:host_mapping_rules.cc(146)] Failed parsing rule: "MAP edge.microsoft.com 127.0.0.1" [4300:2448:0522/101431.881:ERROR:host_mapping_rules.cc(146)] Failed parsing rule: "MAP optimizationguide-pa.googleapis.com 127.0.0.1"
DevTools listening on ws://127.0.0.1:9222/devtools/browser/9ac46f47-6a57-469c-b6a0-073210ec7d83 [4300:2448:0522/101432.029:ERROR:host_mapping_rules.cc(146)] Failed parsing rule: "MAP cache.pack.google.com 127.0.0.1" [4300:2448:0522/101432.047:ERROR:host_mapping_rules.cc(146)] Failed parsing rule: "MAP clients1.google.com 127.0.0.1" [4300:2448:0522/101432.053:ERROR:host_mapping_rules.cc(146)] Failed parsing rule: "MAP update.googleapis.com 127.0.0.1" [4300:2448:0522/101432.055:ERROR:host_mapping_rules.cc(146)] Failed parsing rule: "MAP redirector.gvt1.com 127.0.0.1" [4300:2448:0522/101432.063:ERROR:host_mapping_rules.cc(146)] Failed parsing rule: "MAP laptop-updates.brave.com 127.0.0.1" [4300:2448:0522/101432.079:ERROR:host_mapping_rules.cc(146)] Failed parsing rule: "MAP offlinepages-pa.googleapis.com 127.0.0.1" [4300:2448:0522/101432.080:ERROR:host_mapping_rules.cc(146)] Failed parsing rule: "MAP edge.microsoft.com 127.0.0.1" [4300:2448:0522/101432.081:ERROR:host_mapping_rules.cc(146)] Failed parsing rule: "MAP optimizationguide-pa.googleapis.com 127.0.0.1" [2023-05-22 10:14:32] INFO: Start to measure homepage_trial [2023-05-22 10:14:32] INFO: Navigating to url https://www.dummy.com/ iteration 1 [2023-05-22 10:14:42] INFO: Take after page complete check screenshot [2023-05-22 10:14:44] INFO: Take cumulative layout shift screenshot [2023-05-22 10:14:46] INFO: Take largest contentful paint screenshot [2023-05-22 10:14:49] INFO: Start to measure click_on_accept_button [2023-05-22 10:14:49] ERROR: Couldn't execute script named CUSTOM error:JavascriptError: javascript error: Cannot read properties of null (reading 'click') (Session info: chrome=113.0.5672.127) [2023-05-22 10:14:49] ERROR: Could not find element by xpath //[@id="onetrust-accept-btns-handlers"] [2023-05-22 10:14:49] ERROR: Error: Could not find element by xpath //[@id="onetrust-accept-btns-handlers"] at Click.byXpathAndWait (C:\SitespeedioMain\sitespeed.io-main\node_modules\browsertime\lib\core\engine\command\click.js:159:13) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async module.exports (C:\Sitespeedio\sitespeed-script\1.cjs:20:4) at async C:\SitespeedioMain\sitespeed.io-main\node_modules\browsertime\lib\core\engine\run.js:7:9 at async Iteration.run (C:\SitespeedioMain\sitespeed.io-main\node_modules\browsertime\lib\core\engine\iteration.js:223:9) at async Engine.runByScript (C:\SitespeedioMain\sitespeed.io-main\node_modules\browsertime\lib\core\engine\index.js:270:20) at async Object.analyzeUrl (C:\SitespeedioMain\sitespeed.io-main\lib\plugins\browsertime\analyzer.js:171:21) at async Object.processMessage (C:\SitespeedioMain\sitespeed.io-main\lib\plugins\browsertime\index.js:150:26) [2023-05-22 10:14:49] INFO: https://www.dummy.com/ TTFB: 518ms DOMContentLoaded: 1.99s firstPaint: 1.43s FCP: 1.43s LCP: 1.65s Load: 3.01s TBT: 436ms CLS:0.0047 [2023-05-22 10:14:50] INFO: C:\Sitespeedio\sitespeed-script\1.cjs
DevTools listening on ws://127.0.0.1:9222/devtools/browser/ff1da3aa-36d9-4142-95ce-7d8ddc5f8aaa [4360:520:0522/101450.835:ERROR:host_mapping_rules.cc(146)] Failed parsing rule: "MAP cache.pack.google.com 127.0.0.1" [4360:520:0522/101450.838:ERROR:host_mapping_rules.cc(146)] Failed parsing rule: "MAP clients1.google.com 127.0.0.1" [4360:520:0522/101450.839:ERROR:host_mapping_rules.cc(146)] Failed parsing rule: "MAP update.googleapis.com 127.0.0.1" [4360:520:0522/101450.841:ERROR:host_mapping_rules.cc(146)] Failed parsing rule: "MAP redirector.gvt1.com 127.0.0.1" [4360:520:0522/101450.842:ERROR:host_mapping_rules.cc(146)] Failed parsing rule: "MAP laptop-updates.brave.com 127.0.0.1" [4360:520:0522/101450.843:ERROR:host_mapping_rules.cc(146)] Failed parsing rule: "MAP offlinepages-pa.googleapis.com 127.0.0.1" [4360:520:0522/101450.844:ERROR:host_mapping_rules.cc(146)] Failed parsing rule: "MAP edge.microsoft.com 127.0.0.1" [4360:520:0522/101450.845:ERROR:host_mapping_rules.cc(146)] Failed parsing rule: "MAP optimizationguide-pa.googleapis.com 127.0.0.1" [4360:520:0522/101450.960:ERROR:host_mapping_rules.cc(146)] Failed parsing rule: "MAP cache.pack.google.com 127.0.0.1" [4360:520:0522/101450.992:ERROR:host_mapping_rules.cc(146)] Failed parsing rule: "MAP clients1.google.com 127.0.0.1" [4360:520:0522/101450.998:ERROR:host_mapping_rules.cc(146)] Failed parsing rule: "MAP update.googleapis.com 127.0.0.1" [4360:520:0522/101451.101:ERROR:host_mapping_rules.cc(146)] Failed parsing rule: "MAP redirector.gvt1.com 127.0.0.1" [4360:520:0522/101451.108:ERROR:host_mapping_rules.cc(146)] Failed parsing rule: "MAP laptop-updates.brave.com 127.0.0.1" [4360:520:0522/101451.113:ERROR:host_mapping_rules.cc(146)] Failed parsing rule: "MAP offlinepages-pa.googleapis.com 127.0.0.1" [4360:520:0522/101451.115:ERROR:host_mapping_rules.cc(146)] Failed parsing rule: "MAP edge.microsoft.com 127.0.0.1" [4360:520:0522/101451.117:ERROR:host_mapping_rules.cc(146)] Failed parsing rule: "MAP optimizationguide-pa.googleapis.com 127.0.0.1" [2023-05-22 10:14:51] INFO: Start to measure homepage_trial [2023-05-22 10:14:51] INFO: Navigating to url https://www.dummy.com/ iteration 2 C:\SitespeedioMain\sitespeed.io-main\node_modules\selenium-webdriver\http\index.js:294 onError(new Error(message)) ^
Error: ECONNREFUSED connect ECONNREFUSED 127.0.0.1:57652
at ClientRequest.
Face the same issue ,It is good with old version 26
Hi @TerryJLU hmm, I tried the same on a windows GitHub action and there it seems to work: https://github.com/sitespeedio/sitespeed.io/blob/main/.github/workflows/windows.yml#L29-L31
I see NodeJS 18.16.0, can you verify that it's the same version as in node.exe? I guess it is but just wanted to 100% sure.
Yes NodeJS 18.16.0
@soulgalore ,
any chance of looking into 'Error: ECONNREFUSED connect ECONNREFUSED 127.0.0.1:57652' where the execution got crashed when one of the elements not available in the rendered page? You can use the attached script to reproduce it. It is happening with latest version as well.
Thanks for your time, please let me know if you need more information.
@srvraja let me try and add your script to the tests on GitHub action, so I also get that error.
Hi @srvraja hmm we don't get the same here, you can checkout the log from the test here: https://github.com/sitespeedio/sitespeed.io/actions/runs/5266889131/jobs/9521425698?pr=3884
The only difference is that you run the global install. I did a try some time ago to install it globally in the action but my Windows knowledge failed, can you help me to get it installed correctly? Here's a PR for installing sitespeed.io globally on the Windows GitHub action: https://github.com/sitespeedio/sitespeed.io/pull/3860
I updated the PR to try to run with a global install to try to reproduce.
I could reproduce this on Windows in a GitHub action. When the element do not exists, I get a ECONNREFUSED but I haven't been able to figure out why.
@soulgalore ,
Any luck to overcome this?
Gone through the issue https://github.com/sitespeedio/sitespeed.io/issues/4078, will the error handling fix this?
Thanks
I'm not sure, this seems to only happens on Windows. I wonder if people are also seeing this using only Selenium or if it's something on our side? I'm having a problem fixing it since I do not have a windows machine.
@soulgalore I have tested from Mac and RHEL8 instances, getting the same error if the object not found in the scripted journey.
Error: ECONNREFUSED connect ECONNREFUSED 127.0.0.1:59974
at ClientRequest.
Thanks
So you get ECONNREFUSED? Ok can you share a minimal example script that I can use to reproduce? Thanks!
Hi @soulgalore ,
Attaching a script which will do the following. I have tested this in Mac, getting the same ECONNREFUSED error.
Ah thank you @srvraja for taking the time to make the script! I'll have a look.
Hi @srvraja in your script you are throwing an error in the catch block, that's what is causing it. I can fix so we catch that better but I also think it's better not to re-throw. Mark your test as an error and then exit.
Have you read the documentation?
URL
https://demoqa.com/
What are you trying to accomplish
I am experiencing an issue while running a scripted journey in which it is attempting to perform an operation on a 'not found element.' I have tried running the journey for 3 iterations. The scripted journey has 2 measurements, one for launch and the other for clicking where the element is not found.
The first iteration failed with an error indicating that the element was not found. The journey continued to the second iteration, but it failed immediately after launching the second iteration(even measurement for launch didn't happen). I have provided the version used and the specific error that was reported below. Additionally, I have attached the script for your reference. trial_journey_issue.txt
INFO: Versions OS: win32 10.0.14393 nodejs: v16.15.0 sitespeed.io: 25.7.3 browsertime: ^16.13.3 coach: 7.1.2
Error: ECONNREFUSED connect ECONNREFUSED 127.0.0.1:51177 at ClientRequest. (C:\SitespeedioMain\sitespeed.io-main\node_modules\selenium-webdriver\http\index.js:294:15)
at ClientRequest.emit (node:events:527:28)
at Socket.socketErrorListener (node:_http_client:454:9)
at Socket.emit (node:events:527:28)
at emitErrorNT (node:internal/streams/destroy:157:8)
at emitErrorCloseNT (node:internal/streams/destroy:122:3)
at processTicksAndRejections (node:internal/process/task_queues:83:21)
What browser did you use?
Chrome
How to reproduce
Relevant log output