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

Could not find a Cypress configuration file. We looked but did not find a cypress.json file in this folder. #564

Closed
kahboom opened this issue Jun 6, 2022 · 53 comments

Comments

@kahboom
Copy link

kahboom commented Jun 6, 2022

As of late last week, Cypress tests are failing with this error, from one commit to the next, which was completely unrelated (an .md file). I seem to be getting the same error as @jazanne from this comment.

We're using:

  • cypress-io/github-action@v2
  • Cypress v9.7.0
  • Yarn Berry v3

I tried @jazanne's workaround, sadly we're still getting the same error regardless. We've tried upgrading cypress, using cypress-io/github-action@v3, and running it headlessly. In one separate PR I even tried to downgrade to yarn 1.x, which is causing some other errors. The whole JS toolchain seems so brittle. :s Is anyone else getting this? Any suggestions?

[STARTED] Task without title.
[SUCCESS] Task without title.
[494:0606/101147.234717:ERROR:node_bindings.cc(276)] Most NODE_OPTIONs are not supported in packaged apps. See documentation for more details.
[494:0606/101147.234801:ERROR:node_bindings.cc(276)] Most NODE_OPTIONs are not supported in packaged apps. See documentation for more details.
[494:0606/101147.234809:ERROR:node_bindings.cc(276)] Most NODE_OPTIONs are not supported in packaged apps. See documentation for more details.
[494:0606/101147.234815:ERROR:node_bindings.cc(276)] Most NODE_OPTIONs are not supported in packaged apps. See documentation for more details.
libva error: vaGetDriverNameByIndex() failed with unknown libva error, driver_name = (null)
[655:0606/101148.920788:ERROR:sandbox_linux.cc(377)] InitializeSandbox() called with multiple threads in process gpu-process.
[655:0606/101148.926474:ERROR:gpu_memory_buffer_support_x11.cc(44)] dri3 extension not supported.
Could not find a Cypress configuration file.
We looked but did not find a cypress.json file in this folder: /__w/kaoto-ui/kaoto-ui
Error: The process '/usr/local/bin/npx' failed with exit code 1

cc @Delawen

@JuliusMu
Copy link

We got the same issue in a gitlab-ci pipeline. Looks like a driver issue to me:
libva error: vaGetDriverNameByIndex() failed with unknown libva error, driver_name = (null)
Any updates or workarounds yet?

@jdferreira2429
Copy link

same issue. anyone looking into this?

@SparrowBrain
Copy link

Same issue.

Using:

  • cypress-io/github-action@v4
  • Cypress v10.2.0
  • npm (v8? GitHub Actions default)

Could be related to migrating to v2 of npm lockfile. Had to upgrade chokidar after migration.

The run:
https://github.com/SparrowBrain/GOG-Galaxy-Suggester/runs/7009698620

Run cypress-io/github-action@v2
/usr/local/bin/npm ci
added 2420 packages, and audited 2421 packages in 55s
15 packages are looking for funding
  run `npm fund` for details
28 vulnerabilities (1 moderate, 19 high, 8 critical)
To address all issues (including breaking changes), run:
  npm audit fix --force
Run `npm audit` for details.
/usr/local/bin/npx cypress cache list
┌─────────┬───────────┐
│ version │ last used │
├─────────┼───────────┤
│ 10.2.0  │ a day ago │
└─────────┴───────────┘
/usr/local/bin/npx cypress verify
[STARTED] Task without title.
[SUCCESS] Task without title.
/usr/bin/tar --posix --use-compress-program zstd -T0 -cf cache.tzst -P -C /home/runner/work/GOG-Galaxy-Suggester/GOG-Galaxy-Suggester --files-from manifest.txt
Cache Size: ~55 MB (57565882 B)
Cache saved successfully
/usr/bin/tar --posix --use-compress-program zstd -T0 -cf cache.tzst -P -C /home/runner/work/GOG-Galaxy-Suggester/GOG-Galaxy-Suggester --files-from manifest.txt
Cache Size: ~155 MB (162987616 B)
Cache saved successfully
start server "npm start command "npm start"
current working directory "/home/runner/work/GOG-Galaxy-Suggester/GOG-Galaxy-Suggester"
waiting on "http://localhost:3000" with timeout of 60 seconds
/usr/local/bin/npm start
> [email protected] start
> react-app-rewired start
ℹ「wds」: Project is running at http://10.1.0.152/
ℹ「wds」: webpack output is served from /GOG-Galaxy-Suggester
ℹ「wds」: Content not from webpack is served from /home/runner/work/GOG-Galaxy-Suggester/GOG-Galaxy-Suggester/public
ℹ「wds」: 404s will fallback to /GOG-Galaxy-Suggester/
Starting the development server...
Compiled successfully!
You can now view gog-galaxy-suggester in the browser.
  Local:            http://localhost:3000/GOG-Galaxy-Suggester
  On Your Network:  http://10.1.0.152:3000/GOG-Galaxy-Suggester
Note that the development build is not optimized.
To create a production build, use npm run build.
[2203:0622/174911.935964:ERROR:sandbox_linux.cc(377)] InitializeSandbox() called with multiple threads in process gpu-process.
[2203:0622/174911.939833:ERROR:gpu_memory_buffer_support_x11.cc(44)] dri3 extension not supported.
Could not find a Cypress configuration file.
We looked but did not find a cypress.json file in this folder: /home/runner/work/GOG-Galaxy-Suggester/GOG-Galaxy-Suggester
Test run failed, code 1
More information might be available above
Error: Could not find Cypress test run results
Cypress module has returned the following error message:
Could not find Cypress test run results

The file has to be there, since github checkout points to the same folder

@SparrowBrain
Copy link

Nevermind.. Had to manually update to cypress v10.2.0, since dependabot doesn't run the app.

Still a question: why is the error mentioning cypress.json? That confused me.

@drecali
Copy link

drecali commented Jun 23, 2022

@SparrowBrain Thanks for sharing a link to your workflow logs. I had the same issue. In both our cases, you can see in the workflow logs that the config-file was set as cypress.json by default. According to the Cypress docs

Version Changes
10.0.0 Reworked page to support new cypress.config.js and deprecated cypress.json files

image

I just changed the workflow to explicitly declare config-file: cypress.config.ts and it worked. In my case the CLI output was very helpful.

[percy] Running "npx cypress run --headless --config-file cypress.json --browser chrome"

You are attempting to use Cypress with an older config file: cypress.json

When you upgraded to Cypress v10.0 the config file was updated and moved to a new location: cypress.config.ts

You may need to update any CLI scripts to ensure that they are referring the new version. This would typically look something like:

"cypress open --config-file=cypress.config.ts"

https://on.cypress.io/migration-guide

@AshMcConnell
Copy link

We got the same issue in a gitlab-ci pipeline. Looks like a driver issue to me: libva error: vaGetDriverNameByIndex() failed with unknown libva error, driver_name = (null) Any updates or workarounds yet?

I have a similar issue, but it doesn't say it can't find the config file, instead : -

libva error: va_getDriverName() failed with unknown libva error,driver_name=(null)
[491:0626/135959.592121:ERROR:sandbox_linux.cc(377)] InitializeSandbox() called with multiple threads in process gpu-process.
[491:0626/135959.594708:ERROR:gpu_memory_buffer_support_x11.cc(44)] dri3 extension not supported.
Can't run because no spec files were found.
We searched for specs matching this glob pattern:

@new-guy
Copy link

new-guy commented Jun 28, 2022

Yeah, I'm also getting this when I run it on my local docker. cypress info ran in the cypress/included:9.7.0 container throws this error:

root@23dfb8d855b9:/# cypress info
libva error: vaGetDriverNameByIndex() failed with unknown libva error, driver_name = (null)
[688:0628/153217.781946:ERROR:sandbox_linux.cc(377)] InitializeSandbox() called with multiple threads in process gpu-process.
[688:0628/153217.788351:ERROR:gpu_memory_buffer_support_x11.cc(44)] dri3 extension not supported.
Displaying Cypress info...

@stychu
Copy link

stychu commented Jul 19, 2022

Any solutions yet?? Seems like this is a wide issue as of now with cypress v10+.

@drecali
Copy link

drecali commented Jul 20, 2022

@AshMcConnell @new-guy

The errors below may not be related to this issue because they also appear in successful runs. Hope this gets fixed soon!

libva error: va_getDriverName() failed with unknown libva error,driver_name=(null)
[491:0626/135959.592121:ERROR:sandbox_linux.cc(377)] InitializeSandbox() called with multiple threads in process gpu-process.
[491:0626/135959.594708:ERROR:gpu_memory_buffer_support_x11.cc(44)] dri3 extension not supported.

@mikeerickson
Copy link

Ya, this sure seems like a widespread issue. I have had to revert to using Cypress 9.5.4 as all the suggestions here have not worked for me. If anybody knows of a working solution, please report here as we really want to Cypress 10.x

@snake-py
Copy link

snake-py commented Aug 1, 2022

+1 - inside docker only happens for open mode

Cypress package version: 9.7.0
Cypress binary version: 9.7.0
Electron version: 18.0.4
Bundled Node version: 16.13.2

[2122:0801/060102.754724:ERROR:bus.cc(397)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
[2122:0801/060102.754863:ERROR:bus.cc(397)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
[2122:0801/060102.756263:ERROR:bus.cc(397)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[2122:0801/060102.756321:ERROR:bus.cc(397)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[2276:0801/060102.822555:ERROR:sandbox_linux.cc(377)] InitializeSandbox() called with multiple threads in process gpu-process.
[2276:0801/060102.825930:ERROR:gpu_memory_buffer_support_x11.cc(44)] dri3 extension not supported.
[2122:0801/060102.968302:ERROR:bus.cc(397)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[2122:0801/060102.988646:ERROR:bus.cc(397)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
^C[2276:0801/060244.882776:ERROR:connection.cc(66)] X connection error received.
[2276:0801/060244.883598:ERROR:connection.cc(66)] X connection error received.

@gsouf
Copy link

gsouf commented Aug 3, 2022

Happens to me when upgrading from cypress 9.x to cypress 10.4. It appears to work with cypress 9.7 for me unlike other have mentioned above.

@rozzs74
Copy link

rozzs74 commented Aug 3, 2022

Any workarounds?

@gsouf
Copy link

gsouf commented Aug 3, 2022

Actually this is working after running the cypress migration. The config file is not a json anymore. It is a JS file now. All I did is running cypress open (from host machine, not from docker) to get cypress ui, and followed the migration from the UI. They migrate the cypress file for us. Then remember to use cypress run with updated flag --config-file to point to the new js file

@javierfuentesm
Copy link

any ideas ? im getting this error when i want to use it with docker
image
but im using the 10.4.0 cypress version and i have the following configuration :

image

@javierfuentesm
Copy link

@gsouf any ideas ? with my problem, it seems like you solved it Im using the same version
image
but getting the same error

@gsouf
Copy link

gsouf commented Aug 6, 2022

@javierfuentesm your issue seems to be different to what is described in this ticket. I think you need to put the full path from your app root (from where you invoke in the cypress command) in supportFile. For example

supportFile: 'cypress/support/e2e.js'

Or just remove this config because by default cypress will already pick the file at this location (https://docs.cypress.io/guides/core-concepts/writing-and-organizing-tests#Support-file).

It just feels weird that the path is not resolved relatively to the config file. Might be an actual issue

@javierfuentesm
Copy link

javierfuentesm commented Aug 6, 2022

@gsouf yes i tried that but is not working , locally it works fine but on docker i get all those errors

@gsouf
Copy link

gsouf commented Aug 6, 2022

@javierfuentesm I got the same error as you did when I tried just support/e2e.js and it got resolved on docker when I use the config cypress/support/e2e.js.

That is weird, but overall I noticed many issues with path resolution when I tried to configure the new components testing today.

Does that work if you use an absolute path. ie:

supportFile: path.resolve(__dirname, 'cypress/support/e2e.js')

Have you also tried on an other docker base image? For example could miss something if you are using an alpine image

@arnabmondal19
Copy link

Is there any updates on this issue? i am also getting error while running in docker.
Cypress version: 10.3.0

image

@iliogr
Copy link

iliogr commented Aug 16, 2022

Is there any updates on this issue? i am also getting error while running in docker. Cypress version: 10.3.0

image

Having the same issue. Any solutions yet?

@gsouf
Copy link

gsouf commented Aug 16, 2022

@iliogr @arnabmondal19 this is not the same error. The error described in this ticket is Could not find a Cypress configuration file. We looked but did not find a cypress.json file in this folder..

@iliogr
Copy link

iliogr commented Aug 16, 2022

@gsouf I know. the error described in the ticket is caused because cypress v10 requires a different config file not cypress.json anymore.

however, I am interested in the issue mentioned above regarding dri3 extension not supported :)

@gsouf
Copy link

gsouf commented Aug 16, 2022

@iliogr I don't think that the "dri3 extension" message is an issue. At least for me it's working well in docker and I'm getting the same error message about "dri extension".

Is your cypress config file at the root of the your project? If not try to place it at the root of the project to see if it works. There are some ongoing issues with path resolutions when cypress config is not at the root.

Also mentioning just in case you missed that.. with cypress 10 default specs files pattern is now using extension *.cy.js. Are your files matching this pattern?

Ultimately you can try to set the specPattern manually to an absolute path in your cypress config file:

const path = require('path');
const { defineConfig } = require('cypress');


module.exports = defineConfig({

  // for e2e testing
  e2e: {
    specPattern: path.resolve(__dirname, 'path/to/src/**/*.cy.js'), 
  },

  // for component testing
  component: {
    specPattern: path.resolve(__dirname, 'path/to/src/**/*.cy.js'), 
  },

})

See https://docs.cypress.io/guides/references/configuration#e2e

@kodriscollics
Copy link

kodriscollics commented Aug 16, 2022

Having the same issue after upgrading to Cypress version 10. I am running inside of IntelliJ. When I click on a Cypress run configuration to run a test, I get this message:

Could not find a Cypress configuration file.

We looked but did not find a cypress.config.ts file in this folder: C:\Program Files\JetBrains\IntelliJ IDEA 2021.1.2\jbr\bin

I have implemented the suggestions noted above... i.e. running with --config-file=cypress.config.ts in my test parameters, specPattern: 'cypress/e2e/**/*.{js,jsx,ts,tsx}' in the cypress.config.ts file, etc. The problem persists.

@gsouf
Copy link

gsouf commented Aug 17, 2022

Would you be able to provide a minimum sample repo with a dockerfile that we can use to reproduce the issue @kodriscollics @iliogr ?

@kodriscollics
Copy link

kodriscollics commented Aug 17, 2022

@gsouf and @iliogr ... I figured out the issue (at least for my manifestation of this error). After the upgrade, the value in all of the "Cypress project base:" fields for my Intellij tests were deleted. After I put the proper value back in the fields, the tests run without the error. Here is a look at what I'm talking about:

CypressProjectBaseField

@lucasfraga-bnex
Copy link

any news?

@JonnyWideFoot
Copy link

JonnyWideFoot commented Aug 26, 2022

See: https://docs.cypress.io/guides/references/migration-guide#Cypress-Changes

"You may use the --config-file command line flag or the configFile module API option to specify a .js or .ts file. JSON config files are no longer supported."

It's working for me after changing:

/integration/config.json

{
  "baseUrl": "http://localhost:3000",
  "ignoreTestFiles": "**/config.json",
  "video": false,
  "experimentalSessionSupport": true
}

To:

/integration/config.js

const { defineConfig } = require('cypress')

module.exports = defineConfig({
  e2e: {
    baseUrl: 'http://localhost:3000',
    supportFile: false,
    video: false,
    experimentalSessionAndOrigin: true,
    specPattern: [
      "**/*.integration.test.ts"
    ]
  }
})

@w4dd325
Copy link

w4dd325 commented Sep 13, 2022

@drecali kudos, your comment "I just changed the workflow to explicitly declare config-file: cypress.config.ts and it worked." resolved my issue! Thank you.

@lalilaloe
Copy link

In my case I found that i had to use cypress-io/github-action@v4 after getting the following error with v2

image

@mosofsky
Copy link

mosofsky commented Nov 6, 2022

In my case, I think the problem was I forgot to commit the new files Cypress 10 migration generated. So Cypress ran successfully on my local computer but not on CI.

@Ayko1595
Copy link

Ayko1595 commented Dec 5, 2022

Hi! Has anyone found a solution to this? We are running cypress in a docker container. Is it necessary to explicitly select the relevant config file?

@matart15
Copy link

Look like this problem still exist on cypress-io/[email protected]

@MikeMcC399
Copy link
Collaborator

@matart15

Look like this problem still exist on cypress-io/[email protected]

There are several different problems mixed up in this issue. Which error message are you getting and which version of Cypress are you using?

@matart15
Copy link

matart15 commented Dec 27, 2022

version ( on my local OSX )

assuming versions are same on CI

$ yarn cypress -v 
yarn run v1.22.19
warning package.json: No license field
$ /.../node_modules/.bin/cypress -v
Cypress package version: 11.2.0
Cypress binary version: 11.2.0
Electron version: 21.0.0
Bundled Node version: 16.16.0
✨  Done in 0.66s.

config

// cypress.config.ts
import { defineConfig } from 'cypress'

export default defineConfig({
  e2e: {
    projectId: 'darxah',
    viewportWidth: 1920,
    viewportHeight: 1080,
    video: true,
    baseUrl: 'http://localhost:3000',
    chromeWebSecurity: false,
    watchForFileChanges: false,
    defaultCommandTimeout: 30000,
    setupNodeEvents(on, config) {
      require('@cypress/code-coverage/task')(on, config)
      on('before:browser:launch', (browser: any = {}, launchOptions) => {
        // `args` is an array of all the arguments that will
        // be passed to browsers when it launches
        console.log(launchOptions.args) // print all current args

        if (browser.name === 'chrome') {
          launchOptions.args.push('--disable-dev-shm-usage')          
          launchOptions.args.push('--disable-gpu')
        }

        // whatever you return here becomes the launchOptions
        return launchOptions
      })
      return config
    },
  },
})

problem

all tests Pass on my OSX.

But fails on CI. with this error

[4351:1227/131437.366155:ERROR:gpu_memory_buffer_support_x11.cc(44)] dri3 extension not supported.

tried and same result

  • --broswer electron
  • --browser chrome
  • --disable-gpu

github workflow setting

name: e2e

on:
  pull_request:

jobs:
  e2e:
    steps:
     ...
      - name: Cypress run
        uses: cypress-io/[email protected]
        with:
          working-directory: e2e
          wait-on-timeout: 30

@MikeMcC399
Copy link
Collaborator

MikeMcC399 commented Dec 27, 2022

@matart15

[4351:1227/131437.366155:ERROR:gpu_memory_buffer_support_x11.cc(44)] dri3 extension not supported.

I believe that you can ignore the gpu error. I have seen successful tests which also show this error, for example run 6438334587 from this repository's examples.

Are you also getting a message like:

"Could not find a Cypress configuration file in this folder: /home/runner/work/xxxx"

Which runner are you using?

If you use working-directory in a Cypress v10 or later Typescript environment, it should point to the directory containing cypress & cypress.config.ts. For instance, working-directory: my-test in the example below:

repo/
    app/
    my-test/
        cypress/
            e2e/
                spec.cy.ts
            fixtures/
            support/
                commands.ts
                e2e.ts
            tsconfig.json
        cypress.config.ts
        package.json

If cypress is not in a sub-directory, then you wouldn't need to specify working-directory. See the basic example.

The documentation for working-directory might be confusing because it uses e2e for an example before Cypress v10 was released. That is not the cypress/e2e directory! Probably the documentation should be updated to give a v9 and a separate v10 and later example to be clearer.

@MikeMcC399
Copy link
Collaborator

@matart15

@matart15
Copy link

@MikeMcC399 Thank you.

Yes. Indeed I am using monorepo. I will try later and let you know the result

@MikeMcC399
Copy link
Collaborator

@matart15

@matart15
Copy link

matart15 commented Jan 4, 2023

@MikeMcC399
It looks like my team already using working-directory.

Screenshot 2023-01-04 at 10 45 31

this is screenshot of github action fail

Screenshot 2023-01-04 at 10 49 36

ERROR:gpu_memory_buffer_support_x11.cc(44)] dri3 extension not supported.

no other information

v5.0.2 gives exact same result

on my macbook tests succeed

@MikeMcC399
Copy link
Collaborator

@matart15

Thank you for your screen shots and information. You mention only "ERROR:gpu_memory_buffer_support_x11.cc(44)] dri3 extension not supported." This error occurs with Cypress even without using cypress-io/github-action. It does not look like it is preventing your test running on GitHub.

If this is the only error you are seeing, then I think you can ignore it. If you want to discuss it more in relation to cypress-io/github-action please open a new issue. This issue is really about the error "Could not find a Cypress configuration file. We looked but did not find a cypress.json file in this folder."

@matart15
Copy link

matart15 commented Jan 4, 2023

@MikeMcC399

I see. Thank you for explanation.

I will try running my test on CI without cypress-io/github-action. ( not sure how to do it )

thank you again

@MikeMcC399
Copy link
Collaborator

@matart15

I will try running my test on CI without cypress-io/github-action. ( not sure how to do it )

I'm not sure that you need to do that.

@matart15
Copy link

matart15 commented Jan 4, 2023

@MikeMcC399

oh i see. i misunderstood your message. thank you for reproducable example

@MikeMcC399
Copy link
Collaborator

@matart15
Issue cypress-io/cypress#25357 about the graphics error message is now routed to the Cypress e2e team.

@MikeMcC399
Copy link
Collaborator

@kahboom

Are you still experiencing the issue you reported? If not, can this issue be closed now?

@kahboom
Copy link
Author

kahboom commented Jan 6, 2023

No longer having this issue, thanks @MikeMcC399

@kahboom kahboom closed this as completed Jan 6, 2023
@MikeMcC399
Copy link
Collaborator

@kahboom

No longer having this issue,

Excellent! Many thanks for your confirmation.

@maxie7
Copy link

maxie7 commented Jul 18, 2023

Hi, I have a problem with finding a cypress.config.ts file. Just with npx cypress open it works fine.

The problem is when I try to do it through docker-compose. I tried to copy cypress.config.ts file to /cypress folder. I also tried to investigate Cypress docs, no success.

image

How to define a path for cypress.config.ts in docker-compose file?!

@MikeMcC399
Copy link
Collaborator

@maxie7

It does not look like your problem is related to github-action of this repository, so this is not the right place to get help. Also you have tagged on to a closed issue which is in any case not advisable to get new help.

You may find that somebody in the Cypress technical community on Discord can help you solve your problem:

Discord chat
(click on button)

@maxie7
Copy link

maxie7 commented Jul 18, 2023

Thanks @MikeMcC399

@Sumbulmalik
Copy link

npx cypress open --config-file theNewCypressConfigPath solved by 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