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

Don't work on Crontab after update #563

Open
soynoobbot opened this issue Mar 26, 2022 · 2 comments
Open

Don't work on Crontab after update #563

soynoobbot opened this issue Mar 26, 2022 · 2 comments

Comments

@soynoobbot
Copy link

soynoobbot commented Mar 26, 2022

I'm configured my script to work on crontab in my ubuntu server, all it's work fine but in the last update my script doesn't work now, this is the error:

MyScript.py: 2022-03-26 09:50:03
Traceback (most recent call last):
File "/home/soynoob/Scraping/MyScript.py", line 84, in
driver = uc.Chrome()
File "/home/soynoob/.local/lib/python3.10/site-packages/undetected_chromedriver/init.py", line 401, in init
super(Chrome, self).init(
File "/home/soynoob/.local/lib/python3.10/site-packages/selenium/webdriver/chrome/webdriver.py", line 70, in init
super(WebDriver, self).init(DesiredCapabilities.CHROME['browserName'], "goog",
File "/home/soynoob/.local/lib/python3.10/site-packages/selenium/webdriver/chromium/webdriver.py", line 93, in init
RemoteWebDriver.init(
File "/home/soynoob/.local/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 269, in init
self.start_session(capabilities, browser_profile)
File "/home/soynoob/.local/lib/python3.10/site-packages/undetected_chromedriver/init.py", line 589, in start_session
super(selenium.webdriver.chrome.webdriver.WebDriver, self).start_session(
File "/home/soynoob/.local/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 360, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "/home/soynoob/.local/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 425, in execute
self.error_handler.check_response(response)
File "/home/soynoob/.local/lib/python3.10/site-packages/selenium/webdriver/remote/errorhandler.py", line 247, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: cannot connect to chrome at 127.0.0.1:59359
from chrome not reachable
Stacktrace:
#0 0x557812aac7d3
#1 0x55781280851f
#2 0x5578127f6879
#3 0x55781282ef49
#4 0x557812826e66
#5 0x557812862355
#6 0x55781285c5a3
#7 0x557812831ddc
#8 0x557812832de5
#9 0x557812add49d
#10 0x557812af660c
#11 0x557812adf205
#12 0x557812af6ee5
#13 0x557812ad3070
#14 0x557812b12488
#15 0x557812b1260c
#16 0x557812b2bc6d
#17 0x7fecf0274609

my crontab command is:

50 9 * * * DISPLAY=:0 python3.10 /home/soynoob/Scraping/MyScript.py >> /home/soynoob/Scraping/log.txt 2>&1

The script work perfectly without crontab (on terminal).
what is going on?

My Google Chrome version is 99.0.4844.84
undetected-chromedriver version is 3.1.5.post4
Python version is 3.10.4

@BushMinusZero
Copy link

Please verify that your chromedriver version is matching your google-chrome version

# which chromedriver
/usr/local/bin/chromedriver
# /usr/local/bin/chromedriver --version
ChromeDriver 100.0.4896.88 (4450653bfa91182e85723d8f1dee64dd6ce40ed4-refs/branch-heads/4896@{#1086})

@rutkovskii
Copy link

rutkovskii commented Jul 28, 2022

I have exactly the same error.

Traceback (most recent call last):
  File "categoricalWritersRunner.py", line 25, in <module>
    df.parse_all_categories()
  File "/home/ubuntu/lightyear/flask_app/scripts/PeriodicWriters/weekly.py", line 76, in parse_all_categories
    self.parse_category(category)
  File "/home/ubuntu/lightyear/flask_app/scripts/PeriodicWriters/weekly.py", line 67, in parse_category
    r.muckrack_analysis()
  File "/home/ubuntu/lightyear/flask_app/scripts/PeriodicWriters/weekly.py", line 50, in muckrack_analysis
    mc.parse_HTML()
  File "/home/ubuntu/lightyear/flask_app/scripts/PeriodicWriters/muckRack/Muckrack.py", line 67, in parse_HTML
    driver = uc.Chrome(options=options)
  File "/usr/local/lib/python3.8/dist-packages/undetected_chromedriver/__init__.py", line 369, in __init__
    super(Chrome, self).__init__(
  File "/usr/local/lib/python3.8/dist-packages/selenium/webdriver/chrome/webdriver.py", line 70, in __init__
    super(WebDriver, self).__init__(DesiredCapabilities.CHROME['browserName'], "goog",
  File "/usr/local/lib/python3.8/dist-packages/selenium/webdriver/chromium/webdriver.py", line 93, in __init__
    RemoteWebDriver.__init__(
  File "/usr/local/lib/python3.8/dist-packages/selenium/webdriver/remote/webdriver.py", line 268, in __init__
    self.start_session(capabilities, browser_profile)
  File "/usr/local/lib/python3.8/dist-packages/undetected_chromedriver/__init__.py", line 552, in start_session
    super(selenium.webdriver.chrome.webdriver.WebDriver, self).start_session(
  File "/usr/local/lib/python3.8/dist-packages/selenium/webdriver/remote/webdriver.py", line 359, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
  File "/usr/local/lib/python3.8/dist-packages/selenium/webdriver/remote/webdriver.py", line 424, in execute
    self.error_handler.check_response(response)
  File "/usr/local/lib/python3.8/dist-packages/selenium/webdriver/remote/errorhandler.py", line 247, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: cannot connect to chrome at 127.0.0.1:51753
from chrome not reachable
Stacktrace:
#0 0x55d180e40cd3 <unknown>
#1 0x55d180c487ff <unknown>
#2 0x55d180c37bc9 <unknown>
#3 0x55d180c7069f <unknown>
#4 0x55d180c685a6 <unknown>
#5 0x55d180ca394a <unknown>
#6 0x55d180c9daa3 <unknown>
#7 0x55d180c733fa <unknown>
#8 0x55d180c74555 <unknown>
#9 0x55d180e882bd <unknown>
#10 0x55d180e8c418 <unknown>
#11 0x55d180e7236e <unknown>
#12 0x55d180e8d078 <unknown>
#13 0x55d180e66bb0 <unknown>
#14 0x55d180ea9d58 <unknown>
#15 0x55d180ea9ed8 <unknown>
#16 0x55d180ec3cfd <unknown>
#17 0x7f3c9700b609 <unknown>

Running google-chrome-stable --version gives Google Chrome 103.0.5060.53
Running chromedriver --version gives ChromeDriver 103.0.5060.53 (a1711811edd74ff1cf2150f36ffa3b0dae40b17f-refs/branch-heads/5060@{#853})

It has worked a few times from crontab, but ultimately started giving me this error too.

If someone finds a solution, please us know here!

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

3 participants