Skip to content
This repository has been archived by the owner on Apr 1, 2019. It is now read-only.

Errno::ENOENT: No such file or directory when trying to execute chromedriver -v #48

Closed
svenagnew opened this issue Dec 5, 2017 · 6 comments

Comments

@svenagnew
Copy link

Hi,

I'm attempting to execute chromedriver in an alpine-based Docker container (as part of a test suite using Capybara).

System details as follows:

bash-4.3# rbenv version
2.3.1 (set by /root/.ruby-version)
bash-4.3# which chromedriver
/usr/local/rbenv/shims/chromedriver
bash-4.3# bundle show chromedriver-helper
/usr/local/rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/chromedriver-helper-1.1.0
bash-4.3# ls -alh /root/.chromedriver-helper/2.33/linux64/chromedriver
-rwxr-xr-x    1 root     root        8.5M Dec  5 08:12 /root/.chromedriver-helper/2.33/linux64/chromedriver
bash-4.3# uname -a
Linux 65a0a1bfa8f9 4.9.49-moby #1 SMP Wed Sep 27 23:17:17 UTC 2017 x86_64 Linux

When I execute bundle exec chromedriver -v I expect to see version information in the output. Instead I get the following error:

bash-4.3# bundle exec chromedriver -v
bundler: failed to load command: chromedriver (/usr/local/rbenv/versions/2.3.1/bin/chromedriver)
Errno::ENOENT: No such file or directory - /root/.chromedriver-helper/2.33/linux64/chromedriver
  /usr/local/rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/chromedriver-helper-1.1.0/lib/chromedriver/helper.rb:16:in `exec'
  /usr/local/rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/chromedriver-helper-1.1.0/lib/chromedriver/helper.rb:16:in `run'
  /usr/local/rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/chromedriver-helper-1.1.0/bin/chromedriver:5:in `<top (required)>'
  /usr/local/rbenv/versions/2.3.1/bin/chromedriver:23:in `load'
  /usr/local/rbenv/versions/2.3.1/bin/chromedriver:23:in `<top (required)>'

As can be seen from the above output, the system is failing to detect the existence of the .chromedriver-helper directory.

It may be worth noting that the OS as a chromedriver executable installed:

bash-4.3# /usr/bin/chromedriver -v
ChromeDriver 2.27 (94b3700c8cfd6ef738a417983f710f6ab96b8638)

However, I would expect both to be able to co-exist.

@cobusbernard
Copy link

cobusbernard commented Dec 5, 2017

We are seeing the same issue without the OS chromedriver installed. When doing ls -al, all appears fine (i.e. executable is present and has x flag):

# ls -al /root/.chromedriver-helper/2.33/linux64/
total 12748
drwxr-xr-x    2 root     root          4096 Dec  5 13:31 .
drwxr-xr-x    3 root     root          4096 Dec  5 13:29 ..
-rwxr-xr-x    1 root     root       8950080 Dec  5 13:31 chromedriver
-rw-r--r--    1 root     root       4091651 Dec  5 13:31 chromedriver_linux64.zip

When trying to run it manually, the following happens:

# /root/.chromedriver-helper/2.33/linux64/chromedriver
sh: /root/.chromedriver-helper/2.33/linux64/chromedriver: not found

@cobusbernard
Copy link

@svenagnew: I found the issue to be related to the glibc library that isn't available on Alpine via the main repos. There is https://github.com/sgerrand/alpine-pkg-glibc that you can use to compile with, but for chromedriver, it needs version 2.0, that repo only has 2.22+ available. Ended up removing the chromedriver-helper gem and just using the Alpine supplied version via apk add chromium-chromedriver. Everything is now working (finally).

@svenagnew
Copy link
Author

@cobusbernard - good catch.

I'll remove and install directly as you suggest. Thanks for the heads up.

@flavorjones
Copy link
Owner

I'm interested if anyone thinks this implies any missing behavior in chromedriver-helper? I just merged better handling for platform detection, and there's a discussion at #51 around how the gem should handle unsupported platforms ... which is tangentially related to platforms that already have chromedriver installed.

@MartinX3
Copy link

MartinX3 commented Aug 29, 2018

You saved my life.
With apk add chromium-chromedriver I've got a working chromedriver in docker/kubernetes with jenkins, after 3 days of research.

@flavorjones
Copy link
Owner

Closing as it's not clear if there's anything the gem should be doing differently. Happy to re-open if people would like to discuss.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants