lighthouse-ci icon indicating copy to clipboard operation
lighthouse-ci copied to clipboard

gitlab ci blocks during run

Open chenfan0 opened this issue 10 months ago • 13 comments

lighthouserc.js

module.exports = {
    ci: {
        collect: {
            url: [
                'http://127.0.0.1:8089/'
            ],
            numberOfRuns: 3,
            startServerCommand: "PORT=8089 node src/server",
            settings: {
                hostname: '127.0.0.1',
                chromeFlags: ['--no-sandbox'],
            },
        },
        upload: {
            target: 'temporary-public-storage',
        }
    }
}

.gitlab-ci.yml

lhci:
  stage: test
  image: cypress/browsers:node-18.16.1-chrome-114.0.5735.133-1-ff-114.0.2-edge-114.0.1823.51-1
  script:   
    - npm install
    - npm install -g @lhci/[email protected]
    - npm run build
    - lhci autorun --config=./lighthouserc.js || echo "LHCI failed!"
image

chenfan0 avatar Apr 24 '24 06:04 chenfan0

I also got this. Any solution?

ydhnwb avatar Apr 30 '24 11:04 ydhnwb

Has the npm package been compromised?

$ npx lhci --version
Hello, this is AnupamAS01!

njsaunders avatar May 09 '24 16:05 njsaunders

I also got this. Any solution?

no 😞

chenfan0 avatar May 20 '24 00:05 chenfan0

I have the same issue with the following CI config:

lighthouse:
  stage: .pre
  image: cypress/browsers:node16.17.0-chrome106
  script:
    - npm install -g @lhci/[email protected]
    - lhci autorun --upload.target=temporary-public-storage --collect.settings.chromeFlags="--no-sandbox" --collect.staticDistDir="wiki/pages" --collect.numberOfRuns=1 || echo "LHCI failed!"

lukaas33 avatar Jun 02 '24 22:06 lukaas33

I found a solution. I executed this download-chrome.sh to install Chrome, and then set the environment variable LIGHTHOUSE_CHROMIUM_PATH to the location of Chrome downloaded by the script, and then it can run normally.

chenfan0 avatar Jun 11 '24 07:06 chenfan0

Any news on this? I am also facing this kind of issue

ArgV04 avatar Jun 14 '24 14:06 ArgV04

Any news on this? I am also facing this kind of issue

I found a solution. I executed this download-chrome.sh to install Chrome, and then set the environment variable LIGHTHOUSE_CHROMIUM_PATH to the location of Chrome downloaded by the script, and then it can run normally.

here

chenfan0 avatar Jun 17 '24 01:06 chenfan0

Any news on this? I am also facing this kind of issue

I found a solution. I executed this download-chrome.sh to install Chrome, and then set the environment variable LIGHTHOUSE_CHROMIUM_PATH to the location of Chrome downloaded by the script, and then it can run normally.

here

How does it work? The script already checks for LIGHTHOUSE_CHROMIUM_PATH and exit if not exist. And what the value of LIGHTHOUSE_CHROMIUM_PATH ... I tried this script partially ... meaning downloading chrome .... and execute wget ... but with this ... its still not working

ArgV04 avatar Jun 17 '24 07:06 ArgV04

Manage to "Fix" this by using Node 22 and setting the following flag:

export NODE_OPTIONS="--max-old-space-size=7168"

njsaunders avatar Aug 19 '24 12:08 njsaunders

Turns out that was only for one pipeline. It's happening again. Have opened https://github.com/GoogleChrome/lighthouse-ci/pull/1070 to figure out whats going on. Not giving up on this one!

njsaunders avatar Sep 01 '24 20:09 njsaunders

With debugging turned on looks like it's blocking connecting to Chrome:

Mon, 02 Sep 2024 12:13:45 GMT LH:status Auditing: Document has a valid `rel=canonical`
Mon, 02 Sep 2024 12:13:45 GMT LH:status Auditing: Structured data is valid
Mon, 02 Sep 2024 12:13:45 GMT LH:status Auditing: Page didn't prevent back/forward cache restoration
Mon, 02 Sep 2024 12:13:45 GMT LH:status Generating results...
done.
Run #3...Mon, 02 Sep 2024 12:13:46 GMT LH:ChromeLauncher Found existing Chrome already running using port 41471, using that.

Just sits there waiting at that. Debugging continues.

njsaunders avatar Sep 02 '24 12:09 njsaunders

Ok - I don't know why but this is related to the version of Chrome used. I downgraded from 128 to 127 and everything started working fine again.

njsaunders avatar Sep 02 '24 13:09 njsaunders

We faced the same issue, we fixed it by using a newer version of the container, it has updates of node and Chrome, so we don't know the root cause.

This never ends:

docker run --rm -it cypress/browsers:node-20.5.0-chrome-114.0.5735.133-1-ff-114.0.2-edge-114.0.1823.51-1 \
bash -c 'yarn global add @lhci/[email protected] ; lhci collect --url https://www.google.com \
--collect.settings.chromeFlags="--no-sandbox"'

This works:

docker run --rm -it cypress/browsers:node-20.17.0-chrome-128.0.6613.119-1-ff-130.0-edge-128.0.2739.63-1 \
bash -c 'yarn global add @lhci/[email protected] ; lhci collect --url https://www.google.com \
--collect.settings.chromeFlags="--no-sandbox"'

alexislefebvre avatar Sep 16 '24 13:09 alexislefebvre