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

dbus warnings with 9.0.0 image #555

Closed
jimfm opened this issue Nov 17, 2021 · 38 comments
Closed

dbus warnings with 9.0.0 image #555

jimfm opened this issue Nov 17, 2021 · 38 comments

Comments

@jimfm
Copy link

jimfm commented Nov 17, 2021

Switching from 8.7.0 to 9.0.0 image breaks our current Jenkins build with the following errors:

12:46:08  > cypress run "--config-file" "config/ci.json" "--headless" "--browser" "chrome" "--record" "--key=****"
12:46:08  
12:46:09  [126:1117/194609.299483:ERROR:bus.cc(392)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
12:46:09  [126:1117/194609.300787:ERROR:bus.cc(392)] Failed to connect to the bus: Address does not contain a colon
12:46:09  [126:1117/194609.300812:ERROR:bus.cc(392)] Failed to connect to the bus: Address does not contain a colon
12:46:09  [126:1117/194609.302689:ERROR:zygote_host_impl_linux.cc(263)] Failed to adjust OOM score of renderer with pid 316: Permission denied (13)
12:46:09  [316:1117/194609.311910:ERROR:gpu_init.cc(453)] Passthrough is not supported, GL is swiftshader, ANGLE is 
12:46:11  [OperationalError: EACCES: permission denied, mkdir '/root/.config/Cypress/cy/production/proxy'
12:46:11  
12:46:11  ] {
12:46:11    cause: [Error: EACCES: permission denied, mkdir '/root/.config/Cypress/cy/production/proxy'
12:46:11    
12:46:11    ] {
12:46:11      errno: -13,
12:46:11      code: 'EACCES',
12:46:11      syscall: 'mkdir',
12:46:11      path: '/root/.config/Cypress/cy/production/proxy'
12:46:11    },
12:46:11    isOperational: true,
12:46:11    errno: -13,
12:46:11    code: 'EACCES',
12:46:11    syscall: 'mkdir',
12:46:11    path: '/root/.config/Cypress/cy/production/proxy'
12:46:11  }
12:46:11  Error: EACCES: permission denied, mkdir '/root/.config/Cypress/cy/production/proxy'```

The warnings fail the build.

If I run the image locally as specified in the readme docker run -it -v $PWD:/e2e -w /e2e cypress/included:9.0.0

I get the following warnings, though the tests still run:

% docker run -it -v $PWD:/e2e -w /e2e cypress/included:9.0.0
[18:1117/205925.216129:ERROR:bus.cc(392)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
[18:1117/205925.219185:ERROR:bus.cc(392)] Failed to connect to the bus: Address does not contain a colon
[18:1117/205925.219244:ERROR:bus.cc(392)] Failed to connect to the bus: Address does not contain a colon
[186:1117/205925.244039:ERROR:gpu_init.cc(453)] Passthrough is not supported, GL is swiftshader, ANGLE is 
[18:1117/205928.199477:ERROR:bus.cc(392)] Failed to connect to the bus: Address does not contain a colon

Looking around for solutions indicates the dbus line
ENV DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus but I"m not that familiar with it to tell if that's the reason.

@CommCody
Copy link

Hi

I can confirm this behavior on az devops agent (Environment: ubuntu-20.04 Version: 20211108.1 Included Software: https://github.com/actions/virtual-environments/blob/ubuntu20/20211108.1/images/linux/Ubuntu2004-README.md Image Release: https://github.com/actions/virtual-environments/releases/tag/ubuntu20%2F20211108.1)

But on my work machine a windows 10 with Docker 4.2.0 with WSL 2 backend enabled, I get the following output:

[21:1118/092743.529997:ERROR:bus.cc(392)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
[21:1118/092743.532867:ERROR:bus.cc(392)] Failed to connect to the bus: Address does not contain a colon
[21:1118/092743.532906:ERROR:bus.cc(392)] Failed to connect to the bus: Address does not contain a colon
[185:1118/092743.584386:ERROR:gpu_init.cc(453)] Passthrough is not supported, GL is swiftshader, ANGLE is

====================================================================================================

  (Run Starting)

  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ Cypress:        9.0.0                                                                          │
  │ Browser:        Electron 94 (headless)                                                         │
  │ Node Version:   v16.5.0 (/usr/local/bin/node)                                                  │
[...]

so perhaps an on linux problem?

@jvavre
Copy link

jvavre commented Nov 19, 2021

Seeing same failure as @jimfm with the latest docker image (9.0.0) - Jenkins CI with docker as an agent.

@ulrik59
Copy link

ulrik59 commented Nov 24, 2021

Hello

I'm seeing the same problem on our CI going from Cypress v8.7.0 to v9.1.0.

[103:1124/102734.333572:ERROR:bus.cc(392)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
[103:1124/102734.334954:ERROR:bus.cc(392)] Failed to connect to the bus: Address does not contain a colon
[103:1124/102734.335062:ERROR:bus.cc(392)] Failed to connect to the bus: Address does not contain a colon
[103:1124/102734.375814:ERROR:zygote_host_impl_linux.cc(263)] Failed to adjust OOM score of renderer with pid 290: Permission denied (13)
[290:1124/102734.375928:ERROR:gpu_init.cc(453)] Passthrough is not supported, GL is swiftshader, ANGLE is 
[OperationalError: EACCES: permission denied, mkdir '/root/.config/Cypress/cy/production/proxy'

] {
  cause: [Error: EACCES: permission denied, mkdir '/root/.config/Cypress/cy/production/proxy'
  
  ] {
    errno: -13,
    code: 'EACCES',
    syscall: 'mkdir',
    path: '/root/.config/Cypress/cy/production/proxy'
  },
  isOperational: true,
  errno: -13,
  code: 'EACCES',
  syscall: 'mkdir',
  path: '/root/.config/Cypress/cy/production/proxy'
}
Error: EACCES: permission denied, mkdir '/root/.config/Cypress/cy/production/proxy'

It seems this docker image only works when launching the command as a root user, which is a huge regression.

@drenatus
Copy link

drenatus commented Nov 24, 2021

Same here: =(

Using cypress.json configuration:
Spec files:  cypress/integration/**/*.feature
[62:1124/193107.945289:ERROR:bus.cc(392)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
[62:1124/193107.951901:ERROR:bus.cc(392)] Failed to connect to the bus: Address does not contain a colon
[62:1124/193107.951946:ERROR:bus.cc(392)] Failed to connect to the bus: Address does not contain a colon
[231:1124/193107.976475:ERROR:gpu_init.cc(453)] Passthrough is not supported, GL is swiftshader, ANGLE is 
[OperationalError: EACCES: permission denied, mkdir '/root/.config/Cypress/cy/production/proxy'

] {
  cause: [Error: EACCES: permission denied, mkdir '/root/.config/Cypress/cy/production/proxy'
  
  ] {
    errno: -13,
    code: 'EACCES',
    syscall: 'mkdir',
    path: '/root/.config/Cypress/cy/production/proxy'
  },
  isOperational: true,
  errno: -13,
  code: 'EACCES',
  syscall: 'mkdir',
  path: '/root/.config/Cypress/cy/production/proxy'
}
Error: EACCES: permission denied, mkdir '/root/.config/Cypress/cy/production/proxy'

@omersomuncu
Copy link

omersomuncu commented Dec 1, 2021

Same issue here as well. Any suggestion or solution?

Using cypress.json configuration:
Spec files:  cypress/features/**/*.feature
[119:1201/121902.100138:ERROR:bus.cc(392)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
[119:1201/121902.103411:ERROR:bus.cc(392)] Failed to connect to the bus: Address does not contain a colon
[119:1201/121902.103813:ERROR:bus.cc(392)] Failed to connect to the bus: Address does not contain a colon
[119:1201/121902.114437:ERROR:zygote_host_impl_linux.cc(263)] Failed to adjust OOM score of renderer with pid 292: Permission denied (13)
[292:1201/121902.130933:ERROR:gpu_init.cc(453)] Passthrough is not supported, GL is swiftshader, ANGLE is 
[OperationalError: EACCES: permission denied, mkdir '/root/.config/Cypress/cy/production/proxy'

] {
  cause: [Error: EACCES: permission denied, mkdir '/root/.config/Cypress/cy/production/proxy'
  
  ] {
    errno: -13,
    code: 'EACCES',
    syscall: 'mkdir',
    path: '/root/.config/Cypress/cy/production/proxy'
  },
  isOperational: true,
  errno: -13,
  code: 'EACCES',
  syscall: 'mkdir',
  path: '/root/.config/Cypress/cy/production/proxy'
}
Error: EACCES: permission denied, mkdir '/root/.config/Cypress/cy/production/proxy'

@jimfm
Copy link
Author

jimfm commented Dec 6, 2021

@flotwig Any chance someone can check on this? I'm seeing other tickets with similar descriptions.
For me, this just started with 9+ Cypress, if I downgrade to 8.7.* I no longer get the error.

@omersomuncu
Copy link

same here. After I downgraded 8.7, problem disappeared.

@drenatus
Copy link

drenatus commented Dec 9, 2021

for now i'm using the 8.7 image and update cypress before running the build

@emilyrohrbough
Copy link
Member

emilyrohrbough commented Dec 9, 2021

Those of you seeing this issue, can you please share the OS being used & the docker command being ran that produced this error? It would be helpful to link to any builds as a reference as well.

@vincentchalamon
Copy link

vincentchalamon commented Dec 9, 2021

Hi @emilyrohrbough,

OS: Ubuntu 20.04
Docker: 20.10.11
Command:

docker run \
       --rm \
       --pull always \
       --env CYPRESS_BASE_URL=https://foo.local \
       --entrypoint sh \
       --volume ${PWD}/e2e:/e2e \
       --workdir /e2e \
       cypress/included:9.0.0 \
       -c "npm install -y && cypress run --spec 'cypress/integration/**/*.ts'"

@drenatus
Copy link

drenatus commented Dec 9, 2021

SO: Ubuntu 20.04

FROM cypress/included:9.1.1
WORKDIR /app
ENV COMMAND="test:headless-plataforma"
ENTRYPOINT npm install && npm run ${COMMAND}

@jvavre
Copy link

jvavre commented Dec 13, 2021

OS: CentOS 7.0
Docker: 20.10.2, build 2291f61
Used image: cypress/included:9.0.0 (same error 9.1.0 and 9.1.1)
Command (within docker -c): NO_COLOR=1 npx cypress run

@cport93
Copy link

cport93 commented Jan 5, 2022

Same here:

  cypress:server:server-e2e createServer connecting to server +0ms
  cypress:server:server-base Server listening on  { address: '127.0.0.1', family: 'IPv4', port: 33005 } +9ms
  cypress:server:appdata path: /root/.config/Cypress/cy/production/proxy +2s
  cypress:server:file get values from /root/.config/Cypress/cy/production/cache +0ms
  cypress:server:file attempt to get lock on /root/.config/Cypress/cy/production/cache +0ms
  cypress:server:file getting lock succeeded or failed for /root/.config/Cypress/cy/production/cache +3ms
  cypress:server:file read /root/.config/Cypress/cy/production/cache +1ms
  cypress:server:file read succeeded or failed for /root/.config/Cypress/cy/production/cache +0ms
  cypress:server:file attempt to unlock /root/.config/Cypress/cy/production/cache +0ms
  cypress:server:file get values from /root/.config/Cypress/cy/production/cache +2ms
  cypress:server:file unlock succeeded or failed for /root/.config/Cypress/cy/production/cache +0ms
  cypress:server:api request to url: POST https://api.cypress.io/exceptions with params: {"body":{"err":{"name":"Error","message":"EACCES: permission denied, mkdir <stripped-path>proxy'","stack":"Error: EACCES: permission denied, mkdir <stripped-path>proxy'\n\n"},"version":"9.2.0","osName":"linux","osVersion":"Debian - 10.11","osCpus":[{"model":"Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz","speed":2499,"times":{"user":156226950,"nice":23060,"sys":96793660,"idle":5031019140,"irq":0}},{"model":"Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz","speed":2499,"times":{"user":157508390,"nice":23310,"sys":96658260,"idle":5033473390,"irq":0}},{"model":"Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz","speed":2499,"times":{"user":203386430,"nice":19080,"sys":96800880,"idle":4992580310,"irq":0}},{"model":"Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz","speed":2499,"times":{"user":203692880,"nice":18860,"sys":95624250,"idle":4993402220,"irq":0}}],"osMemory":{"free":388730880,"total":16515055616}},"headers":{"x-os-name":"linux","x-cypress-version":"9.2.0"}} and token: undefined +0ms
  cypress:network:agent addRequest called { isHttps: true, href: 'https://api.cypress.io/exceptions' } +0ms
  cypress:network:connect beginning getAddress { hostname: 'api.cypress.io', port: 443 } +0ms
[OperationalError: EACCES: permission denied, mkdir '/root/.config/Cypress/cy/production/proxy'

] {
  cause: [Error: EACCES: permission denied, mkdir '/root/.config/Cypress/cy/production/proxy'
  
  ] {
    errno: -13,
    code: 'EACCES',
    syscall: 'mkdir',
    path: '/root/.config/Cypress/cy/production/proxy'
  },
  isOperational: true,
  errno: -13,
  code: 'EACCES',
  syscall: 'mkdir',
  path: '/root/.config/Cypress/cy/production/proxy'
}
Error: EACCES: permission denied, mkdir '/root/.config/Cypress/cy/production/proxy'


  cypress:server:browsers browsers.kill called with no active instance +1s

FROM cypress/included:9.2.0

@jvavre
Copy link

jvavre commented Jan 5, 2022

Hi @emilyrohrbough,

any known workarounds other than running as root (regression and not greatest option to go for I'd say) or recommended to stay on 8.7.0 until resolved?

Thanks!

@jbird21
Copy link

jbird21 commented Jan 10, 2022

Hmm, when I go back to 8.7.0 using the above advice, i still get the same error output. Am running off Docker (Linux)

@russoale
Copy link

According to Google Chrome headless needs a temporary --disable-gpu (see here).
And it seems this is also required for Linux (see here)

But I guess this is better reported to cypress repo

@BurhanH
Copy link

BurhanH commented Jan 21, 2022

Hm... Duplicate? #543

@jvavre
Copy link

jvavre commented Jan 26, 2022

Hm... Duplicate? #543

Warnings in the 8.7.0 do not fail the whole build/run, which they do with 9.0.0 img

@BurhanH
Copy link

BurhanH commented Jan 26, 2022

Hm... Duplicate? #543

Warnings in the 8.7.0 do not fail the whole build/run, which they do with 9.0.0 img

Try to use the latest image 9.3.1 for the build/run

@jvavre
Copy link

jvavre commented Jan 26, 2022

Hm... Duplicate? #543

Warnings in the 8.7.0 do not fail the whole build/run, which they do with 9.0.0 img

Try to use the latest image 9.3.1 for the build/run

Getting same output as on 9.0.0

@BurhanH
Copy link

BurhanH commented Jan 26, 2022

@jvavre Are you able to execute the test scenarious?

Unfortunately, I did not find yet any proper solution to fix or suppress those messages in the Docker:

[40:0125/141303.227644:ERROR:bus.cc(392)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory [40:0125/141303.229198:ERROR:bus.cc(392)] Failed to connect to the bus: Address does not contain a colon [40:0125/141303.229233:ERROR:bus.cc(392)] Failed to connect to the bus: Address does not contain a colon [40:0125/141303.234094:ERROR:bus.cc(392)] Failed to connect to the bus: Address does not contain a colon [227:0125/141303.247145:ERROR:gpu_init.cc(453)] Passthrough is not supported, GL is swiftshader, ANGLE is [40:0125/141304.982156:ERROR:bus.cc(392)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory [40:0125/141304.984311:ERROR:bus.cc(392)] Failed to connect to the bus: Address does not contain a colon [40:0125/141304.984354:ERROR:bus.cc(392)] Failed to connect to the bus: Address does not contain a colon [228:0125/141305.000558:ERROR:gpu_init.cc(453)] Passthrough is not supported, GL is swiftshader, ANGLE is

But our tests are OK to run with the latest image 9.3.1 except for those annoying messages.

@jvavre
Copy link

jvavre commented Jan 31, 2022

@jvavre Are you able to execute the test scenarious?

Hey! Can't, still failing with latest image (9.3.1) as mentioned above - I assume root permission might work, but can't do that with the policy set up in CI

@bode-praetorian
Copy link

Also confirmed in 9.3.1 image. Using Mac OS 11.6 and Docker desktop 4.4.2 (73305). Also get while running the tests [19:0131/221005.330335:ERROR:bus.cc(392)] Failed to connect to the bus: Address does not contain a colon. In addition to the above mentioned three lines.

@Develliot
Copy link

Develliot commented Feb 3, 2022

I'm on 9.4.1 and I'm still getting

Error: EACCES: permission denied, mkdir '/root/.config/Cypress/cy/production/proxy'

I believe it is running in root, when I run it as user 'node' I get different errors about not being able to write to the video directory because it doesn't have root permissions

This isn't just warnings, the test fails and exits with error code 1

I'm not seeing this issue when running cypress in docker locally, I'm only seeing this use when running cypress on docker via a github action.

@Develliot
Copy link

Develliot commented Feb 4, 2022

This might be a node 14 only error, when I update to node 16,

I get a different error, this happens across all jobs not just the cypress one.

EACCES: permission denied, mkdir '/root/.cache/Cypress'

E2A when I update to node 16 I need to set the cypress cash CYPRESS_CACHE_FOLDER then I am stuck with the

Error: EACCES: permission denied, mkdir '/root/.config/Cypress/cy/production/proxy'

@Develliot
Copy link

Develliot commented Feb 4, 2022

I have got further but still no cigar.

So the main issue:

Error: EACCES: permission denied, mkdir '/root/.config/Cypress/cy/production/proxy'

I never see locally I only see on github actions when running docker-compose calling cypress, so here is my docker-compose file:

version: "3.7"

services:
  npm:
    user: root
    image: node:16
    volumes:
      - .:/app:delegated
    working_dir: /app
    environment:
      CYPRESS_CACHE_FOLDER: ./cy-cache-here
    entrypoint: "/usr/local/bin/npm install"
  cypress:
    user: root
    networks:
      network:
    image: cypress/included:9.4.1
    working_dir: /app
    volumes:
      - .:/app:delegated
    entrypoint: npx cypress run-ct

networks:
  network:

I'm not convinced user: root does a thing

Here is what my git hub action looks like

name: "Test"
on:
  pull_request:
    branches:
      - develop
      - master

jobs:
  Cypress:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout cruk-react-components
        uses: actions/[email protected]
      - name: npm install
        run: docker-compose run npm ci
      - name: Test
        run: docker-compose run cypress

It always fails at the Test step. However when I set the user on the github action (the last line from above) to:

run: docker-compose run -u node cypress
      

It sort of works, it actually starts the test, but because I'm not root, and cypress needs root to save to /vidoes and /snpashots it errors at that bit like this:

Screenshot 2022-02-04 at 16 49 23

I also tried user '1001' based on another thread I think it was the cypress github actions repo issues people are experiencing similar problems their and are saying use user 1001 here cypress-io/github-action#446 clutching at straws now so I tried this:

run: docker-compose run -u "1001" cypress
      

Then I get a new error probably because that user doesn't exist:

Screenshot 2022-02-04 at 16 56 59

It doesn't matter what user stuff I put in the docker-compose file, the only thing that seems to have a bearing on this is the user set when running the docker compose from the github action workflow.

@Develliot
Copy link

Develliot commented Feb 4, 2022

I've just had a look at the generated docker files for

cypress/included:9.4.1

and anything before cypress/included:9.0.0. so 8.7 and under

where this issue doesn't exist and the only difference I can see is the jump from node 14 to node 16, or npm from 6 to >7

I also checked that when I updated my project to node 16 with all my docker images on node 16 except for the cypress, kept that at 8.7.0 (node 14) as long as I defined the CYPRESS_CACHE_FOLDER as an env var everything was fine.

The moment I use cypress/included:9.0.0 + which has node 16, I see the issue. So i don't think it's an issue with github actions + docker + node 16, this is definitely a cypress/included specific issue.

@Develliot
Copy link

Develliot commented Feb 8, 2022

Ah ha! A colleague figured it out, it's when the host machine is Ubuntu which is what GitHub Actions uses and I assume other CI products also. You need to be explicit about the entry point location

/my_root_dir_name/node_modules/cypress/bin/cypress run-ct

It worked locally with docker-compose because either the host OS is different or it was different or it was using a different flavour of debian.

I think there are issues with different services on the same container talking to each other and their permissions with Unbuntu and NPM >7, especially when using npx

So we simplified my multistage build which had a services based on node 16 image that ran npm ci and another service image based on cypress/included:9.4.1 image with an entry point of npx cypress run-ct

We now have one service based on the cypress/included:9.4.1 that does everything and there were no EACCES issues

so docker compose just looks like this:

version: "3.7"

services:
  cypress:
    networks:
      network:
    image: cypress/included:9.4.1
    working_dir: /app
    volumes:
      - .:/app:delegated
    entrypoint: /app/node_modules/cypress/bin/cypress run-ct

networks:
  network:

Now npx didn't work but pointing to the run-ctscript from the actual location works, almosts as if 'npx' was ignoring all the envionment variables which gave the user permissions to do stuff

and the git hub action like this

name: "Test"
on:
  pull_request:
    branches:
      - develop
      - master

jobs:
  Cypress:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout cruk-react-components
        uses: actions/[email protected]
      - name: npm install
        run: docker-compose run --entrypoint=npm cypress ci
      - name: Test
        run: docker-compose run cypress
      - name: Work around our usage of Github storage
        if: failure()
        run: |
          mkdir output
          tar cvfj output/videos.tar.bz2 -C cypress/videos .
          tar cvfj output/screenshots.tar.bz2 -C cypress/screenshots .
          tar cvfj output/snapshots.tar.bz2 -C cypress/snapshots .
      - name: Upload Cypress output
        if: failure()
        uses: actions/[email protected]
        with:
          name: output
          path: output

so the thing to note here is that the cypress/included:9.4.1 image is where npm ci runs and then runs the other entry point with run-ct all in the same services and the node-modules are loaded into a location where this service user definitely has permissions

There is the caveat that I'm now installing cypress when before I didn't have I just used the one on the cypress/included image but at least it works.

@jimfm
Copy link
Author

jimfm commented Feb 10, 2022

One solution came up for us running Cypress >= 9.0.0 using the docker containers in our CI system, running the official images in Kubernetes.
In setting up the pod, add the following configuration:

spec:
  securityContext:
    runAsUser: 1000
    runAsGroup: 3000
    fsGroup: 2000

This fixed the permissions issues I had going on. I'm not sure what difference this is related to, but it fixed my issue. Hopefully it can helps someone else.

@jvavre
Copy link

jvavre commented Feb 11, 2022

This fixed it for me after a LOT of tries, without setting root permissions: cypress-io/cypress#2821 (comment) - I've found it buried there after going through a LOT of threads regarding this issue. I've just set these two env vars in Jenkinsfile.

@cport93
Copy link

cport93 commented Feb 18, 2022

This fixed it for me after a LOT of tries, without setting root permissions: cypress-io/cypress#2821 (comment) - I've found it buried there after going through a LOT of threads regarding this issue. I've just set these two env vars in Jenkinsfile.

It worked for me too, thank you!

@flamingbear
Copy link

flamingbear commented Feb 18, 2022

I'm feeling like this is an I don't understand docker, but just changing the env vars, leaves me without an ability to run the cypress/included binary

--
| The cypress npm package is installed, but the Cypress binary is missing.
|
| We expected the binary to be installed here: /cumulus-dashboard/cache/9.4.1/Cypress/Cypress
|
| Reasons it may be missing:
|
| - You're caching 'node_modules' but are not caching this path: cache/.cache/Cypress
| - You ran 'npm install' at an earlier build step but did not persist: cache/.cache/Cypress
|
| Properly caching the binary will fix this error and avoid downloading and unzipping Cypress.
|
| Alternatively, you can run 'cypress install' to download the binary again.
|
| https://on.cypress.io/not-installed-ci-error

where "/cumulus-dashboard/"is my pwd in my docker-compose file

@omersomuncu
Copy link

This fixed it for me after a LOT of tries, without setting root permissions: cypress-io/cypress#2821 (comment) - I've found it buried there after going through a LOT of threads regarding this issue. I've just set these two env vars in Jenkinsfile.

Could you please elaborate what have u changed? I am still using 8.7.0 due to same issue

@jvavre
Copy link

jvavre commented Feb 28, 2022

Your use case might be different - we use Jenkinsfile within our repo to run integration/smoke tests in Jenkins CI server.

As in the linked comment, I've changed the default cache folders to be same with a new home folder (apparently those we did not have permission to access) in the prep and run tests stage of the setup.

stage('Preparation') { environment { TESTENV="<redacted>" SPECPATH="<redacted>" HOME="${pwd()}/cache" CYPRESS_CACHE_FOLDER="${pwd()}/cache" } steps { script { sh 'npm install' } } } stage('Run tests') { environment { TESTENV="<redacted>" SPECPATH="<redacted>" HOME="${pwd()}/cache" CYPRESS_CACHE_FOLDER="${pwd()}/cache" } steps { script { sh 'npm run headless $TESTENV $SPECPATH' } } }

@gargshashank0107
Copy link

Hi, I am facing the same issue, any version after 8.5 throws the below error when running is docker, irrespective of the cypress base image version.
Through the execution passes but the it very very slow and not usable Any help is appreciated

[229:0310/175236.574225:ERROR:bus.cc(392)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
[229:0310/175236.579905:ERROR:bus.cc(392)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[229:0310/175236.579976:ERROR:bus.cc(392)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[394:0310/175236.696633:ERROR:gpu_init.cc(453)] Passthrough is not supported, GL is swiftshader, ANGLE is

────────────────────────────────────────┐
│ Cypress: 9.5.0 │
│ Browser: Electron 94 (headless) │

[229:0310/175241.102373:ERROR:bus.cc(392)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")

@admah
Copy link
Contributor

admah commented Apr 7, 2022

See this comment for an update on this issue.

@Markus-Ende
Copy link

I don't know if this helps someone, but for us the fix was to avoid running npm scripts.

We're running cypress in an NX repo, so instead of

npx nx affected ...

we now run

node node_modules/.bin/nx affected ...

and everything works.

This is, because npm messes with file ownership, see [RRFC] Clean up file ownership story

@mjhenkes
Copy link
Member

dbus errors were 'corrected' here: cypress-io/cypress#20939

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