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

Missing execution bit from chromedriver preventing its execution #54

Closed
XavierVallot opened this issue Jul 11, 2018 · 23 comments
Closed
Labels
good first issue Good for newcomers

Comments

@XavierVallot
Copy link

XavierVallot commented Jul 11, 2018

Hi,
I'm trying to use Panthère in Symfony on Debian, but I have this error when launching my tests :
RuntimeException: sh: 1: exec: /srv/app/vendor/symfony/panthere/src/ProcessManager/../../chromedriver-bin/chromedriver_linux64: Permission denied

Indeed, here's the permission status :
image

Is there a way to install chromedriver without setting permissions by hand ?

@XavierVallot XavierVallot changed the title Permission denied on Symfony in VM Missing execution bit from chromedriver preventing its execution Jul 12, 2018
@dunglas
Copy link
Member

dunglas commented Jul 12, 2018

Is the project in a shared folder? The shared fs driver you use most likely not preserve permissions.

@Kocal
Copy link

Kocal commented Aug 8, 2018

Hey, me and @XavierVallot are working together and I just encountered the same issue.
So yes, we are on a shared FS (Vagrant), but I think it's more a composer issue than something else.

When running composer:
selection_779

When manually cloning the repo:
selection_780

Inside the VM, we are using php 7.2.7 and composer 1.6.5.

@Kocal
Copy link

Kocal commented Aug 9, 2018

@dunglas you are right, this problem only happens when we require a dependency inside this shared folder. I tried with non-shared folder /srv/app2 and it works.

I tried to update our Vagrantfile with this but it does not work:

config.vm.synced_folder '.', '/srv/app',
  type: 'nfs',
-  mount_options: ['nolock', 'actimeo=1', 'fsc']
+  mount_options: ['nolock', 'actimeo=1', 'fsc', 'exec']

Do you have an idea @tristanbes? 🤔

@tristanbes
Copy link

tristanbes commented Aug 9, 2018

maybe @nervo could enlight us on this (seems to happens only on Linux since on my OSX host, I can't reproduce)

I just can't figure why it's doing this only with this library since you don't have any problem with executable files (bin/console, bin/*, etc...)

@Kocal
Copy link

Kocal commented Aug 9, 2018

Maybe it is related to composer too?

@supertanuki
Copy link

supertanuki commented Sep 27, 2018

@XavierVallot @Kocal @tristanbes have you fixed the problem? same here with vagrant and shared FS

@tristanbes
Copy link

no, the team stopped using Panthere because of this issue. It was a nightmare to debug/work with. Other executables are fine (doctrine, symfony console etc...) it seems that it's related only with panthere.

We used Cypress for E2E tests.

@supertanuki
Copy link

thanks @tristanbes

@dunglas
Copy link
Member

dunglas commented Oct 8, 2018

@tristanbes you can always use your own binary using PANTHER_CHROME_DRIVER_BINARY if there is no other choice.
If someone can provide a repository with a reproducer, I can try to debug this.

@tristanbes
Copy link

tristanbes commented Oct 8, 2018 via email

@dunglas
Copy link
Member

dunglas commented Oct 8, 2018

I agree, but as I never faced this problem (and it is likely due to NFS, a volume or something like that), it's hard to debug without reproducer.

@Kocal
Copy link

Kocal commented Oct 8, 2018

If I remember well, I think it was a composer issue at the final... 😞
This is what I faced:

command context binary is executable ?
git clone outside VM yes
git clone inside VM, in shared path (NFS) yes
git clone inside VM, in non-shared path yes
composer req outside VM yes
composer req inside VM, in shared path (NFS) no
composer req inside VM, in non-shared path no

capture d ecran de 2018-10-08 22-15-02

I made a reproduction repository here: https://github.com/Kocal/symfony-panther-missing-executable-bit-nfs

Thanks for your time!

@Kocal
Copy link

Kocal commented Oct 8, 2018

and it is likely due to NFS, a volume or something like that

Yes, but not in this case.

I tried to install doctrine/orm because it's a package that has binary executables, and the file vendor/doctrine/orm/bin/doctrine is executable.

By looking at its composer.json, there is a special field bin which is specified, and I think it's the key because it's missing in Panther.

What happens if you add "bin": ["chromedriver-bin/chromedriver_linux64"] in composer.json?

@dunglas
Copy link
Member

dunglas commented Oct 8, 2018

Ok, I think I get what the problem is. As the Composer warning highlights, unzip is not installed. Unfortunately, it looks like the php ZIP extension is not able to preserve the executable bit of binaries.
Can you try if installing unzip fixes the problem? If it's the case, we should update the documentation to explain than having unzip installed is mandatory.

@dunglas
Copy link
Member

dunglas commented Oct 8, 2018

@Kocal, it's probably just a side effect, the bin entry allows packages to expose command line tools (https://getcomposer.org/doc/articles/vendor-binaries.md).
Maybe composer re-add the +x bit when copying the script in this repository, but the underlying issue is more likely that unzip is missing.

I don't think that copying Chromedriver in vendor/bin is a good idea, as it's not a tool designed to be used directly by the end user.

@Kocal
Copy link

Kocal commented Oct 8, 2018

As the Composer warning highlights, unzip is not installed.

Good catch, that was the problem!

@dunglas
Copy link
Member

dunglas commented Oct 8, 2018

Ok, I'm glad we sorted this out! The next step is to make it bold in the documentation that unzip must be installed to not have this issue.

@dunglas dunglas added the good first issue Good for newcomers label Oct 8, 2018
@tristanbes
Copy link

tristanbes commented Oct 8, 2018 via email

@mickaelandrieu
Copy link
Contributor

Need to check this, this could unlock some important topics for me 👍

@supertanuki
Copy link

supertanuki commented Oct 9, 2018

@dunglas thanks, installing unzip solved the problem for me too.

Then I had another problem:

chromedriver_linux64: error while loading shared libraries: libX11.so.6: cannot open shared object file: No such file or directory

I installed libxi6 and libgconf-2-4 too to fix the problem.
Hope this will help someone.

Edit: I was using chromium instead of chromedriver

@stof
Copy link
Member

stof commented Oct 9, 2018

Maybe composer re-add the +x bit when copying the script in this repository

yeah, composer indeed makes the file executable when creating it in vendor/bin (which makes the original file executable in case a symlink was used, which is the case on *nix systems)

@dunglas
Copy link
Member

dunglas commented Oct 9, 2018

@supertanuki: Chrome and Chromedriver binaries require some libraries that are not installed by default with Alpine.
Here it complains about the ones provided by Xorg, but there are probably some other missing.

@Surf-N-Code
Copy link

Sorry to comment an old issue, but I think it may be interesting for others landing here from google.

I kept getting this error:
RuntimeException: Could not start chrome (or it crashed) after 30 seconds.

Which was also due to the fact that I had run composer install before installing unzip.

dunglas pushed a commit that referenced this issue Dec 28, 2020
* Added a warning about the `unzip` command (closes #54)

* Rewording to make the warning easier to find with the search engines

* Clarifying the warning about the `unzip` command (concerns the *nix systems only)

* Fixed missing backtick
nicolas-grekas pushed a commit that referenced this issue Jan 18, 2021
* Added a warning about the `unzip` command (closes #54)

* Rewording to make the warning easier to find with the search engines

* Clarifying the warning about the `unzip` command (concerns the *nix systems only)

* Fixed missing backtick
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

8 participants