RileyXX / IMDB-Trakt-Syncer

A python script that syncs user watchlist, ratings and reviews for Movies, TV Shows and Episodes both ways between Trakt and IMDB.
MIT License
91 stars 2 forks source link

Script issue - OSError: [Errno 8] Exec format error - (Incompatible OS) #70

Closed ghost closed 8 months ago

ghost commented 1 year ago

Is there already an issue for your problem?

Bug Description

I am getting the following lines of codes with the warning after I successfully validate the OTP with Trakt.

Starting webdriver...

--- ERROR ---
An error occurred while running the script.
Please submit the error to GitHub with the following information:
--------------------------------------------------
Traceback (most recent call last):
  File "/home/ubuntu/.local/lib/python3.10/site-packages/IMDBTraktSyncer/IMDBTraktSyncer.py", line 63, in main
    driver = webdriver.Chrome(service=service, options=options)
  File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/chrome/webdriver.py", line 45, in __init__
    super().__init__(
  File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/chromium/webdriver.py", line 53, in __init__
    self.service.start()
  File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/common/service.py", line 98, in start
    self._start_process(self._path)
  File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/common/service.py", line 204, in _start_process
    self.process = subprocess.Popen(
  File "/usr/lib/python3.10/subprocess.py", line 971, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.10/subprocess.py", line 1863, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
OSError: [Errno 8] Exec format error: '/home/ubuntu/.local/lib/python3.10/site-packages/chromedriver_py/chromedriver_linux64'

--------------------------------------------------
Submit the error here: https://github.com/RileyXX/IMDB-Trakt-Syncer/issues/new?template=bug_report.yml
--------------------------------------------------
Traceback (most recent call last):
  File "/home/ubuntu/.local/lib/python3.10/site-packages/IMDBTraktSyncer/IMDBTraktSyncer.py", line 63, in main
    driver = webdriver.Chrome(service=service, options=options)
  File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/chrome/webdriver.py", line 45, in __init__
    super().__init__(
  File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/chromium/webdriver.py", line 53, in __init__
    self.service.start()
  File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/common/service.py", line 98, in start
    self._start_process(self._path)
  File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/common/service.py", line 204, in _start_process
    self.process = subprocess.Popen(
  File "/usr/lib/python3.10/subprocess.py", line 971, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.10/subprocess.py", line 1863, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
OSError: [Errno 8] Exec format error: '/home/ubuntu/.local/lib/python3.10/site-packages/chromedriver_py/chromedriver_linux64'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/ubuntu/.local/bin/IMDBTraktSyncer", line 8, in <module>
    sys.exit(main())
  File "/home/ubuntu/.local/lib/python3.10/site-packages/IMDBTraktSyncer/IMDBTraktSyncer.py", line 714, in main
    service.stop()
  File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/common/service.py", line 144, in stop
    if self.process is not None:
AttributeError: 'Service' object has no attribute 'process'

Environment

Linux ARM64 Ubuntu 22.04x64

Screenshots

No response

RileyXX commented 1 year ago

Hi there thanks for reporting this. Based on this OSError: [Errno 8] Exec format error: '/home/ubuntu/.local/lib/python3.10/site-packages/chromedriver_py/chromedriver_linux64' it looks to be a chromedriver compatibility issue with LInux ARM64. Seems Chrome itself does not support ARM64 Linux. So unfortunately with Linux ARM64 it will not be possible to run this script. There may possibly be some hacky workarounds but I do not have a system with these specs so can not provide a reliable solution.

Unless IMDB provides a free API, the compatibility of the script will remain limited to whatever OS is supported by Chrome and chromedriver.

If you're interested TMDB-Trakt-Syncer does not use Chrome or chromedriver so that script should be compatible with Linux ARM64.

RileyXX commented 1 year ago

Possible Solution:

Switch the script to use geckodriver instead of chromedriver which appears to offer a wider range of OS compatibility. This would require most of the code to be rewritten so would be a large undertaking. This would also require the user to install Firefox. Since this would improve compatibility, I think I may consider this for a future release.

For future reference, I compiled a table of the most recent OS compatibility based on the latest release for Geckodriver and Chromedriver which can be found below. (as of 10/14/2023)

Geckodriver OS Compatibility Chromedriver OS Compatibility
Linux - ARM64 - x86-64 (64-bit)
- x86 (32-bit)
- x86-64 (64-bit)
macOS - ARM64 - ARM64
- x86-64 (64-bit) - x86-64 (64-bit)
Windows - ARM64 - x86 (32-bit)
- x86 (32-bit) - x86-64 (64-bit)
- x86-64 (64-bit)
ghost commented 1 year ago

Hi I have tried your TMDB Trakt Syncer and it is working very fine. No issues with that. Maybe I will try this solution and will let you know. With TMDB sync I haven't changed anything and it is syncing all rating with TMDB from my Trakt account

ghost commented 1 year ago

HI there any update to support my platform for this script? Not able to go through all technical details to install Gecko driver

RileyXX commented 1 year ago

HI there any update to support my platform for this script? Not able to go through all technical details to install Gecko driver

Apologies but this is not possible as of right now with this script due to limited chromedriver OS compatibility. Please see my previous comment. As stated previously the entire project would need to be rewritten for Geckodriver which would be a large undertaking. I won't be adding geckodriver support for now but in the future I may rewrite the script to use Geckodriver instead since it appears to have increased OS compatibility. If there are any updates on this topic I will post about it again here in the future.

ghost commented 1 year ago

Hey okay, thanks. Please do so! I have set up Plex -> Trakt -> TMDB for now. Only IMDB sync is missing and would love to see that in working. Please let me know once you update the script.