GoogleChrome / lighthouse-ci

Automate running Lighthouse for every commit, viewing the changes, and preventing regressions
Apache License 2.0
6.41k stars 644 forks source link

Uploading median LHR failed #1073

Closed bobbylej closed 3 days ago

bobbylej commented 1 week ago

Describe the bug Suddenly uploading median LHR starts failing, which results with empty links in the output of github action.

It was all fine until yesterday morning and nothing has changed in lighthouse configuration since then, so it's pretty confusing. The full report seems to be generated properly and artifacts are saved in gzip file on github, but it's not uploaded to https://storage.googleapis.com/lighthouse-infrastructure.appspot.com/reports/... as it was before.

Here is the full output from github action:

Run treosh/lighthouse-ci-action@v9
  with:
    urls: https://URL_TO_APP
    configPath: .lighthouse/ci.json
    uploadArtifacts: true
    temporaryPublicStorage: true
    runs: 1
    artifactName: lighthouse-results

::group::Action config
Action config
  Input args: {
    "urls": [
      "https://URL_TO_APP"
    ],
    "runs": 1,
    "staticDistDir": null,
    "budgetPath": "",
    "configPath": "/home/runner/work/monorepo/monorepo/.lighthouse/ci.json",
    "serverBaseUrl": "",
    "serverToken": "",
    "temporaryPublicStorage": true,
    "uploadArtifacts": true,
    "basicAuthUsername": "lighthouse",
    "basicAuthPassword": "",
    "artifactName": "lighthouse-results"
  }
  ::endgroup::
::group::Collecting
Collecting
  Running Lighthouse 1 time(s) on https://URL_TO_APP
  Run #1...done.
  Done running Lighthouse!
  ::endgroup::
::group::Uploading
Uploading
  Starting artifact upload
  For more detailed logs during the artifact upload process, enable step-debugging: https://docs.github.com/actions/monitoring-and-troubleshooting-workflows/enabling-debug-logging#enabling-step-debug-logging
  Artifact name is valid!
  ##[debug]Artifact Url: https://pipelinesghubeus10.actions.githubusercontent.com/nlB5ne45kOExTG76xRFK7p2V2DbUIZ7eNexhHuuYLLRYjWVeez/_apis/pipelines/workflows/11012071967/artifacts?api-version=6.0-preview
  ##[debug]Upload Resource URL: https://pipelinesghubeus10.actions.githubusercontent.com/nlB5ne45kOExTG76xRFK7p2V2DbUIZ7eNexhHuuYLLRYjWVeez/_apis/resources/Containers/20975634
  Container for artifact "lighthouse-results" successfully created. Starting upload of file(s)
  ##[debug]File Concurrency: 2, and Chunk Size: 8388608
  ##[debug]/home/runner/work/monorepo/monorepo/.lighthouseci/lhr-1727264901747.html is greater than 64k in size. Creating a gzip file on-disk /tmp/tmp-1558-5cvu0LULTXrQ to potentially reduce the upload size
  ##[debug]/home/runner/work/monorepo/monorepo/.lighthouseci/lhr-1727264901747.json is greater than 64k in size. Creating a gzip file on-disk /tmp/tmp-1558-HE4W1n3wrdUi to potentially reduce the upload size
  ##[debug]The gzip file created for /home/runner/work/monorepo/monorepo/.lighthouseci/lhr-1727264901747.html is smaller than the original file. The file will be uploaded using gzip.
  ##[debug]The gzip file created for /home/runner/work/monorepo/monorepo/.lighthouseci/lhr-1727264901747.json is smaller than the original file. The file will be uploaded using gzip.
  ##[debug]deleting temporary gzip file /tmp/tmp-1558-HE4W1n3wrdUi
  ##[debug]File: 1/2. /home/runner/work/monorepo/monorepo/.lighthouseci/lhr-1727264901747.json took 239.532 milliseconds to finish upload
  ##[debug]deleting temporary gzip file /tmp/tmp-1558-5cvu0LULTXrQ
  ##[debug]File: 2/2. /home/runner/work/monorepo/monorepo/.lighthouseci/lhr-1727264901747.html took 381.820 milliseconds to finish upload
  Total size of all the files uploaded is 392620 bytes
  File upload process has finished. Finalizing the artifact upload
  ##[debug]Artifact Url: https://pipelinesghubeus10.actions.githubusercontent.com/nlB5ne45kOExTG76xRFK7p2V2DbUIZ7eNexhHuuYLLRYjWVeez/_apis/pipelines/workflows/11012071967/artifacts?api-version=6.0-preview
  ##[debug]URL is https://pipelinesghubeus10.actions.githubusercontent.com/nlB5ne45kOExTG76xRFK7p2V2DbUIZ7eNexhHuuYLLRYjWVeez/_apis/pipelines/workflows/11012071967/artifacts?api-version=6.0-preview&artifactName=lighthouse-results
  ##[debug]Artifact lighthouse-results has been successfully uploaded, total size in bytes: 2033149
  Artifact has been finalized. All files have been successfully uploaded!
  The raw size of all the files that were specified for upload is 2033149 bytes
  The size of all the files that were uploaded is 392620 bytes. This takes into account any gzip compression used to reduce the upload size, time and storage
  Note: The size of downloaded zips can differ significantly from the reported size. For more information see: https://github.com/actions/upload-artifact#zipped-artifact-downloads 
  Uploading median LHR of https://URL_TO_APP..failed!
  No GitHub token set, skipping GitHub status check.
  Dumping 1 reports to disk at /home/runner/work/monorepo/monorepo/.lighthouseci...
  Done writing reports to disk.
  ::endgroup::
##[debug]done in 70.322889252s
##[debug]Node Action run completed with exit code 0
##[debug]Set output resultsPath = /home/runner/work/monorepo/monorepo/.lighthouseci
##[debug]Set output links = {}
##[debug]Set output assertionResults = 
##[debug]Set output manifest = [{"url":"https://URL_TO_APP/","isRepresentativeRun":true,"htmlPath":"/home/runner/work/monorepo/monorepo/.lighthouseci/URL_TO_APP.report.html","jsonPath":"/home/runner/work/monorepo/monorepo/.lighthouseci/URL_TO_APP.report.json","summary":{"performance":0.24,"accessibility":0.92,"best-practices":0.83,"seo":0.91,"pwa":0.[44](https://URL_TO_REPO/actions/runs/11012071967/job/30641057922#step:5:44)}}]
##[debug]Finishing: Run Lighthouse on pull request preview

And you can see at the end this Uploading median LHR of https://URL_TO_APP..failed! which is the problem, as it should be Uploading median LHR of https://URL_TO_APP..success! and after that, I should see URL to the uploaded report.

To Reproduce Steps to reproduce the behavior:

  1. Run github workflow with such action:
    - name: Run Lighthouse on pull request preview
        id: lighthouse-audit
        uses: treosh/lighthouse-ci-action@v9
        with:
          urls: ${{ needs.deploy-preview.outputs.preview-url }}${{ vars.LIGHTHOUSE_AUDIT_URL_PATH || '/' }}
          configPath: .lighthouse/ci.json
          uploadArtifacts: true
          temporaryPublicStorage: true
          runs: 1    

Expected behavior It should upload report to https://storage.googleapis.com/lighthouse-infrastructure.appspot.com/reports and return it in output.links

Logs/Screenshots If applicable, add LHCI logs or screenshots to help explain your problem.

Environment (please complete the following information):

paulirish commented 1 week ago

Yeah... See #1072.

Thanks for reporting.

Right now we're waiting on a response from our cloud provider but.. I'm not holding my breath.

If having those is important to you, you'll have to configure a different solution for storage; https://github.com/GoogleChrome/lighthouse-ci/blob/main/docs/configuration.md#target

Sorry

paulirish commented 3 days ago

I believe this has been resolved. Can you confirm?