microsoft / playwright

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
https://playwright.dev
Apache License 2.0
66.83k stars 3.66k forks source link

[Bug]: GitLab CI Pipeline Failing due to "At least one invalid signature was encountered" errors during Playwright installation #32726

Closed Renaldinho closed 1 month ago

Renaldinho commented 1 month ago

Version

1.47.1

Steps to reproduce

private repo

Expected behavior

The GitLab CI pipeline should successfully install Playwright and its dependencies using the npx playwright install --with-deps command.

Actual behavior

The pipeline fails during the Playwright installation step due to "At least one invalid signature was encountered" errors.

Additional context

I'm running a GitLab CI pipeline that uses the mcr.microsoft.com/playwright:v1.41.2-jammy Docker image to execute end-to-end tests with Playwright. However, the pipeline is failing during the Playwright installation step with the following errors:

W: GPG error: ... At least one invalid signature was encountered. E: The repository '...' is not signed. These errors are related to invalid GPG signatures in several Ubuntu repositories, including the NodeSource repository and standard Ubuntu repositories.

image

pipeline step

e2e-test: # when PR open OR when commit to master
  stage: test
  image: $PLAYWRIGHT_IMAGE
  tags:
    - sequential
  cache: {}  # Clear cache settings
  timeout: 2 hours 30 minutes
  script:
    # Install packages, running this step not from cache due to requiring task to be run in separate runner not sharing cache
    - npm ci
    - npm link @angular/cli
    # Install Playwright browsers and dependencies
    - npx playwright install --with-deps
    - npx playwright install msedge
    # Start your application
    - ng serve --configuration=ci &
    # Wait for the application to start with a maximum counter
    - |
      max_retries=12  # Set to the number of retries
      count=0
      until $(curl --output /dev/null --silent --head --fail http://localhost:4200); do
        printf '.'
        sleep 5
        count=$((count + 1))
        if [ $count -ge $max_retries ]; then
          echo "Application failed to start within expected time."
          exit 1
        fi
      done
      echo 'Server started, waiting for warmup...'
      sleep 30  # Adjust this value as needed
      echo 'Server is ready'
    # Run Playwright tests
    - npm run e2e ci local console
  artifacts:
    paths: #assuming default playwright artifacts paths
      - ./playwright-report/
    when: always
    expire_in: 12 days
  rules:
    - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
    - if: '$CI_COMMIT_BRANCH == "master" && $CI_PIPELINE_SOURCE != "trigger"'
  interruptible: true`

Environment

Node: 18.18.1 - C:\Program Files\nodejs\node.EXE
    npm: 6.14.18 - C:\Program Files\nodejs\npm.CMD
  IDEs:
    VSCode: 1.87.0 - C:\Program Files\Microsoft VS Code\bin\code.CMD
  npmPackages:
    @playwright/test: ^1.37.2 => 1.47.1
mxschmitt commented 1 month ago

Usually this is caused by external factors, e.g. wrong time, temporary network issues on Ubuntu / apt source list side. Playwright users are running this every day thousands of times and we've seen no issues about this recently.

Are these self-hosted machines or GitLab managed runners?

mxschmitt commented 1 month ago

Closing as per above since this looks not like a Playwright issue.