femtopixel / docker-google-lighthouse

Google Lighthouse - Docker Image
https://brands.jaymoulin.me/femtopixel/docker-google-lighthouse
MIT License
70 stars 23 forks source link

Lighthouse hangs since v4.1.0 docker release and throws error event #7

Closed CarbonCollins closed 5 years ago

CarbonCollins commented 5 years ago

Description

Since 31st January our lighthouse reports have been failing when running inside of the femtopixel/google-lighthouse:latest docker image which roughly coincides with the v4.1.0 release. The build hangs for 45 seconds when it is loading the page to test (or longer for however long I set the '--max-wait-for-load' flag. I have tried 5 mins and this still occurs) then once it times out an unhandled error is thrown and the container exits.

Command line I used to start the container docker run -it femtopixel/google-lighthouse:latest bash also occurs when docker image is used within a Jenkins build pipeline using the docker plugin

Steps to reproduce the issue:

  1. run lighthouse https://coolstuff.se --output-path=./se --chrome-flags='--headless --no-sandbox' within the latest docker image

Describe the results you received:

Lighthouse hangs for 45s before crashing out with an error

  ChromeLauncher Waiting for browser. +0ms
  ChromeLauncher Waiting for browser... +1ms
  ChromeLauncher Waiting for browser..... +507ms
  ChromeLauncher Waiting for browser.....✓ +3ms
  status Connecting to browser +133ms
  status Resetting state with about:blank +20ms
  status Benchmarking machine +15ms
  status Initializing… +504ms
  status Loading page & waiting for onload Scripts, CSSUsage, ViewportDimensions, Manifest, RuntimeExceptions, ChromeConsoleMessages, Accessibility, ImageElements, LinkElements, MetaElements, AnchorsWithNoRelNoopener, AppCacheManifest, Doctype, DOMStats, JSLibraries, OptimizedImages, PasswordInputsWithPreventedPaste, ResponseCompression, TagsBlockingFirstPaint, FontSize, CrawlableLinks, Hreflang, EmbeddedContent, Canonical, RobotsTxt +16ms
  Driver:warn Timed out waiting for page load. Checking if page is hung... +45s
  Driver:warn Page appears to be hung, killing JavaScript... +1s
  status Disconnecting from browser... +30s
  ChromeLauncher Killing Chrome instance 124 +15ms
events.js:173
      throw er; // Unhandled 'error' event
      ^

Error: read ECONNRESET
    at TCP.onStreamRead (internal/stream_base_commons.js:162:27)
Emitted 'error' event at:
    at Socket.socketErrorListener (_http_client.js:399:9)
    at Socket.emit (events.js:197:13)
    at emitErrorNT (internal/streams/destroy.js:82:8)
    at emitErrorAndCloseNT (internal/streams/destroy.js:50:3)
    at processTicksAndRejections (internal/process/next_tick.js:76:17)

Describe the results you expected:

I expoect the container to be able to scan the https://coolstuff.se website and not crash. The report generated should eb along the lines of google.co.uk (works if i use a site like google.co.uk):

  ChromeLauncher Waiting for browser. +0ms
  ChromeLauncher Waiting for browser... +0ms
  ChromeLauncher Waiting for browser..... +507ms
  ChromeLauncher Waiting for browser.....✓ +4ms
  status Connecting to browser +127ms
  status Resetting state with about:blank +13ms
  status Benchmarking machine +25ms
  status Initializing… +505ms
  status Loading page & waiting for onload Scripts, CSSUsage, ViewportDimensions, Manifest, RuntimeExceptions, ChromeConsoleMessages, Accessibility, ImageElements, LinkElements, MetaElements, AnchorsWithNoRelNoopener, AppCacheManifest, Doctype, DOMStats, JSLibraries, OptimizedImages, PasswordInputsWithPreventedPaste, ResponseCompression, TagsBlockingFirstPaint, FontSize, CrawlableLinks, Hreflang, EmbeddedContent, Canonical, RobotsTxt +15ms
  status Retrieving in-page: Scripts +2s
  status Retrieving in-page: CSSUsage +0ms
  status Retrieving in-page: ViewportDimensions +1ms
  status Retrieving in-page: Manifest +0ms
  status Retrieving in-page: RuntimeExceptions +0ms
  status Retrieving in-page: ChromeConsoleMessages +0ms
  status Retrieving in-page: Accessibility +1ms
  status Retrieving in-page: ImageElements +0ms
  status Retrieving in-page: LinkElements +0ms
  status Retrieving in-page: MetaElements +0ms
  status Retrieving in-page: AnchorsWithNoRelNoopener +0ms
  status Retrieving in-page: AppCacheManifest +1ms
  status Retrieving in-page: Doctype +0ms
  status Retrieving in-page: DOMStats +0ms
  status Retrieving in-page: JSLibraries +0ms
  status Retrieving in-page: OptimizedImages +0ms
  status Retrieving in-page: PasswordInputsWithPreventedPaste +0ms
  status Retrieving in-page: ResponseCompression +1ms
  status Retrieving in-page: TagsBlockingFirstPaint +0ms
  status Retrieving in-page: FontSize +0ms
  status Retrieving in-page: CrawlableLinks +0ms
  status Retrieving in-page: Hreflang +0ms
  status Retrieving in-page: EmbeddedContent +0ms
  status Retrieving in-page: Canonical +1ms
  status Retrieving in-page: RobotsTxt +0ms
  status Retrieving trace +3ms
  status Retrieving devtoolsLog & network records +64ms
  status Retrieving: Scripts +4ms
  status Retrieving: CSSUsage +19ms
  status Retrieving: ViewportDimensions +30ms
  status Retrieving: Manifest +5ms
  status Retrieving: RuntimeExceptions +0ms
  status Retrieving: ChromeConsoleMessages +0ms
  status Retrieving: Accessibility +1ms
  status Retrieving: ImageElements +262ms
  status Retrieving: LinkElements +5ms
  status Retrieving: MetaElements +2ms
  status Retrieving: AnchorsWithNoRelNoopener +2ms
  status Retrieving: AppCacheManifest +1ms
  status Retrieving: Doctype +3ms
  status Retrieving: DOMStats +1ms
  status Retrieving: JSLibraries +14ms
  status Retrieving: OptimizedImages +13ms
  status Retrieving: PasswordInputsWithPreventedPaste +55ms
  status Retrieving: ResponseCompression +1ms
  status Retrieving: TagsBlockingFirstPaint +2ms
  status Retrieving: FontSize +3ms
  status Retrieving: CrawlableLinks +71ms
  status Retrieving: Hreflang +3ms
  status Retrieving: EmbeddedContent +1ms
  status Retrieving: Canonical +2ms
  status Retrieving: RobotsTxt +3ms
  status Resetting state with about:blank +33ms
  status Loading page & waiting for onload ServiceWorker, Offline, StartUrl +31ms
  status Retrieving in-page: ServiceWorker +52ms
  status Retrieving in-page: Offline +0ms
  status Retrieving in-page: StartUrl +1ms
  status Retrieving devtoolsLog & network records +0ms
  status Retrieving: ServiceWorker +1ms
  status Retrieving: Offline +0ms
  status Retrieving: StartUrl +1ms
  status Resetting state with about:blank +1ms
  status Loading page & waiting for onload HTTPRedirect, HTMLWithoutJavaScript +36ms
  status Retrieving in-page: HTTPRedirect +213ms
  status Retrieving in-page: HTMLWithoutJavaScript +0ms
  status Retrieving devtoolsLog & network records +0ms
  status Retrieving: HTTPRedirect +1ms
  status Retrieving: HTMLWithoutJavaScript +9ms
  status Disconnecting from browser... +7ms
  status Analyzing and running audits... +2ms
  status Evaluating: Uses HTTPS +2ms
  status Evaluating: Redirects HTTP traffic to HTTPS +3ms
  status Evaluating: Registers a service worker that controls page and start_url +0ms
  status Evaluating: Current page responds with a 200 when offline +0ms
  status Evaluating: Has a `<meta name="viewport">` tag with `width` or `initial-scale` +1ms
  status Evaluating: Contains some content when JavaScript is not available +0ms
  status Evaluating: First Contentful Paint +2ms
  status Evaluating: First Meaningful Paint +15ms
  status Evaluating: Page load is fast enough on mobile networks +2ms
  status Evaluating: Speed Index +4ms
  status Evaluating: Screenshot Thumbnails +327ms
  status Evaluating: Final Screenshot +124ms
  status Evaluating: Estimated Input Latency +1ms
  status Evaluating: No browser errors logged to the console +5ms
  status Evaluating: Server response times are low (TTFB) +1ms
  status Evaluating: First CPU Idle +0ms
  status Evaluating: Time to Interactive +4ms
  status Evaluating: User Timing marks and measures +0ms
  status Evaluating: Minimize Critical Requests Depth +1ms
  status Evaluating: Avoid multiple page redirects +1ms
  status Evaluating: Web app manifest meets the installability requirements +2ms
  status Evaluating: Configured for a custom splash screen +0ms
  status Evaluating: Sets an address-bar theme color +0ms
  status Evaluating: Content is sized correctly for the viewport +1ms
  status Evaluating: Displays images with correct aspect ratio +0ms
  status Evaluating: Avoids deprecated APIs +0ms
  status Evaluating: Minimizes main-thread work +0ms
  status Evaluating: JavaScript execution time +10ms
  status Evaluating: Preload key requests +2ms
  status Evaluating: Preconnect to required origins +1ms
  status Evaluating: All text remains visible during webfont loads +1ms
  status Evaluating: Network Requests +1ms
  status Evaluating: Metrics +5ms
  status Evaluating: start_url responds with a 200 when offline +1ms
  status Evaluating: Site works cross-browser +0ms
  status Evaluating: Page transitions don't feel like they block on the network +0ms
  status Evaluating: Each page has a URL +1ms
  status Evaluating: `[aria-*]` attributes match their roles +0ms
  status Evaluating: `[role]`s have all required `[aria-*]` attributes +0ms
  status Evaluating: Elements with `[role]` that require specific children `[role]`s, are present +1ms
  status Evaluating: `[role]`s are contained by their required parent element +0ms
  status Evaluating: `[role]` values are valid +1ms
  status Evaluating: `[aria-*]` attributes have valid values +0ms
  status Evaluating: `[aria-*]` attributes are valid and not misspelled +1ms
  status Evaluating: `<audio>` elements contain a `<track>` element with `[kind="captions"]` +0ms
  status Evaluating: Buttons have an accessible name +0ms
  status Evaluating: The page contains a heading, skip link, or landmark region +1ms
  status Evaluating: Background and foreground colors have a sufficient contrast ratio +0ms
  status Evaluating: `<dl>`'s contain only properly-ordered `<dt>` and `<dd>` groups, `<script>` or `<template>` elements. +1ms
  status Evaluating: Definition list items are wrapped in `<dl>` elements +0ms
  status Evaluating: Document has a `<title>` element +0ms
  status Evaluating: `[id]` attributes on the page are unique +1ms
  status Evaluating: `<frame>` or `<iframe>` elements have a title +0ms
  status Evaluating: `<html>` element has a `[lang]` attribute +0ms
  status Evaluating: `<html>` element has a valid value for its `[lang]` attribute +1ms
  status Evaluating: Image elements have `[alt]` attributes +0ms
  status Evaluating: `<input type="image">` elements have `[alt]` text +1ms
  status Evaluating: Form elements have associated labels +0ms
  status Evaluating: Presentational `<table>` elements avoid using `<th>`, `<caption>` or the `[summary]` attribute. +0ms
  status Evaluating: Links have a discernible name +1ms
  status Evaluating: Lists contain only `<li>` elements and script supporting elements (`<script>` and `<template>`). +0ms
  status Evaluating: List items (`<li>`) are contained within `<ul>` or `<ol>` parent elements +0ms
  status Evaluating: The document does not use `<meta http-equiv="refresh">` +1ms
  status Evaluating: `[user-scalable="no"]` is not used in the `<meta name="viewport">` element and the `[maximum-scale]` attribute is not less than 5. +0ms
  status Evaluating: `<object>` elements have `[alt]` text +0ms
  status Evaluating: No element has a `[tabindex]` value greater than 0 +1ms
  status Evaluating: Cells in a `<table>` element that use the `[headers]` attribute only refer to other cells of that same table. +0ms
  status Evaluating: `<th>` elements and elements with `[role="columnheader"/"rowheader"]` have data cells they describe. +0ms
  status Evaluating: `[lang]` attributes have a valid value +1ms
  status Evaluating: `<video>` elements contain a `<track>` element with `[kind="captions"]` +0ms
  status Evaluating: `<video>` elements contain a `<track>` element with `[kind="description"]` +0ms
  status Evaluating: `[accesskey]` values are unique +1ms
  status Evaluating: Custom controls have associated labels +0ms
  status Evaluating: Custom controls have ARIA roles +0ms
  status Evaluating: User focus is not accidentally trapped in a region +0ms
  status Evaluating: Interactive controls are keyboard focusable +1ms
  status Evaluating: Headings don't skip levels +0ms
  status Evaluating: Interactive elements indicate their purpose and state +0ms
  status Evaluating: The page has a logical tab order +0ms
  status Evaluating: The user's focus is directed to new content added to the page +0ms
  status Evaluating: Offscreen content is hidden from assistive technology +0ms
  status Evaluating: HTML5 landmark elements are used to improve navigation +0ms
  status Evaluating: Visual order on the page follows DOM order +0ms
  status Evaluating: Uses efficient cache policy on static assets +0ms
  status Evaluating: Avoids enormous network payloads +2ms
  status Evaluating: Defer offscreen images +0ms
  status Evaluating: Eliminate render-blocking resources +3ms
  status Evaluating: Minify CSS +5ms
  status Evaluating: Minify JavaScript +13ms
  status Evaluating: Defer unused CSS +40ms
  status Evaluating: Serve images in next-gen formats +3ms
  status Evaluating: Efficiently encode images +4ms
  status Evaluating: Enable text compression +2ms
  status Evaluating: Properly size images +5ms
  status Evaluating: Use video formats for animated content +2ms
  status Evaluating: Avoids Application Cache +2ms
  status Evaluating: Page has the HTML doctype +0ms
  status Evaluating: Avoids an excessive DOM size +0ms
  status Evaluating: Links to cross-origin destinations are safe +1ms
  status Evaluating: Avoids requesting the geolocation permission on page load +0ms
  status Evaluating: Avoids `document.write()` +1ms
  status Evaluating: Avoids front-end JavaScript libraries with known security vulnerabilities +0ms
  status Evaluating: Detected JavaScript libraries +0ms
  status Evaluating: Avoids requesting the notification permission on page load +0ms
  status Evaluating: Allows users to paste into password fields +0ms
  status Evaluating: Uses HTTP/2 for its own resources +0ms
  status Evaluating: Uses passive listeners to improve scrolling performance +1ms
  status Evaluating: Document has a meta description +0ms
  status Evaluating: Page has successful HTTP status code +0ms
  status Evaluating: Document uses legible font sizes +1ms
  status Evaluating: Links have descriptive text +0ms
  status Evaluating: Page isn’t blocked from indexing +2ms
  status Evaluating: robots.txt is valid +2ms
  status Evaluating: Document has a valid `hreflang` +1ms
  status Evaluating: Document avoids plugins +0ms
  status Evaluating: Document has a valid `rel=canonical` +0ms
  status Evaluating: Page is mobile friendly +1ms
  status Evaluating: Structured data is valid +0ms
  status Generating results... +0ms
  ChromeLauncher Killing Chrome instance 217 +30ms
  Printer html output written to ./se +40ms
  CLI Protip: Run lighthouse with `--view` to immediately open the HTML report in your browser +0ms

Additional information you deem important (e.g. issue happens only occasionally):

I have only seen this happen on 'https://coolstuff.se' so far however I have not tested it on my other sites. The lighthouse report does work if I run from the chrome dev tools on my browser.

jaymoulin commented 5 years ago

Here's what I came with after several tests :

You can rollback to v3.2.1 if you really need your CI to pass until I/someone fixes the bug on the latest tag