How to handle error while running lighthouse for multiple URLs
See original GitHub issueI am running lighthouse on multiple URLs, out of that couple of URLs fails due to some error like timeout error or 500 status code, 403 …etc So lighthouse exits with code 0 and uploading fails.
Is there any way we can upload partial success reports to LHCI server?
Below is the error we get while running lighthouse
18:00:00 Running Lighthouse 1 time(s) on https://somedomain.com/1
18:01:30 Run #1...done.
18:01:43 Running Lighthouse 1 time(s) on https://somedomain.com/2
18:02:26 Run #1...done.
18:02:49 Running Lighthouse 1 time(s) on https://somedomain.com/3
18:03:28 Run #1...failed!
18:03:28 Error: Lighthouse failed with exit code 1
18:03:28 at ChildProcess.<anonymous> (/node_modules/@lhci/cli/src/collect/lighthouse-runner.js:103:21)
18:03:28 at ChildProcess.emit (events.js:314:20)
18:03:28 at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
18:03:28 {
18:03:28 "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.75 Safari/537.36",
18:03:28 "environment": {
18:03:28 "networkUserAgent": "",
18:03:28 "hostUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.75 Safari/537.36",
18:03:28 "benchmarkIndex": 16
18:03:28 },
18:03:28 "lighthouseVersion": "5.5.0",
18:03:28 "fetchTime": "2021-01-12T12:33:12.727Z",
18:03:28 "requestedUrl": "https://somedomain.com/3",
18:03:28 "finalUrl": "https://somedomain.com/3",
18:03:28 "runWarnings": [
18:03:28 "Lighthouse was unable to reliably load the page you requested. Make sure you are testing the correct URL and that the server is properly responding to all requests. (Status code: 500)"
18:03:28 ],
18:03:28 "runtimeError": {
18:03:28 "code": "ERRORED_DOCUMENT_REQUEST",
18:03:28 "message": "Lighthouse was unable to reliably load the page you requested. Make sure you are testing the correct URL and that the server is properly responding to all requests. (Status code: 500)"
18:03:28 },
Issue Analytics
- State:
- Created 3 years ago
- Comments:5
Top Results From Across the Web
GoogleChrome/lighthouse - Gitter
Im consistently getting error by running lighthouse on kubernetes pod only for some of URL. Logs on the server shows the request is...
Read more >Using Google Lighthouse with multiple sites simultaneously in ...
The best solution would be to use lasso or lighthouse lambda parallel for cloud computing, but i'm not a big fan of google...
Read more >lighthouse - npm
Run it: open Chrome DevTools, select the Lighthouse panel, and hit "Generate report". Lighthouse integration in Chrome DevTools. Using the ...
Read more >The Magic of Running Multiple Lighthouse Performance Tests ...
The script simply specifies the json file with the list of URLs to run the performance tests against and then kicks off Lighthouse....
Read more >Continuously optimize your website with Lighthouse CI
You can run Lighthouse in Chrome DevTools, from the command line, or as a Node module. You give Lighthouse a URL to audit, ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You can’t achieve the specific behavior you want just from the configuration file.
autorun
is meant for the majority of common use cases but when you’d like any custom logic like what you’re talking about here, that’s what the individual commands for each step are there for 😃We have many proposed hooks along the lines of what I think you’re asking for, but none I can foresee that would handle arbitrary catching of fatal errors such as this one in a way that allows LHCI to continue as normal.
If you have a proposal for a specific hook into LHCI you’d like to see and how it would work, please feel free to add details in #438 😃
(FWIW, this situation alone wouldn’t be enough to justify it. As I currently understand it, what you want to do is already easily accomplished with ~3 lines of a bash script whereas the compelling examples in #438 are currently impossible)