Cypress: Cypress gives "libgconf-2.so.4: cannot open shared object file" error on Travis

Created on 30 Apr 2019  路  3Comments  路  Source: cypress-io/cypress

Current behavior:

image

Desired behavior:

To run successfully

Steps to reproduce: (app code and test code)

.travis.yml file is like this:

language: node_js
node_js:
    - 10.8
cache:
  directories:
    - ~/.npm
    - ~/.cache
  override:
    - npm install cypress --save-dev
install:
  - npm install cypress --save-dev

script:
  - $(npm bin)/cypress run --record false

Versions

Travis Platform: linux (Ubuntu Linux - 16.04)
Cypress Version: 3.1.1

travis

Most helpful comment

Just encountered the same issue which required an update to our travis.yml config file.

It seems Travis has been updated/ing its build environment to Ubuntu 16.04 from Ubuntu 14 in the past few days.

According to this non-Travis similar issue from 2018, it appears more recent versions of Ubuntu no longer include libgconf-2-4 by default.

Based on this similar issue/solution, the following appears to work:

  1. Add libgconf-2-4 to apt dependencies list, e.g. in travis.yml:
    addons: apt: packages: - libgconf-2-4
  2. _(Possibly not necessary)_ Add xvfb service (re: Travis recommendations):
    services: <ul> <li>xvfb<br />

  3. Run travis cache --delete from repository directory to clear/reset Travis caches. May need to install the Travis CLI. Or there might be another way in Travis UI to do this that haven't found yet.
    (Clearing cache might not be needed but haven't tested w/o this step).

(Off Topic) Will look into using Docker at some point in the future as well.

All 3 comments

Can you check some things? Do you have libgconf-2.so.4 in /home/username/.cache/Cypress/3.2.0/Cypress? If not, you might want to try deleting /home/username/.cache/Cypress/3.2.0 and reinstalling. Perhaps the unzipping got interrupted.

If you do indeed have /home/username/.cache/Cypress/3.2.0/Cypress/libgconf-2.so.4, can you run ldd to check that the correct libgconf-2.so.4 is being linked to?

You should be able to do this:

ldd /home/username/.cache/Cypress/3.2.0/Cypress/Cypress | grep libgconf-2

And receive this:

libgconf-2.so.4 => /home/username/.cache/Cypress/3.2.0/Cypress/libgconf-2.so.4 (0x00007f7800ddd000)

If not, something is wrong.

Also, you may want to look into running our docker images: https://github.com/cypress-io/cypress-docker-images

Just encountered the same issue which required an update to our travis.yml config file.

It seems Travis has been updated/ing its build environment to Ubuntu 16.04 from Ubuntu 14 in the past few days.

According to this non-Travis similar issue from 2018, it appears more recent versions of Ubuntu no longer include libgconf-2-4 by default.

Based on this similar issue/solution, the following appears to work:

  1. Add libgconf-2-4 to apt dependencies list, e.g. in travis.yml:
    addons: apt: packages: - libgconf-2-4
  2. _(Possibly not necessary)_ Add xvfb service (re: Travis recommendations):
    services: <ul> <li>xvfb<br />

  3. Run travis cache --delete from repository directory to clear/reset Travis caches. May need to install the Travis CLI. Or there might be another way in Travis UI to do this that haven't found yet.
    (Clearing cache might not be needed but haven't tested w/o this step).

(Off Topic) Will look into using Docker at some point in the future as well.

I have confirmed that adding to .travis.yml the following fixes the problem

addons:
  apt:
    packages:
    - libgconf-2-4

See https://travis-ci.org/cypress-io/cypress-example-kitchensink/jobs/527472634

Was this page helpful?
0 / 5 - 0 ratings