SeleniumHQ / selenium

A browser automation framework and ecosystem.
https://selenium.dev
Apache License 2.0
30.23k stars 8.12k forks source link

[🐛 Bug]: Selenium 4.21 Python — cannot load selenium-manager #13974

Closed workflowsguy closed 2 months ago

workflowsguy commented 4 months ago

What happened?

After upgrading Selenium from 4.20 to 4.21, the existing geckodriver is no longer found. In the console, I can see that the binary is in /opt/local/bin/geckodriver

However, my script that has worked until yesterday with Selenium 4.20, now outputs

NoSuchDriverException: Message: Unable to obtain driver for firefox; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors/driver_location

Adding the line service = webdriver.ChromeService(executable_path='/opt/local/bin/geckodriver') to my code has no effect.

How can we reproduce the issue?

from selenium import webdriver
from selenium.webdriver.firefox.options import Options

Browseroptionen = Options()
Browseroptionen.set_preference("browser.download.folderList", 2)
Browseroptionen.set_preference("browser.download.manager.showWhenStarting", False)
Browseroptionen.set_preference("browser.download.dir", "/Users/stefan/Eingang")
Browseroptionen.set_preference("browser.helperApps.neverAsk.saveToDisk", "application/pdf")
Browseroptionen.set_preference("browser.download.useDownloadDir", True)
Browseroptionen.set_preference("browser.download.viewableInternally.enabledTypes", "")
Browseroptionen.set_preference("pdfjs.disabled", True)
Browseroptionen.set_preference("browser.download.alwaysOpenPanel", False)

with webdriver.Firefox(options=Browseroptionen) as browser:
    browser.set_window_rect(x=0, y=22, width=1280, height=1372)

Relevant log output

ERROR:root:File "/Users/guy/Library/Python/3.11/lib/python/site-packages/selenium/webdriver/common/driver_finder.py", line 67, in _binary_paths
    52   def _binary_paths(self) -> dict:
 (...)
    63               if not Path(path).is_file():
    64                   raise ValueError(f"The path is not a valid file: {path}")
    65               self._paths["driver_path"] = path
    66           else:
--> 67               output = SeleniumManager().binary_paths(self._to_args())
    68               if Path(output["driver_path"]).is_file():
    ..................................................
     self = <selenium.webdriver.common.driver_finder.DriverFinder object
              at 0x118825010>
     path = None
     self._paths = {'driver_path': '',
                    'browser_path': ''}
     self._to_args = <method 'DriverFinder._to_args' of <selenium.webdriver.commo
                      n.driver_finder.DriverFinder object at 0x118825010> driver_f
                      inder.py:81>
    ..................................................

File "/Users/guy/Library/Python/3.11/lib/python/site-packages/selenium/webdriver/common/selenium_manager.py", line 53, in binary_paths
    37   def binary_paths(self, args: List) -> dict:
 (...)
    49       args.append("python")
    50       args.append("--output")
    51       args.append("json")
    52
--> 53       return self._run(args)
    ..................................................
     self = <selenium.webdriver.common.selenium_manager.SeleniumManager
             object at 0x118824fd0>
     args = ['/Users/guy/Library/Python/3.11/lib/python/site-packages
             /selenium/webdriver/common/macos/selenium-manager', '--brows
             er', 'firefox', '--language-binding', 'python', '--output',
             'json', ]
     self._run = <function 'SeleniumManager._run' selenium_manager.py:94>
    ..................................................

File "/Users/guy/Library/Python/3.11/lib/python/site-packages/selenium/webdriver/common/selenium_manager.py", line 118, in _run
    95   def _run(args: List[str]) -> dict:
 (...)
    114
    115      SeleniumManager._process_logs(output["logs"])
    116      result = output["result"]
    117      if completed_proc.returncode:
--> 118          raise WebDriverException(
    119              f"Unsuccessful command executed: {command}; code: {completed_proc.returncode}\n{result}\n{stderr}"
    ..................................................
     args = ['/Users/guy/Library/Python/3.11/lib/python/site-packages
             /selenium/webdriver/common/macos/selenium-manager', '--brows
             er', 'firefox', '--language-binding', 'python', '--output',
             'json', ]
     output = {'logs': [],
               'result': {}}
     result = {}
     completed_proc.returncode = -6
    ..................................................

---- (full traceback above) ----
File "/Users/guy/Library/Python/3.11/lib/python/site-packages/selenium/webdriver/common/driver_finder.py", line 67, in _binary_paths
    output = SeleniumManager().binary_paths(self._to_args())
File "/Users/guy/Library/Python/3.11/lib/python/site-packages/selenium/webdriver/common/selenium_manager.py", line 53, in binary_paths
    return self._run(args)
File "/Users/guy/Library/Python/3.11/lib/python/site-packages/selenium/webdriver/common/selenium_manager.py", line 118, in _run
    raise WebDriverException(

WebDriverException: Message: Unsuccessful command executed: /Users/guy/Library/Python/3.11/lib/python/site-packages/selenium/webdriver/common/macos/selenium-manager --browser firefox --language-binding python --output json; code: -6
{}
dyld: cannot load 'selenium-manager' (load command 0x80000034 is unknown)

The above exception was the direct cause of the following exception:

File "/Users/guy/bin/Bankinteraktionen.py", line 2518, in <module>
    2514          Durchführungsstatus_Bankinteraktionen = json.load(Statusdatei)
    2515  except Exception as Dateifehler:
    2516      print(
    2517          'Inhalt der JSON-Datei konnte nicht eingelesen werden. Existiert die Datei? Ist sie leer? Ist die Datenstruktur fehlerhaft?')
--> 2518  main()
    2519
    ..................................................
     Durchführungsstatus_Bankinteraktionen = {'Raiffeisen': '2024-05-17',
                                              'Schöllerbank': '2024-05-17',
                                              'Bank Austria': '2024-05-17',
                                              'Erste Bank': '2024-05-11'}
     json.load = <function 'load' __init__.py:274>
     Statusdatei = <_io.TextIOWrapper name='/Users/guy/.config/Bankinterakti
                    onen/Durchführungsstatus.json' mode='r' encoding='UTF-8'>
    ..................................................

File "/Users/guy/bin/Bankinteraktionen.py", line 2406, in main
    2370  def main():
 (...)
    2402      Bankname: str = ''
    2403
    2404  # 2024-05-01: wegen Fehler mit seleniumwire dzt. auskommentiert
    2405      # with webdriver.Firefox(options=Browseroptionen, seleniumwire_options=SeleniumWireOptionen) as browser:
--> 2406      with webdriver.Firefox(options=Browseroptionen) as browser:
    2407          # ImplicitWaitimeout = browser.manage().timeouts().getImplicitWaitTimeout().getSeconds()
    ..................................................
     Bankname = ''
     Browseroptionen = <selenium.webdriver.firefox.options.Options object at 0x1188
                        251d0>
    ..................................................

File "/Users/guy/Library/Python/3.11/lib/python/site-packages/selenium/webdriver/firefox/webdriver.py", line 57, in __init__
    38   def __init__(
    39       self,
    40       options: Options = None,
    41       service: Service = None,
    42       keep_alive: bool = True,
    43   ) -> None:
 (...)
    53       self.service = service if service else Service()
    54       options = options if options else Options()
    55
    56       finder = DriverFinder(self.service, options)
--> 57       if finder.get_browser_path():
    58           options.binary_location = finder.get_browser_path()
    ..................................................
     self = # error calling repr and str
     options = <selenium.webdriver.firefox.options.Options object at 0x1188
                251d0>
     service = None
     keep_alive = True
     self.service = <selenium.webdriver.firefox.service.Service object at 0x1128
                     60390>
     finder = <selenium.webdriver.common.driver_finder.DriverFinder object
                at 0x118825010>
     finder.get_browser_path = <method 'DriverFinder.get_browser_path' of <selenium.webdriv
                                er.common.driver_finder.DriverFinder object at 0x118825010>
                                driver_finder.py:46>
     options.binary_location = ''
    ..................................................

File "/Users/guy/Library/Python/3.11/lib/python/site-packages/selenium/webdriver/common/driver_finder.py", line 47, in get_browser_path
    46   def get_browser_path(self) -> str:
--> 47       return self._binary_paths()["browser_path"]
    ..................................................
     self = <selenium.webdriver.common.driver_finder.DriverFinder object
              at 0x118825010>
     self._binary_paths = <method 'DriverFinder._binary_paths' of <selenium.webdriver.
                           common.driver_finder.DriverFinder object at 0x118825010> dri
                           ver_finder.py:52>
    ..................................................

File "/Users/guy/Library/Python/3.11/lib/python/site-packages/selenium/webdriver/common/driver_finder.py", line 78, in _binary_paths
    52   def _binary_paths(self) -> dict:
 (...)
    74               else:
    75                   raise ValueError(f'The browser path is not a valid file: {output["browser_path"]}')
    76       except Exception as err:
    77           msg = f"Unable to obtain driver for {browser}"
--> 78           raise NoSuchDriverException(msg) from err
    79       return self._paths
    ..................................................
     self = <selenium.webdriver.common.driver_finder.DriverFinder object
              at 0x118825010>
     msg = 'Unable to obtain driver for firefox'
     self._paths = {'driver_path': '',
                    'browser_path': ''}
    ..................................................

---- (full traceback above) ----
File "/Users/guy/bin/Bankinteraktionen.py", line 2518, in <module>
    main()
File "/Users/guy/bin/Bankinteraktionen.py", line 2406, in main
    with webdriver.Firefox(options=Browseroptionen) as browser:
File "/Users/guy/Library/Python/3.11/lib/python/site-packages/selenium/webdriver/firefox/webdriver.py", line 57, in __init__
    if finder.get_browser_path():
File "/Users/guy/Library/Python/3.11/lib/python/site-packages/selenium/webdriver/common/driver_finder.py", line 47, in get_browser_path
    return self._binary_paths()["browser_path"]
File "/Users/guy/Library/Python/3.11/lib/python/site-packages/selenium/webdriver/common/driver_finder.py", line 78, in _binary_paths
    raise NoSuchDriverException(msg) from err

NoSuchDriverException: Message: Unable to obtain driver for firefox; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors/driver_location

Operating System

macOS 10.13.6

Selenium version

Python 4.21

What are the browser(s) and version(s) where you see this issue?

Firefox 115.11.0(esr)

What are the browser driver(s) and version(s) where you see this issue?

geckodriver 0.30.0

Are you using Selenium Grid?

No response

github-actions[bot] commented 4 months ago

@workflowsguy, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

github-actions[bot] commented 4 months ago

Hi, @workflowsguy. Please follow the issue template, we need more information to reproduce the issue.

Either a complete code snippet and URL/HTML (if more than one file is needed, provide a GitHub repo and instructions to run the code), the specific versions used, or a more detailed description to help us understand the issue.

Note: If you cannot share your code and URL/HTML, any complete code snippet and URL/HTML that reproduces the issue is good enough.

Reply to this issue when all information is provided, thank you.

github-actions[bot] commented 4 months ago

We need more information about this issue in order to troubleshoot.

Please turn on logging and re-run your code. Information on how to adjust logs for your language can be found in our Troubleshooting documentation.

titusfortner commented 4 months ago

Hmm, it doesn't want to execute selenium-manager. What do you get when you run:

/Users/guy/Library/Python/3.11/lib/python/site-packages/selenium/webdriver/common/macos/selenium-manager --browser firefox --output json

service = webdriver.ChromeService(executable_path='/opt/local/bin/geckodriver')

You want GeckoDriverService not Chrome

workflowsguy commented 4 months ago

Hmm, it doesn't want to execute selenium-manager. What do you get when you run:

/Users/guy/Library/Python/3.11/lib/python/site-packages/selenium/webdriver/common/macos/selenium-manager --browser firefox --output json

This is the output

{
  "logs": [
    {
      "level": "WARN",
      "timestamp": 1716269692,
      "message": "The geckodriver version (0.30.0) detected in PATH at /opt/local/bin/geckodriver might not be compatible with the detected firefox version (115.11.0); currently, geckodriver 0.34.0 is recommended for firefox 115.*, so it is advised to delete the driver in PATH and retry"
    },
    {
      "level": "INFO",
      "timestamp": 1716269692,
      "message": "Driver path: /opt/local/bin/geckodriver"
    },
    {
      "level": "INFO",
      "timestamp": 1716269692,
      "message": "Browser path: /Applications/Firefox.app/Contents/MacOS/firefox"
    }
  ],
  "result": {
    "code": 0,
    "message": "/opt/local/bin/geckodriver",
    "driver_path": "/opt/local/bin/geckodriver",
    "browser_path": "/Applications/Firefox.app/Contents/MacOS/firefox"
  }
}

service = webdriver.ChromeService(executable_path='/opt/local/bin/geckodriver')

You want GeckoDriverService not Chrome

This was not clear to me from the documentation...

diemol commented 4 months ago

https://www.selenium.dev/documentation/webdriver/browsers/firefox/#service

workflowsguy commented 4 months ago

https://www.selenium.dev/documentation/webdriver/browsers/firefox/#service

Yes, but I did not land on that page, but on another one with a code example that just used chromedriver...

titusfortner commented 4 months ago

Hmm, weird that it didn't want to execute selenium manager the first time, but it worked manually.

For the sake of determining if there is a bug in our code that we need to fix, was the original error repeatable?

Does it work for you to delete the outdated driver at that location (instead of specifying the location in the service class)?

workflowsguy commented 4 months ago

Hmm, weird that it didn't want to execute selenium manager the first time, but it worked manually.

For the sake of determining if there is a bug in our code that we need to fix, was the original error repeatable?

Does it work for you to delete the outdated driver at that location (instead of specifying the location in the service class)?

Sorry, the actual output for /Users/guy/Library/Python/3.11/lib/python/site-packages/selenium/webdriver/common/macos/selenium-manager --browser firefox --output jsonon Selenium 4.21 is actually

dyld: cannot load 'selenium-manager' (load command 0x80000034 is unknown)
[1]    59560 abort       --browser firefox --output json

Having to keep switching between 4.20 and 4.21 makes this really difficult for me...

titusfortner commented 4 months ago

@diemol / @bonigarcia is there anything we changed in 4.21 for how we are deploying selenium-manager in Python?

bonigarcia commented 4 months ago

Nothing changed in the Rust side in release 4.21: https://github.com/SeleniumHQ/selenium/blob/trunk/rust/CHANGELOG.md#0421

I don't know if something changed in Python related to this.

diemol commented 4 months ago

No changes in Python, these were the commits

image
titusfortner commented 4 months ago

Maybe something went bad in the specific install? Can you try using the nightly release? (@diemol can you link to the instructions on how to use nightly packages, I can't find them...)

diemol commented 4 months ago

https://www.selenium.dev/downloads/#nightly

workflowsguy commented 3 months ago

Maybe something went bad in the specific install? Can you try using the nightly release? (@diemol can you link to the instructions on how to use nightly packages, I can't find them...)

I am not intricately familiar with the build process for Python packages, but I have switched between 4.20 and 4.21 several times now in the last days (using pip install -U), and the result is the same every time: 4.20 works, 4.21 fails.

I have capacity to test the nightly release on the weekend, but before I do this:

If nothing in the code has changed, does the same hold true for the tools in the build chain? I ask this because last week, two python packages that rely on external C/C++ libraries released new versions where one on this machine caused an "illegal hardware instruction" crash, the other a "segmentation violation" crash.

I have only heard back from one of the package authors, who suspected that this is caused by a change/bug in Apple's tool chain. He released a new version created with different compile options that no longer crashes. Details are here

diemol commented 3 months ago

Selenium Manager is a Rust binary, so I don't discard a dependency update that can have side effects.

However, do you get the same errors when you try on a colleague's machine? Maybe we can isolate the issue that way.

titusfortner commented 3 months ago

The thing to keep in mind here is that you are the only one reporting this issue even a week after release, so whatever the cause, it likely involves something specific about your system.

nvborisenko commented 3 months ago

Oh, dynamic linking... It might be related to the machine where selenium-manager binaries were produced. Can we see what exactly machines (OS, Arch) were used to build binaries?

@workflowsguy can you please share output of the following command? (hopefully it works on MacOS)

ldd /path/to/selenium-manager
nvborisenko commented 3 months ago

@bonigarcia, MACOSX_DEPLOYMENT_TARGET env variable might help. Please explore it.

nvborisenko commented 3 months ago

Seems this env var should help to support older MacOS versions (<13), similar case - https://github.com/rust-lang/rustup/pull/3710

workflowsguy commented 3 months ago

@workflowsguy can you please share output of the following command? (hopefully it works on MacOS)

ldd /path/to/selenium-manager

There is no ldd command in macOS; the best alternative according to various internet sources is otool

otool -L /Users/guy/Library/Python/3.12/lib/python/site-packages/selenium/webdriver/common/macos/selenium-manager

gives

    /System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration (compatibility version 1.0.0, current version 1296.0.1)
    /System/Library/Frameworks/Security.framework/Versions/A/Security (compatibility version 1.0.0, current version 61040.1.3)
    /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 2048.1.255)
    /usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1336.0.0)

otool -l /Users/guy/Library/Python/3.12/lib/python/site-packages/selenium/webdriver/common/macos/selenium-manager

gives

/Users/guy/Library/Python/3.12/lib/python/site-packages/selenium/webdriver/common/macos/selenium-manager:
Mach header
      magic cputype cpusubtype  caps    filetype ncmds sizeofcmds      flags
 0xfeedfacf 16777223          3  0x00           2    21       2280 0x00a00085
Load command 0
      cmd LC_SEGMENT_64
  cmdsize 72
  segname __PAGEZERO
   vmaddr 0x0000000000000000
   vmsize 0x0000000100000000
  fileoff 0
 filesize 0
  maxprot 0x00000000
 initprot 0x00000000
   nsects 0
    flags 0x0
Load command 1
      cmd LC_SEGMENT_64
  cmdsize 632
  segname __TEXT
   vmaddr 0x0000000100000000
   vmsize 0x00000000003dc000
  fileoff 0
 filesize 4046848
  maxprot 0x00000005
 initprot 0x00000005
   nsects 7
    flags 0x0
Section
  sectname __text
   segname __TEXT
      addr 0x0000000100000f40
      size 0x00000000002e6d10
    offset 3904
     align 2^6 (64)
    reloff 0
    nreloc 0
     flags 0x80000400
 reserved1 0
 reserved2 0
Section
  sectname __stubs
   segname __TEXT
      addr 0x00000001002e7c50
      size 0x00000000000003a2
    offset 3046480
     align 2^0 (1)
    reloff 0
    nreloc 0
     flags 0x80000408
 reserved1 0 (index into indirect symbol table)
 reserved2 6 (size of stubs)
Section
  sectname __const
   segname __TEXT
      addr 0x00000001002e8000
      size 0x00000000000e8020
    offset 3047424
     align 2^12 (4096)
    reloff 0
    nreloc 0
     flags 0x00000000
 reserved1 0
 reserved2 0
Section
  sectname __gcc_except_tab
   segname __TEXT
      addr 0x00000001003d0020
      size 0x000000000000199c
    offset 3997728
     align 2^2 (4)
    reloff 0
    nreloc 0
     flags 0x00000000
 reserved1 0
 reserved2 0
Section
  sectname __cstring
   segname __TEXT
      addr 0x00000001003d19bc
      size 0x00000000000015db
    offset 4004284
     align 2^0 (1)
    reloff 0
    nreloc 0
     flags 0x00000002
 reserved1 0
 reserved2 0
Section
  sectname __unwind_info
   segname __TEXT
      addr 0x00000001003d2f98
      size 0x0000000000006620
    offset 4009880
     align 2^2 (4)
    reloff 0
    nreloc 0
     flags 0x00000000
 reserved1 0
 reserved2 0
Section
  sectname __eh_frame
   segname __TEXT
      addr 0x00000001003d95b8
      size 0x0000000000001eb8
    offset 4036024
     align 2^3 (8)
    reloff 0
    nreloc 0
     flags 0x6800000b
 reserved1 0
 reserved2 0
Load command 2
      cmd LC_SEGMENT_64
  cmdsize 232
  segname __DATA_CONST
   vmaddr 0x00000001003dc000
   vmsize 0x0000000000050000
  fileoff 4046848
 filesize 327680
  maxprot 0x00000003
 initprot 0x00000003
   nsects 2
    flags 0x10
Section
  sectname __got
   segname __DATA_CONST
      addr 0x00000001003dc000
      size 0x00000000000004e8
    offset 4046848
     align 2^3 (8)
    reloff 0
    nreloc 0
     flags 0x00000006
 reserved1 155 (index into indirect symbol table)
 reserved2 0
Section
  sectname __const
   segname __DATA_CONST
      addr 0x00000001003dc500
      size 0x000000000004da25
    offset 4048128
     align 2^6 (64)
    reloff 0
    nreloc 0
     flags 0x00000000
 reserved1 0
 reserved2 0
Load command 3
      cmd LC_SEGMENT_64
  cmdsize 552
  segname __DATA
   vmaddr 0x000000010042c000
   vmsize 0x0000000000004000
  fileoff 4374528
 filesize 16384
  maxprot 0x00000003
 initprot 0x00000003
   nsects 6
    flags 0x0
Section
  sectname __data
   segname __DATA
      addr 0x000000010042c000
      size 0x0000000000001060
    offset 4374528
     align 2^4 (16)
    reloff 0
    nreloc 0
     flags 0x00000000
 reserved1 0
 reserved2 0
Section
  sectname __thread_vars
   segname __DATA
      addr 0x000000010042d060
      size 0x00000000000001f8
    offset 4378720
     align 2^3 (8)
    reloff 0
    nreloc 0
     flags 0x00000013
 reserved1 0
 reserved2 0
Section
  sectname __thread_data
   segname __DATA
      addr 0x000000010042d258
      size 0x0000000000000070
    offset 4379224
     align 2^3 (8)
    reloff 0
    nreloc 0
     flags 0x00000011
 reserved1 0
 reserved2 0
Section
  sectname __thread_bss
   segname __DATA
      addr 0x000000010042d2c8
      size 0x0000000000000140
    offset 4379336
     align 2^3 (8)
    reloff 0
    nreloc 0
     flags 0x00000012
 reserved1 0
 reserved2 0
Section
  sectname __bss
   segname __DATA
      addr 0x000000010042d408
      size 0x0000000000000162
    offset 0
     align 2^3 (8)
    reloff 0
    nreloc 0
     flags 0x00000001
 reserved1 0
 reserved2 0
Section
  sectname __common
   segname __DATA
      addr 0x000000010042d570
      size 0x0000000000000010
    offset 0
     align 2^4 (16)
    reloff 0
    nreloc 0
     flags 0x00000001
 reserved1 0
 reserved2 0
Load command 4
      cmd LC_SEGMENT_64
  cmdsize 72
  segname __LINKEDIT
   vmaddr 0x0000000100430000
   vmsize 0x0000000000005cb0
  fileoff 4390912
 filesize 23728
  maxprot 0x00000001
 initprot 0x00000001
   nsects 0
    flags 0x0
Load command 5
      cmd ?(0x80000034)
  cmdsize 16
Load command 6
      cmd ?(0x80000033)
  cmdsize 16
Load command 7
     cmd LC_SYMTAB
 cmdsize 24
  symoff 4408552
   nsyms 159
  stroff 4412344
 strsize 2296
Load command 8
            cmd LC_DYSYMTAB
        cmdsize 80
      ilocalsym 0
      nlocalsym 1
     iextdefsym 1
     nextdefsym 1
      iundefsym 2
      nundefsym 157
         tocoff 0
           ntoc 0
      modtaboff 0
        nmodtab 0
   extrefsymoff 0
    nextrefsyms 0
 indirectsymoff 4411096
  nindirectsyms 312
      extreloff 0
        nextrel 0
      locreloff 0
        nlocrel 0
Load command 9
          cmd LC_LOAD_DYLINKER
      cmdsize 32
         name /usr/lib/dyld (offset 12)
Load command 10
     cmd LC_UUID
 cmdsize 24
    uuid B9D4546B-3F6E-377A-A2D5-C0067C113A9C
Load command 11
       cmd LC_BUILD_VERSION
   cmdsize 32
  platform macos
       sdk 14.0
     minos 13.0
    ntools 1
      tool ld
   version 1015.7
Load command 12
      cmd LC_SOURCE_VERSION
  cmdsize 16
  version 0.0
Load command 13
       cmd LC_MAIN
   cmdsize 24
  entryoff 57808
 stacksize 0
Load command 14
          cmd LC_LOAD_DYLIB
      cmdsize 112
         name /System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration (offset 24)
   time stamp 2 Thu Jan  1 01:00:02 1970
      current version 1296.0.1
compatibility version 1.0.0
Load command 15
          cmd LC_LOAD_DYLIB
      cmdsize 96
         name /System/Library/Frameworks/Security.framework/Versions/A/Security (offset 24)
   time stamp 2 Thu Jan  1 01:00:02 1970
      current version 61040.1.3
compatibility version 1.0.0
Load command 16
          cmd LC_LOAD_DYLIB
      cmdsize 104
         name /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (offset 24)
   time stamp 2 Thu Jan  1 01:00:02 1970
      current version 2048.1.255
compatibility version 150.0.0
Load command 17
          cmd LC_LOAD_DYLIB
      cmdsize 56
         name /usr/lib/libiconv.2.dylib (offset 24)
   time stamp 2 Thu Jan  1 01:00:02 1970
      current version 7.0.0
compatibility version 7.0.0
Load command 18
          cmd LC_LOAD_DYLIB
      cmdsize 56
         name /usr/lib/libSystem.B.dylib (offset 24)
   time stamp 2 Thu Jan  1 01:00:02 1970
      current version 1336.0.0
compatibility version 1.0.0
Load command 19
      cmd LC_FUNCTION_STARTS
  cmdsize 16
  dataoff 4395912
 datasize 12640
Load command 20
      cmd LC_DATA_IN_CODE
  cmdsize 16
  dataoff 4408552
 datasize 0

What caught my attention in this output are the lines

Load command 11
       cmd LC_BUILD_VERSION
   cmdsize 32
  platform macos
       sdk 14.0
     minos 13.0
    ntools 1
      tool ld
   version 1015.7

When running /Users/guy/Library/Python/3.12/lib/python/site-packages/selenium/webdriver/common/macos/selenium-managerin the terminal, the following crash report is logged by macOS

Process:               selenium-manager [42988]
Path:                  /Users/USER/Library/Python/3.12/lib/python/site-packages/selenium/webdriver/common/macos/selenium-manager
Identifier:            selenium-manager
Version:               ???
Code Type:             X86-64 (Native)
Parent Process:        zsh [42608]
Responsible:           selenium-manager [42988]
User ID:               501

Date/Time:             2024-05-25 20:03:38.830 +0200
OS Version:            Mac OS X 10.13.6 (17G14042)
Report Version:        12
Anonymous UUID:        A41421B4-F1A6-23F0-F507-8C741C7D2643

Sleep/Wake UUID:       D3629483-3D0C-499B-95AF-1197EAA824C6

Time Awake Since Boot: 43000 seconds
Time Since Wake:       6800 seconds

System Integrity Protection: enabled

Crashed Thread:        0

Exception Type:        EXC_CRASH (SIGABRT)
Exception Codes:       0x0000000000000000, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Termination Reason:    DYLD, [0x9] <unknown>

Application Specific Information:
dyld: launch, loading dependent libraries

Dyld Error Message:
  cannot load 'selenium-manager' (load command 0x80000034 is unknown)

Binary Images:
       0x1029b2000 -        0x102d8d46f + (0) <B9D4546B-3F6E-377A-A2D5-C0067C113A9C> 
       0x109d99000 -        0x109de3adf + (551.5) <CB9BFB56-4511-36F1-A546-891FF770C01C> 

An internet search for Dyld Error Message load command 0x80000034 is unknownreturns, among others, this and this

However, do you get the same errors when you try on a colleague's machine? Maybe we can isolate the issue that way.

Running Selenium Manager on a machine with macOS 11.7.10 works as expected.

AntoniHub commented 3 months ago

Really do you need Python 3.12? Maybe if you use Python 3.10 it work.

Also, upgraded your Firefox Version? above i seen that: "message": "The geckodriver version (0.30.0) detected in PATH at /opt/local/bin/geckodriver might not be compatible with the detected firefox version (115.11.0); currently, geckodriver 0.34.0 is recommended for firefox 115.*, so it is advised to delete the driver in PATH and retry"

bonigarcia commented 3 months ago

I have prepared different selenium-manager binaries for macOS using different setups. @workflowsguy Can you please have a try with them?

[1] selenium-manager-macos : Compiled using Rust 1.77.2. [2] selenium-manager-macos : Compiled using Rust 1.77.2 and MACOSX_DEPLOYMENT_TARGET=10.12 env.

Please download the previous binaries, execute them in the command line, and share the results here. Thanks.

workflowsguy commented 3 months ago

[1] selenium-manager-macos : Compiled using Rust 1.77.2.

This gives the same error as I originally reported

[2] selenium-manager-macos : Compiled using Rust 1.77.2 and MACOSX_DEPLOYMENT_TARGET=10.12 env.

This works!

titusfortner commented 3 months ago

Mac 10.13 went out of support 3 years ago. I think we're ok only supporting officially supported OS versions like we do for everything else.

nvborisenko commented 3 months ago

From my point of view... if we can support as minimum version of something without big effort then just do it. When we feel that supporting old stuff takes more and more, then we can just announce "sorry, we stopped to support it because of even your vendor stopped supporting it".

Particularly for this issue - one line of code change makes users happy. Why not.

titusfortner commented 3 months ago

The error happened because it uses newer load command APIs which presumably include performance/feature improvements. Setting an older target prevents using any newer APIs which may be limiting.

Are we sure everything actually works in 10.12? Do we need to have tests to verify it?

The concerns are extra maintenance burden and lack of latest features.

diemol commented 2 months ago

I am closing this because we have yet to get more information.

github-actions[bot] commented 1 month ago

This issue has been automatically locked since there has not been any recent activity since it was closed. Please open a new issue for related bugs.