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

gitlab ci blocks during run #1031

Open
chenfan0 opened this issue Apr 24, 2024 · 14 comments
Open

gitlab ci blocks during run #1031

chenfan0 opened this issue Apr 24, 2024 · 14 comments

Comments

@chenfan0
Copy link

chenfan0 commented Apr 24, 2024

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
@ydhnwb
Copy link

ydhnwb commented Apr 30, 2024

I also got this. Any solution?

@njsaunders
Copy link

Has the npm package been compromised?

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

@chenfan0
Copy link
Author

I also got this. Any solution?

no 😞

@lukaas33
Copy link

lukaas33 commented Jun 2, 2024

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!"

@chenfan0
Copy link
Author

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.

@ArgV04
Copy link

ArgV04 commented Jun 14, 2024

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

@chenfan0
Copy link
Author

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

@ArgV04
Copy link

ArgV04 commented Jun 17, 2024

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

@njsaunders
Copy link

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

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

@njsaunders
Copy link

Turns out that was only for one pipeline. It's happening again. Have opened #1070 to figure out whats going on. Not giving up on this one!

@njsaunders
Copy link

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
Copy link

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.

@alexislefebvre
Copy link

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"'

@kevinprakasa
Copy link

This has also happened to me all of a sudden without any recent changes, my lighthouse CI in github actions took forever until it passed the time limit. And I managed to fix the issue.

For my case, I'm using the chrome version from [email protected] package that we're using to authenticate the LHCI request. I believe that is still using older chrome version than the latest version now. I tried to update puppeteer to version 23.7.0, and suddenly, the lighthouse running process is no longer stuck anymore. Apparently, using Chrome/130.0.6723.58 that is coming from the latest puppeteer fixed the issue for me.

But I wonder is there any flag command like --debug when running the LHCI so that I can see the core problem behind all this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants