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

Extracted chromedriver for mac_arm64 / 115.0.5790.102 is not executable #547

Closed
bschuetze opened this issue Jul 24, 2023 · 6 comments
Closed

Comments

@bschuetze
Copy link

Hey,
I am trying to update a, previously working, webdriver_manager and selenium application to work with the new chrome release methods (as discussed in #536).
After updating to 3.9.1, I now get a new issue:

Trimmed Error:

PermissionError: [Errno 13] Permission denied: '/Users/user/.wdm/drivers/chromedriver/mac_arm64/115.0.5790.102/chromedriver-mac-arm64/chromedriver'

...

selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable may have wrong permissions. Please see https://sites.google.com/a/chromium.org/chromedriver/home

Checking using ls, we can see that the executable perm is missing.

ls -al@ /Users/user/.wdm/drivers/chromedriver/mac_arm64/115.0.5790.102/chromedriver-mac-arm64/
total 31064

...

-rw-r--r--@ 1 user\group  15661456 24 Jul 13:07 chromedriver

I don't know if this related to the recent changes to how chrome is releasing, or perhaps a selenium issue. However adding the following (testing hack) resolves the error:

# File: core/driver_cache.py
import stat

# ...

def save_file_to_cache(self, driver: Driver, file: File):
        path = self.__get_path(driver)
        archive = self.save_archive_file(file, path)
        files = self.unpack_archive(archive, path)
        binary = self.__get_binary(files, driver.get_name())
        binary_path = os.path.join(path, binary)
        self.__save_metadata(driver, binary_path)
        # Set executable permissions (FIX HERE)
        if self._os_system_manager.get_os_name() == "mac":
            current_perms = os.stat(binary_path)
            os.chmod(binary_path, current_perms.st_mode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)
        log(f"Driver has been saved in cache [{path}]")
        return binary_path
@SergeyPirogov
Copy link
Owner

Please provide a PR

@duncanariey
Copy link

Seeing the same issue, also on an M1 Mac; hoping a follow-up release to fix might be possible.

@bschuetze do you know if there a way to manually add that missing executable perm in the meantime? Doing chmod 755 on the chromedriver file causes Selenium to be unable to find the Chrome binary

@yuhymuk
Copy link

yuhymuk commented Jul 24, 2023

@bschuetze I've added your fix locally but it has not worked for Mac M1

@bschuetze
Copy link
Author

Seeing the same issue, also on an M1 Mac; hoping a follow-up release to fix might be possible.

@bschuetze do you know if there a way to manually add that missing executable perm in the meantime? Doing chmod 755 on the chromedriver file causes Selenium to be unable to find the Chrome binary

This is a chromedriver bug: https://bugs.chromium.org/p/chromium/issues/detail?id=1466427

Temp fix is to add this line to chrome options: options.binary_location = "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"

@bschuetze
Copy link
Author

@bschuetze I've added your fix locally but it has not worked for Mac M1

Are you still seeing the same error or is it a different one?

@SergeyPirogov
Copy link
Owner

Try to update selenium to latest version, it has to manage drivers itself

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

4 participants