cypress-io / cypress-docker-images

Docker images with Cypress dependencies and browsers

Home Page:https://on.cypress.io/continuous-integration

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[github actions] unable to solve process (bash) when downloading building cypress/factory

FranciscoKloganB opened this issue · comments

I have recently created a GitHub Action that periodically executes a set of smoke tests every 30m using Cypress. Since execution is frequent and the intention is to have fast feedback. We have created a custom workflow and a custom docker image based on cypress/factory image, instead of using cypress official action. We have effectively reduced the execution time of E2E tests (battery) from 12m down to 7m and the smoke test execution time from 8m to 3m.

These smoke tests run 48 times a day. We are no where near reaching the limit of our GitHub quotas, or bandwidth limits. Yet, the smoke tests fail on average 4% of the times that they run. With the following error:

 > [2/9] RUN bash /opt/installScripts/node/install-node-version.sh 16.20.0:
...
31.79 + gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys A363A499291CBBC940DD62E41F10027AF002F8B0
31.79 gpg: keyserver receive failed: No keyserver available
31.79 + gpg --batch --keyserver keyserver.ubuntu.com --recv-keys A363A499291CBBC940DD62E41F10027AF002F8B0

------
cypress.dockerfile:1
--------------------
   1 | >>> ARG NODE_VERSION='16.20.0'
   2 |     ARG CYPRESS_VERSION='13.2.0'
   3 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c bash /opt/installScripts/node/install-node-version.sh ${APPLIED_FACTORY_DEFAULT_NODE_VERSION}" did not complete successfully: exit code: 2
Error: Process completed with exit code 1.

This does not appear to be a problem on our side (see workflow and dockerfile below). It appears to be related with the cypress/factory dockerfile itself.

If not... Are there any pointers you can provide to us in order to fix this issue?

Below you can find our Dockerfile and the relevant parts of our GitHub Workflow

      - name: 🐳 Build custom cypress docker image
        if: ${{ inputs.environ != 'local' }}
        run: docker build . --file ./cypress.dockerfile --tag test

      - name: 👨‍🔬 Run custom cypress image against live website
        if: ${{ inputs.environ != 'local' }}
        env:
          # 'smoke' | 'e2e' | 'all'
          TEST_KIND: ${{ inputs.kind }}
          WEBSITE_PASSWORD: ${{ secrets.WEBSITE_PASSWORD }}
          WEBSITE_URL: ${{ inputs.environ == 'prod' && 'https://example-website.com' || 'https://dev.example-website.com' }}
        run: |
          docker run \
            --env WEBSITE_PASSWORD=$WEBSITE_PASSWORD \
            --env WEBSITE_URL=$WEBSITE_URL \
            --env TEST_KIND=$TEST_KIND \
            test --browser electron
ARG NODE_VERSION='16.20.0'
ARG CYPRESS_VERSION='13.2.0'

FROM cypress/factory

WORKDIR /runner

RUN touch package.json
RUN echo "{ \"name\": \"tests\", \"dependencies\": {} }" >> package.json

# Install minimum required dependencies for cypress to run our tests
RUN npm i --save \
  cypress@^13.2.0 \
  cypress-iframe@^1.0.1 \
  cypress-wait-until@^2.0.1 \
  dotenv@^16.3.1 \
  msw@^1.3.1 \
  @testing-library/cypress@^10.0.1 ;

COPY .env.test .env.test
COPY cypress.config.js cypress.config.js

COPY mocks/ mocks/
COPY cypress/ cypress/

ENTRYPOINT ["npx", "cypress", "run"]

@jennifer-shehane I see this was removed from Cypress App Triage, will anyone still answer the question I made?

Perhaps I am not using cypress/factory as expected, I followed the instructions on the Docker Hub, but I might be missing something that causes this to fail arbitrarily.

Could be totally unrelated, but I got the same error. Maybe it's caused by Google rotating their signing keys:

https://support.google.com/chromebook/thread/257688390/the-repository-http-dl-google-com-linux-chrome-deb-stable-inrelease-is-not-signed?hl=en

@FranciscoKloganB Is this still an issue?

Hi, I am also facing the same issue, not seeing anything special in my docker file.

weirdly only an issue inside a GitHub action

ARG CHROME_VERSION='120.0.6099.109-1'
ARG EDGE_VERSION='120.0.2210.91-1'
ARG FIREFOX_VERSION='107.0'

FROM cypress/factory:latest

WORKDIR /opt/app

RUN npm install -g pnpm

COPY package.json pnpm-lock.yaml ./

RUN pnpm install --frozen-lockfile

COPY . /opt/app

@FranciscoKloganB

Node.js 16 entered end-of-life on Sep 11, 2023.

Are you still seeing this issue with a supported version of Node.js
18.x, 20.x, 22.x

and using cypress/factory latest version?

The original problem, which was reported to be occurring about 4% of the time, is a network error:

31.79 + gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys A363A499291CBBC940DD62E41F10027AF002F8B0
31.79 gpg: keyserver receive failed: No keyserver available

This is not something which the build process can do much about.

As noted in the previous post, this issue is regarding a version of Node.js which has reached end-of-life.