cypress-io / cypress

Fast, easy and reliable testing for anything that runs in a browser.
https://cypress.io
MIT License
46.82k stars 3.17k forks source link

ERROR:object_proxy.cc(590) Failed to call method: org.freedesktop.portal.Settings.Read #28061

Closed MikeMcC399 closed 7 months ago

MikeMcC399 commented 12 months ago

Current behavior

When Cypress is run in a CI environment where there is no physical GPU available, an error message similar to the following is output:

[266:1014/183729.600834:ERROR:object_proxy.cc(590)] Failed to call method: org.freedesktop.portal.Settings.Read: object_path= /org/freedesktop/portal/desktop: unknown error type:

This is new in Cypress 13.3.1 and is a regression from Cypress 13.3.0.

It affects for instance:

The error message occurs in CI where it uses Xvfb (X virtual framebuffer) when there is no other X11 server available due to missing hardware graphic.

Desired behavior

The only message output when starting Cypress in CI should be similar to the following:

DevTools listening on ws://127.0.0.1:35223/devtools/browser/18023e84-028d-4b1e-a9d3-afb174f8232f

There should be no message with the following text output:

ERROR:object_proxy.cc

Test code to reproduce

Workflows from Cypress repos show the issue since the update to Cypress 13.3.1:

  1. https://github.com/cypress-io/github-action/actions/workflows/example-cron.yml
  2. https://github.com/cypress-io/cypress-example-kitchensink/blob/master/.github/workflows/single.yml
  3. https://github.com/cypress-io/cypress-docker-images/blob/master/circle.yml for example "test-image-medium-factory-test-factory-cypress-included-electron" on https://app.circleci.com/pipelines/github/cypress-io/cypress-docker-images

Cypress Version

First reported on version: 13.3.1 Reproducible also on version: 13.6.4

Node version

20.8.0 / 20.6.1

Operating System

Ubuntu 22.04

Debug Logs

Workflow Cypress 13.3.0 Cypress 13.3.1
GitHub Actions Job 17616845243 Job 17685117337
CircleCI Job 48307 Job 48982

Other

Error history

niklasscharfy commented 7 months ago

still annoying

harshitBhardwaj97 commented 7 months ago

I am also facing a similar issue, I am trying to build a ci/cd pipeline, in which I also have added step to run e2e tests with cypress.

image

I am not using typescript for this project, and the tests are passing on my local machine (although there also I am getting this warning, but still tests are passing).

image

For the reference, this is my pipeline.yml file, in which I have also tried using ubuntu-latest -

name: Deployment pipeline

on:
  push:
    branches:
      - main

jobs:
  simple_deployment_pipeline:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: "20"
      - name: Install dependencies
        run: npm install
      - name: Check style
        run: npm run eslint
      - name: Build the app
        run: npm run build
      - name: Run tests
        run: npm run test
      - name: e2e tests
        uses: cypress-io/github-action@v5
        with:
          command: npm run test:e2e
          start: npm run start-prod
          wait-on: http://localhost:5000

The workflow just gets stuck after the error shown in first screenshot, and I have to cancel it, if someone is having any idea how to solve it then kindly respond.

For the complete code, refer this - https://github.com/harshitBhardwaj97/Full-Stack-Open-Pokedex-CICD

MikeMcC399 commented 7 months ago

@harshitBhardwaj97

Your problems are not due to the message

ERROR:object_proxy.cc(590) Failed to call method: org.freedesktop.portal.Settings.Read

I suggest you remove the line

command: npm run test:e2e

and the action will automatically run your tests. Since this is not a product bug, but a workflow error, this issue list is not the right place to request assistance.

You can get support from the Cypress technical community on Discord

Discord chat (click on button)

Also, you should probably be using the current action version cypress-io/github-action@v6

harshitBhardwaj97 commented 7 months ago

Thanks a ton @MikeMcC399, kindly excuse if I asked a very basic question, I am self taught aspiring engineer, and I was following the instructions that were told to me. Once again thanks, now the CI pipeline is executing e2e tests as well -

image

So I guess the key takeaway here is, that cypress-io/github-action@v6 internally is responsible executing the tests.

MikeMcC399 commented 7 months ago

@harshitBhardwaj97

Your problem was that you were trying to run Cypress in open (interactive) mode through "test:e2e": "cypress open" so the workflow was waiting for user input and could not progress.

MikeMcC399 commented 7 months ago

This issue no longer occurs after updating to cypress@13.3.5 (released Feb 20, 2024).

csvan commented 7 months ago

Confirming that we can no longer reproduce this on Cypress 13.6.6 in CI

jennifer-shehane commented 7 months ago

@MikeMcC399 Oh, interesting. I must have missed a backport of this because I thought it was only in Electron 28. Great!!

MikeMcC399 commented 7 months ago

@jennifer-shehane

Oh, interesting. I must have missed a backport of this because I thought it was only in Electron 28. Great!!

I was not able to find any reference to this issue on https://github.com/electron/electron and so I can't name any relevant Electron PR. If you happen to know which PR might have been responsible, you're welcome to add a reference to it here. If not, don't worry!

mlaw93 commented 7 months ago

@rajishanmugi

I am trying to run cypress tests. It is all running fine in my local. But in github actions execution, the web page is not loading. I tried adding below.

  1. chromewebsecurity as false
  2. testIsolation false
  3. retries with 2
  4. changed my cypress version to be 13.3.0
  5. My node version is v20.10.0
  6. System Platform: linux (Debian - 11.5)

[Am getting a blank page on cy.visit(baseUrl) ]

Did you ever resolve this issue?