Skip to content

OSError: [Errno 45] in CIFS share but well in NFS share #3754

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

Closed
rdcyuxi opened this issue May 18, 2025 · 2 comments
Closed

OSError: [Errno 45] in CIFS share but well in NFS share #3754

rdcyuxi opened this issue May 18, 2025 · 2 comments
Labels
external Outside SeleniumBase's scope. / Ask somewhere else. invalid usage You may need to change what you're doing UC Mode / CDP Mode Undetected Chromedriver Mode / CDP Mode

Comments

@rdcyuxi
Copy link

rdcyuxi commented May 18, 2025

OS: macOS Sonoma 14.7.5
Python: 3.13
SeleniumBase: 4.38.2

It's weird that if script is located in CIFS share it reported OSError, but works well in NFS share.

e.g. example/raw_turnstile.py

python3 raw_turnstile.py
=========================================================================== {raw_turnstile.py:3:SB} starts ===========================================================================
Traceback (most recent call last):
  File "/Users/yaleyu/Library/Python/3.13/lib/python/site-packages/fasteners/process_lock.py", line 85, in _try_acquire
    self.trylock()
    ~~~~~~~~~~~~^^
  File "/Users/yaleyu/Library/Python/3.13/lib/python/site-packages/fasteners/process_lock.py", line 203, in trylock
    _interprocess_mechanism.trylock(self.lockfile)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "/Users/yaleyu/Library/Python/3.13/lib/python/site-packages/fasteners/process_mechanism.py", line 61, in trylock
    fcntl.lockf(lockfile, fcntl.LOCK_EX | fcntl.LOCK_NB)
    ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: [Errno 45] Operation not supported

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/yaleyu/mnt/build/SeleniumBase/examples/raw_turnstile.py", line 3, in <module>
    with SB(uc=True, test=True) as sb:
         ~~^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.13.3/Frameworks/Python.framework/Versions/3.13/lib/python3.13/contextlib.py", line 141, in __enter__
    return next(self.gen)
  File "/Users/yaleyu/Library/Python/3.13/lib/python/site-packages/seleniumbase/plugins/sb_manager.py", line 1281, in SB
    sb.setUp()
    ~~~~~~~~^^
  File "/Users/yaleyu/Library/Python/3.13/lib/python/site-packages/seleniumbase/fixtures/base_case.py", line 15312, in setUp
    self.driver = self.get_new_driver(
                  ~~~~~~~~~~~~~~~~~~~^
        browser=self.browser,
        ^^^^^^^^^^^^^^^^^^^^^
    ...<54 lines>...
        d_p_r=self.__device_pixel_ratio,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/Users/yaleyu/Library/Python/3.13/lib/python/site-packages/seleniumbase/fixtures/base_case.py", line 4245, in get_new_driver
    new_driver = browser_launcher.get_driver(
        browser_name=browser_name,
    ...<56 lines>...
        browser=browser_name,
    )
  File "/Users/yaleyu/Library/Python/3.13/lib/python/site-packages/seleniumbase/core/browser_launcher.py", line 3176, in get_driver
    return get_local_driver(
        browser_name,
    ...<53 lines>...
        device_pixel_ratio,
    )
  File "/Users/yaleyu/Library/Python/3.13/lib/python/site-packages/seleniumbase/core/browser_launcher.py", line 4992, in get_local_driver
    with uc_lock:  # Avoid multithreaded issues
         ^^^^^^^
  File "/Users/yaleyu/Library/Python/3.13/lib/python/site-packages/fasteners/process_lock.py", line 166, in __enter__
    gotten = self.acquire()
  File "/Users/yaleyu/Library/Python/3.13/lib/python/site-packages/fasteners/process_lock.py", line 149, in acquire
    gotten = r(self._try_acquire, blocking, watch)
  File "/Users/yaleyu/Library/Python/3.13/lib/python/site-packages/fasteners/_utils.py", line 103, in __call__
    return fn(*args, **kwargs)
  File "/Users/yaleyu/Library/Python/3.13/lib/python/site-packages/fasteners/process_lock.py", line 93, in _try_acquire
    raise threading.ThreadError("Unable to acquire lock on"
    ...<5 lines>...
                                })
RuntimeError: Unable to acquire lock on `b'downloaded_files/driver_fixing.lock'` due to [Errno 45] Operation not supported
@mdmintz mdmintz added invalid usage You may need to change what you're doing external Outside SeleniumBase's scope. / Ask somewhere else. UC Mode / CDP Mode Undetected Chromedriver Mode / CDP Mode labels May 18, 2025
@mdmintz
Copy link
Member

mdmintz commented May 18, 2025

Looks like a permissions issue on an external dependency, fasteners (https://pypi.org/project/fasteners/).
You'll need to use a folder where your program has permissions to write files.

Since the error is coming from an external dependency, there's not much that I can do from SeleniumBase's end, however you can change where you run your program so that the the necessary permissions are available.

@mdmintz mdmintz closed this as completed May 18, 2025
@rdcyuxi
Copy link
Author

rdcyuxi commented May 19, 2025

Thanks for your prompt reply. Permission is right, I believe it's an CIFS issue. Searched in fasteners issues list, there's nothing talked about CIFS.

As workaroud I manually changed DOWNLOADS_FOLDER = '/tmp/downloaded_files' in fixtures/constants.py.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external Outside SeleniumBase's scope. / Ask somewhere else. invalid usage You may need to change what you're doing UC Mode / CDP Mode Undetected Chromedriver Mode / CDP Mode
Projects
None yet
Development

No branches or pull requests

2 participants