Microsoft-Rewards-Farmer icon indicating copy to clipboard operation
Microsoft-Rewards-Farmer copied to clipboard

[BUG] Error running via raspberry pi rasbian os

Open theskid31 opened this issue 1 year ago • 9 comments

Before submitting a bug report...

  • [X] This bug wasn't already reported. (I have checked every bug report on GitHub)

Title

  • [X] The title is no longer "[BUG] Title" and I edited it with the right error name.

Describe the bug

hi Can anyone help getting this error trying to run script via pi4

has anyone a solution please?

Copy and paste your error

2023-09-23 11:21:41,635 [INFO] Using default request storage 2023-09-23 11:21:41,650 [INFO] Created proxy listening on 127.0.0.1:45229 2023-09-23 11:21:41,651 [INFO] Using undetected_chromedriver 2023-09-23 11:21:43,192 [INFO] patching driver executable /home/theskid/.local/share/undetected_chromedriver/undetected_chromedriver 2023-09-23 11:21:43,383 [ERROR] OSError: [Errno 8] Exec format error: '/home/theskid/.local/share/undetected_chromedriver/undetected_chromedriver' Traceback (most recent call last): File "/home/theskid/rewards/main.py", line 26, in main executeBot(currentAccount, notifier, args) File "/home/theskid/rewards/main.py", line 138, in executeBot with Browser(mobile=False, account=currentAccount, args=args) as desktopBrowser: File "/home/theskid/rewards/src/browser.py", line 41, in init self.webdriver = self.browserSetup() File "/home/theskid/rewards/src/browser.py", line 77, in browserSetup driver = webdriver.Chrome( File "/home/theskid/.local/lib/python3.9/site-packages/seleniumwire/undetected_chromedriver/webdriver.py", line 61, in init super().init(*args, **kwargs) File "/home/theskid/.local/lib/python3.9/site-packages/undetected_chromedriver/init.py", line 466, in init super(Chrome, self).init( File "/home/theskid/.local/lib/python3.9/site-packages/selenium/webdriver/chrome/webdriver.py", line 45, in init super().init( File "/home/theskid/.local/lib/python3.9/site-packages/selenium/webdriver/chromium/webdriver.py", line 53, in init self.service.start() File "/home/theskid/.local/lib/python3.9/site-packages/selenium/webdriver/common/service.py", line 105, in start self._start_process(self._path) File "/home/theskid/.local/lib/python3.9/site-packages/selenium/webdriver/common/service.py", line 206, in _start_process self.process = subprocess.Popen( File "/usr/lib/python3.9/subprocess.py", line 951, in init self._execute_child(args, executable, preexec_fn, close_fds, File "/usr/lib/python3.9/subprocess.py", line 1823, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) OSError: [Errno 8] Exec format error: '/home/theskid/.local/share/undetected_chromedriver/undetected_chromedriver'

Screenshots

none

Value of dashboard variable

none

theskid31 avatar Sep 23 '23 10:09 theskid31

Had the same issue on my Pi 2, I solved it with the help of Vincent's comment here

AngelCanovas avatar Sep 26 '23 18:09 AngelCanovas

dont know why it is saying file,directory not found,any help tried renaming the file so many times,putting in different folders and using electrons driver?

getting the error:

theskid@raspberrypi:~/rewards $ python main.py Traceback (most recent call last): File "/home/theskid/rewards/main.py", line 9, in <module> driver = uc.Chrome( File "/home/theskid/.local/lib/python3.9/site-packages/undetected_chromedriver/__init__.py", line 258, in __init__ self.patcher.auto() File "/home/theskid/.local/lib/python3.9/site-packages/undetected_chromedriver/patcher.py", line 150, in auto return self.patch_exe() File "/home/theskid/.local/lib/python3.9/site-packages/undetected_chromedriver/patcher.py", line 347, in patch_exe with io.open(self.executable_path, "r+b") as fh: FileNotFoundError: [Errno 2] No such file or directory: '/home/theskid/.local/share/undetected_chromedriver/undeteted_chromedriver'

also i had to use electrons chromedriver for arm as i get when tring to copy the install chromedriver with normal user: cp /usr/bin/chromedriver /home/myuser/.local/share/undetected_chromedriver/chromedriver_copy cp: cannot create regular file '/home/myuser/.local/share/undetected_chromedriver/chromedriver_copy': No such file or directory

theskid31 avatar Sep 27 '23 22:09 theskid31

Might sound dumb but did you execute cp /usr/bin/chromedriver /home/myuser/.local/share/undetected_chromedriver/chromedriver_copy as it without changing myuser to your current user ?

Also in browser.py you need to change line 80 to driver_executable_path="/home/myuser/.local/share/undetected_chromedriver/chromedriver_copy", like vincent's comment said

AngelCanovas avatar Sep 28 '23 13:09 AngelCanovas

Might sound dumb but did you execute cp /usr/bin/chromedriver /home/myuser/.local/share/undetected_chromedriver/chromedriver_copy as it without changing myuser to your current user ?

Also in browser.py you need to change line 80 to driver_executable_path="/home/myuser/.local/share/undetected_chromedriver/chromedriver_copy", like vincent's comment said

yes I change the myuser to theskid as i posted above,but i didnt try with the sudo command,but i think my os is screwed up with all the things ive been trying as i tried the cp command as root and that copied but would not run

as for line 80 in browser.py i didnt do that,as my line 80 is user_data_dir=self.userDataDir.as_posix(), do i replace this line as that doesnt make sense?

and also where do you add the code: import undetected_chromedriver as uc driver = uc.Chrome( driver_executable_path="/home/myuser/.local/share/undetected_chromedriver/chromedriver_copy" ) driver.get('https://nowsecure.nl')

I added that to the start of main.py where did you add yours to?

theskid31 avatar Sep 28 '23 19:09 theskid31

@theskid31 The steps I followed for it to work for me:

  • First making sure chromedriver is installed sudo apt install chromium-chromedriver
  • Copying chromedriver cp /usr/bin/chromedriver /home/myuser/.local/share/undetected_chromedriver/chromedriver_copy
  • Changing driver implementation in browser.py (lines 77-81) to: driver = webdriver.Chrome( options=options, seleniumwire_options=seleniumwireOptions, driver_executable_path="/home/myuser/.local/share/undetected_chromedriver/chromedriver_copy", ) No need to add more code to main.py or browser.py

AngelCanovas avatar Oct 02 '23 17:10 AngelCanovas

@theskid31 The steps I followed for it to work for me:

  • First making sure chromedriver is installed sudo apt install chromium-chromedriver
  • Copying chromedriver cp /usr/bin/chromedriver /home/myuser/.local/share/undetected_chromedriver/chromedriver_copy
  • Changing driver implementation in browser.py (lines 77-81) to: driver = webdriver.Chrome( options=options, seleniumwire_options=seleniumwireOptions, driver_executable_path="/home/myuser/.local/share/undetected_chromedriver/chromedriver_copy", ) No need to add more code to main.py or browser.py

thanks for your reply got it running but get the error: [WARNING] could not detect version_main.therefore, we are assuming it is chrome 108 or higher

theskid31 avatar Oct 08 '23 16:10 theskid31

@AngelCanovas Thanks I’ve solved the above issue by adding my chromium browser version directly in undetected-chromedriver’s python init.py file Script is running okay but it doesn’t half fail a lot ,even using klept0’s fork with the mobile search fixes and others,got it running on pi 64bit os with a fast sd card ,but I suspect it’s chromium browser, @AngelCanovas what os do you run it on and have you altered chromium browser as to run better?thanks

theskid31 avatar Oct 10 '23 17:10 theskid31

@theskid31 The steps I followed for it to work for me:

  • First making sure chromedriver is installed sudo apt install chromium-chromedriver
  • Copying chromedriver cp /usr/bin/chromedriver /home/myuser/.local/share/undetected_chromedriver/chromedriver_copy
  • Changing driver implementation in browser.py (lines 77-81) to: driver = webdriver.Chrome( options=options, seleniumwire_options=seleniumwireOptions, driver_executable_path="/home/myuser/.local/share/undetected_chromedriver/chromedriver_copy", ) No need to add more code to main.py or browser.py

Hello, I did followed every step like explained but now I do get This error right here :

2023-10-15 18:39:58,538 [INFO] Using default request storage 2023-10-15 18:39:58,573 [INFO] Created proxy listening on 127.0.0.1:43985 2023-10-15 18:39:58,575 [INFO] Using undetected_chromedriver 2023-10-15 18:39:58,577 [ERROR] IsADirectoryError: [Errno 21] Is a directory: '/home/ubuntu/.local/share/undetected_chromedriver/chromedriver_copy' Traceback (most recent call last): File "/home/mspoints/main.py", line 24, in main executeBot(currentAccount, notifier, args) File "/home/mspoints/main.py", line 127, in executeBot with Browser(mobile=False, account=currentAccount, args=args) as desktopBrowser: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/mspoints/src/browser.py", line 41, in init self.webdriver = self.browserSetup() ^^^^^^^^^^^^^^^^^^^ File "/home/mspoints/src/browser.py", line 77, in browserSetup driver = webdriver.Chrome( ^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/seleniumwire/undetected_chromedriver/webdriver.py", line 61, in init super().init(*args, **kwargs) File "/usr/local/lib/python3.11/dist-packages/undetected_chromedriver/init.py", line 258, in init self.patcher.auto() File "/usr/local/lib/python3.11/dist-packages/undetected_chromedriver/patcher.py", line 148, in auto ispatched = self.is_binary_patched(self.executable_path) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/undetected_chromedriver/patcher.py", line 339, in is_binary_patched with io.open(executable_path, "rb") as fh: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ IsADirectoryError: [Errno 21] Is a directory: '/home/ubuntu/.local/share/undetected_chromedriver/chromedriver_copy'

What can I do? Please help, im kinda new to linux, btw im using ubuntu server.

DeadlyOmega avatar Oct 15 '23 16:10 DeadlyOmega

@theskid31 The steps I followed for it to work for me:

  • First making sure chromedriver is installed sudo apt install chromium-chromedriver
  • Copying chromedriver cp /usr/bin/chromedriver /home/myuser/.local/share/undetected_chromedriver/chromedriver_copy
  • Changing driver implementation in browser.py (lines 77-81) to: driver = webdriver.Chrome( options=options, seleniumwire_options=seleniumwireOptions, driver_executable_path="/home/myuser/.local/share/undetected_chromedriver/chromedriver_copy", ) No need to add more code to main.py or browser.py

Hello, I did followed every step like explained but now I do get This error right here :

2023-10-15 18:39:58,538 [INFO] Using default request storage 2023-10-15 18:39:58,573 [INFO] Created proxy listening on 127.0.0.1:43985 2023-10-15 18:39:58,575 [INFO] Using undetected_chromedriver 2023-10-15 18:39:58,577 [ERROR] IsADirectoryError: [Errno 21] Is a directory: '/home/ubuntu/.local/share/undetected_chromedriver/chromedriver_copy' Traceback (most recent call last): File "/home/mspoints/main.py", line 24, in main executeBot(currentAccount, notifier, args) File "/home/mspoints/main.py", line 127, in executeBot with Browser(mobile=False, account=currentAccount, args=args) as desktopBrowser: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/mspoints/src/browser.py", line 41, in init self.webdriver = self.browserSetup() ^^^^^^^^^^^^^^^^^^^ File "/home/mspoints/src/browser.py", line 77, in browserSetup driver = webdriver.Chrome( ^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/seleniumwire/undetected_chromedriver/webdriver.py", line 61, in init super().init(*args, **kwargs) File "/usr/local/lib/python3.11/dist-packages/undetected_chromedriver/init.py", line 258, in init self.patcher.auto() File "/usr/local/lib/python3.11/dist-packages/undetected_chromedriver/patcher.py", line 148, in auto ispatched = self.is_binary_patched(self.executable_path) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/undetected_chromedriver/patcher.py", line 339, in is_binary_patched with io.open(executable_path, "rb") as fh: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ IsADirectoryError: [Errno 21] Is a directory: '/home/ubuntu/.local/share/undetected_chromedriver/chromedriver_copy'

What can I do? Please help, im kinda new to linux, btw im using ubuntu server.

Seems like the error is related to not locating the chromedriver, maybe ubuntu server have other path to the chromedriver idk. Try locating the chromedriver sudo find / -type f -name chromedriver and then modify the copy command according to the correct path. Also check the /home/ubuntu/.local/share/undetected_chromedriver path to see if it exists, if not create that path and try again.

AngelCanovas avatar Oct 21 '23 11:10 AngelCanovas