Instapy: Chrome not reachable error

Created on 27 Aug 2018  路  11Comments  路  Source: timgrossmann/InstaPy

Expected Behavior

Follow / Unfollow without crashing

Current Behavior

I am using the latest chrome driver, chrome browser and latest InstaPy running on ubuntu server 18.04. I keep getting the error below when I use InstaPy for some time. For example, if I set it to follow 100 users, after following around 70 users, I will get this error. Happens during unfollowing too.

WARNING [2018-08-27 17:26:22] [XXX]  Could not locate Chrome: Message: chrome not reachable
  (Session info: headless chrome=68.0.3440.106)
  (Driver info: chromedriver=2.41.578700 (2f1ed5f9343c13f73144538f15c00b370eda6706),platform=Linux 4.15.0-33-generic x86_64)

INFO [2018-08-27 17:26:22] [XXX]  Session ended - 2018-08-27 17:26:22

Traceback (most recent call last):
  File "InstaPy/quickstart.py", line 40, in <module>
    session.follow_user_followers(['XXX'], amount=100)
  File "/home/user/InstaPy/instapy/instapy.py", line 2097, in follow_user_followers
    followed = self.follow_by_list(person, self.follow_times, sleep_delay, interact)
  File "/home/user/InstaPy/instapy/instapy.py", line 710, in follow_by_list
    self.logger)
  File "/home/user/InstaPy/instapy/util.py", line 91, in validate_username
    followers_count, following_count = get_relationship_counts(browser, username, logger)
  File "/home/user/InstaPy/instapy/util.py", line 526, in get_relationship_counts
    web_adress_navigator(browser, user_link)
  File "/home/user/InstaPy/instapy/util.py", line 598, in web_adress_navigator
    browser.get(link)
  File "/usr/local/lib/python3.6/dist-packages/selenium-2.53.6-py3.6.egg/selenium/webdriver/remote/webdriver.py", line 248, in get
    self.execute(Command.GET, {'url': url})
  File "/usr/local/lib/python3.6/dist-packages/selenium-2.53.6-py3.6.egg/selenium/webdriver/remote/webdriver.py", line 236, in execute
    self.error_handler.check_response(response)
  File "/usr/local/lib/python3.6/dist-packages/selenium-2.53.6-py3.6.egg/selenium/webdriver/remote/errorhandler.py", line 192, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: chrome not reachable
  (Session info: headless chrome=68.0.3440.106)
  (Driver info: chromedriver=2.41.578700 (2f1ed5f9343c13f73144538f15c00b370eda6706),platform=Linux 4.15.0-33-generic x86_64)

Exception ignored in: <bound method Service.__del__ of <selenium.webdriver.chrome.service.Service object at 0x7f571ab4bc18>>
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/selenium-2.53.6-py3.6.egg/selenium/webdriver/common/service.py", line 163, in __del__
  File "/usr/local/lib/python3.6/dist-packages/selenium-2.53.6-py3.6.egg/selenium/webdriver/common/service.py", line 139, in stop
  File "/usr/local/lib/python3.6/dist-packages/selenium-2.53.6-py3.6.egg/selenium/webdriver/common/service.py", line 110, in send_remote_shutdown_command
ImportError: sys.meta_path is None, Python is likely shutting down

@uluQulu Thank you for all the great work you have done on this repo. I would be eternally grateful if you could help me with this :D

Most helpful comment

Sure @santhoshraje
I will have a look at your problem soon 馃帀


Cheers 馃榿

All 11 comments

Sure @santhoshraje
I will have a look at your problem soon 馃帀


Cheers 馃榿

@uluQulu is it related also for this issue?
It happens during follow session
follow for help friend, thanks!

Traceback (most recent call last):
File "xxxx", line 44, in
session.follow_user_followers(['xxxx'], amount=800, randomize=False, interact=False)
File "/Users/xxxx/Desktop/InstaPy/instapy/instapy.py", line 2052, in follow_user_followers
self.logfolder)
File "/Users/xxxx/Desktop/InstaPy/instapy/unfollow_util.py", line 910, in get_given_user_followers
channel, logger, logfolder)
File "/Users/xxxx/Desktop/InstaPy/instapy/unfollow_util.py", line 671, in get_users_through_dialog
scroll_bottom(browser, dialog, 2)
File "/Users/xxxx/Desktop/InstaPy/instapy/util.py", line 426, in scroll_bottom
"arguments[0].scrollTop = arguments[0].scrollHeight", element)
File "/Library/Python/2.7/site-packages/selenium-2.53.6-py2.7.egg/selenium/webdriver/remote/webdriver.py", line 465, in execute_script
'args': converted_args})['value']
File "/Library/Python/2.7/site-packages/selenium-2.53.6-py2.7.egg/selenium/webdriver/remote/webdriver.py", line 236, in execute
self.error_handler.check_response(response)
File "/Library/Python/2.7/site-packages/selenium-2.53.6-py2.7.egg/selenium/webdriver/remote/errorhandler.py", line 192, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.StaleElementReferenceException: Message: stale element reference: element is not attached to the page document
(Session info: chrome=68.0.3440.106)
(Driver info: chromedriver=2.37.544337 (8c0344a12e552148c185f7d5117db1f28d6c9e85),platform=Mac OS X 10.12.6 x86_64)

Hey @cormo1990
It is another issue and I have inspected it earlier- https://github.com/timgrossmann/InstaPy/issues/2774#issuecomment-416028571 and now I will look to solve it first.


Cheers 馃榿

@santhoshraje
This problem's scope is a bit BIG.
Can you provide some feedback to find the source of the isse?

  • How often do you get encounter this problem?
  • While starting the session or inside the session [after some succesfful activity]?
  • Do you use local or remote session?
  • Tell a bit of your usage where this error happens: [VPS || proxy || docker || nogui=True || headless? || etc.]
  • Other feedback

Cheers 馃榿

selenium.common.exceptions.StaleElementReferenceException: Message: stale element reference: element is not attached to the page document
(Session info: headless chrome=68.0.3440.106)
(Driver info: chromedriver=2.41.578700 (2f1ed5f9343c13f73144538f15c00b370eda6706),platform=Linux 4.15.0-33-generic x86_64)

a mi me sale este error siempre, no se que hacer, puedo ejecutar el codigo lee todas las cuentas termina bien y luego le digo que comiece y se queda en este error, si corro el programa 6 veces me sucede en 5 veces que hacer

I am having the same issue, running 5 accounts on Debian. Sometimes I get the same error after following or unfollowing. Is there any solution for this?

This issue has returned. I experience it all the time now, about 30 unfollow's in this error is thrown.

Just got the same error when unfollowing. Ubuntu 18.04 and latest chrome browser and driver.

I always get it too...Everyday...It's annoying, even if I have done a script that will forever relaunch it. It might relaunch it one time successfully buy then it will have this error again for some times and then just infinite loop and finally will crash the machine (RPI)

I have the same problem! How do you init the process? I run on a AWS server with nohup. I believe that the problem maybe the nohup that can't run the chrome process after the disconnect from ssh session.

I have the same problem! How do you init the process? I run on a AWS server with nohup. I believe that the problem maybe the nohup that can't run the chrome process after the disconnect from ssh session.

I found an issue in another project that was said to be the chrome version incompatible with the webdriver version. Seems that my chromium was 76 and webdriver 75. I am testing an upgrade and I will give feedback.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghost picture ghost  路  3Comments

thisishotdog picture thisishotdog  路  3Comments

46960 picture 46960  路  3Comments

n0sw34r picture n0sw34r  路  3Comments

Spyd3r0us picture Spyd3r0us  路  3Comments