getting this error sometimes when the script starts and sometimes after a few hours:
Traceback (most recent call last):
File "custom.py", line 30, in job
session.login()
File "/home/pi/InstaPy/instapy/instapy.py", line 350, in login
self.bypass_suspicious_attempt):
File "/home/pi/InstaPy/instapy/login_util.py", line 98, in login_user
browser.get('https://www.instagram.com')
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 248, in get
self.execute(Command.GET, {'url': url})
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 234, in execute
response = self.command_executor.execute(driver_command, params)
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/remote_connection.py", line 401, in execute
return self._request(command_info[0], url, body=data)
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/remote_connection.py", line 432, in _request
self._conn.request(method, parsed_url.path, body, headers)
File "/usr/lib/python2.7/httplib.py", line 1042, in request
self._send_request(method, url, body, headers)
File "/usr/lib/python2.7/httplib.py", line 1082, in _send_request
self.endheaders(body)
File "/usr/lib/python2.7/httplib.py", line 1038, in endheaders
self._send_output(message_body)
File "/usr/lib/python2.7/httplib.py", line 882, in _send_output
self.send(msg)
File "/usr/lib/python2.7/httplib.py", line 844, in send
self.connect()
File "/usr/lib/python2.7/httplib.py", line 821, in connect
self.timeout, self.source_address)
File "/usr/lib/python2.7/socket.py", line 575, in create_connection
raise err
error: [Errno 111] Connection refused
Traceback (most recent call last):
File "custom.py", line 30, in job
session.login()
File "/home/pi/InstaPy/instapy/instapy.py", line 350, in login
self.bypass_suspicious_attempt):
File "/home/pi/InstaPy/instapy/login_util.py", line 98, in login_user
browser.get('https://www.instagram.com')
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 248, in get
self.execute(Command.GET, {'url': url})
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 234, in execute
response = self.command_executor.execute(driver_command, params)
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/remote_connection.py", line 401, in execute
return self._request(command_info[0], url, body=data)
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/remote_connection.py", line 432, in _request
self._conn.request(method, parsed_url.path, body, headers)
File "/usr/lib/python2.7/httplib.py", line 1042, in request
self._send_request(method, url, body, headers)
File "/usr/lib/python2.7/httplib.py", line 1082, in _send_request
self.endheaders(body)
File "/usr/lib/python2.7/httplib.py", line 1038, in endheaders
self._send_output(message_body)
File "/usr/lib/python2.7/httplib.py", line 882, in _send_output
self.send(msg)
File "/usr/lib/python2.7/httplib.py", line 844, in send
self.connect()
File "/usr/lib/python2.7/httplib.py", line 821, in connect
self.timeout, self.source_address)
File "/usr/lib/python2.7/socket.py", line 575, in create_connection
raise err
error: [Errno 111] Connection refused
Traceback (most recent call last):
File "custom.py", line 30, in job
session.login()
File "/home/pi/InstaPy/instapy/instapy.py", line 350, in login
self.bypass_suspicious_attempt):
File "/home/pi/InstaPy/instapy/login_util.py", line 98, in login_user
browser.get('https://www.instagram.com')
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 248, in get
self.execute(Command.GET, {'url': url})
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 234, in execute
response = self.command_executor.execute(driver_command, params)
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/remote_connection.py", line 401, in execute
return self._request(command_info[0], url, body=data)
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/remote_connection.py", line 432, in _request
self._conn.request(method, parsed_url.path, body, headers)
File "/usr/lib/python2.7/httplib.py", line 1042, in request
self._send_request(method, url, body, headers)
File "/usr/lib/python2.7/httplib.py", line 1082, in _send_request
self.endheaders(body)
File "/usr/lib/python2.7/httplib.py", line 1038, in endheaders
self._send_output(message_body)
File "/usr/lib/python2.7/httplib.py", line 882, in _send_output
self.send(msg)
File "/usr/lib/python2.7/httplib.py", line 844, in send
self.connect()
File "/usr/lib/python2.7/httplib.py", line 821, in connect
self.timeout, self.source_address)
File "/usr/lib/python2.7/socket.py", line 575, in create_connection
raise err
error: [Errno 111] Connection refused
^CTraceback (most recent call last):
File "custom.py", line 62, in
time.sleep(1)
KeyboardInterrupt
anybody ideas how to fix this?
try to use python3
I have already python3 installed now, still not working..
are you using proxy ?
I am using a raspberry pi for it to run
anyone ideas?
@uluQulu you still here bro?
maybe check your internet condition?
Hi @aku6640
First make sure your web browser of choice and its webdriver are up-to-date and compatible.
_Same for selenium
package_.
How frequently you do get it?
That is an issue with a wide scope and can be occurred out of several reasons and it needs a compact diagnosis to suggest a total solution.
That's why provide any feedback you think can help on this matter.
so I got it everyday, and last days the script wouldn't even run because of this error.
I have upgradede selenium, chromium and downloaded geckodriver into the /usr/local/bin folder.
the script is now running again and I hope it keeps working because all the time it stops in a few hours because of the 111 error. Hope this helped and that it not occurs anymore, thanks!
still getting the error, but now little different..
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/urllib3/connection.py", line 141, in _new_conn
(self.host, self.port), self.timeout, **extra_kw)
File "/usr/local/lib/python3.5/dist-packages/urllib3/util/connection.py", line 83, in create_connection
raise err
File "/usr/local/lib/python3.5/dist-packages/urllib3/util/connection.py", line 73, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/urllib3/connectionpool.py", line 601, in urlopen
chunked=chunked)
File "/usr/local/lib/python3.5/dist-packages/urllib3/connectionpool.py", line 357, in _make_request
conn.request(method, url, **httplib_request_kw)
File "/usr/lib/python3.5/http/client.py", line 1107, in request
self._send_request(method, url, body, headers)
File "/usr/lib/python3.5/http/client.py", line 1152, in _send_request
self.endheaders(body)
File "/usr/lib/python3.5/http/client.py", line 1103, in endheaders
self._send_output(message_body)
File "/usr/lib/python3.5/http/client.py", line 934, in _send_output
self.send(msg)
File "/usr/lib/python3.5/http/client.py", line 877, in send
self.connect()
File "/usr/local/lib/python3.5/dist-packages/urllib3/connection.py", line 166, in connect
conn = self._new_conn()
File "/usr/local/lib/python3.5/dist-packages/urllib3/connection.py", line 150, in _new_conn
self, "Failed to establish a new connection: %s" % e)
urllib3.exceptions.NewConnectionError:
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "custom.py", line 30, in job
session.login()
File "/home/pi/InstaPy/instapy/instapy.py", line 370, in login
self.bypass_suspicious_attempt):
File "/home/pi/InstaPy/instapy/login_util.py", line 107, in login_user
web_address_navigator(browser, ig_homepage)
File "/home/pi/InstaPy/instapy/util.py", line 648, in web_address_navigator
current_url = get_current_url(browser)
File "/home/pi/InstaPy/instapy/util.py", line 1059, in get_current_url
current_url = browser.execute_script("return window.location.href")
File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/webdriver.py", line 635, in execute_script
'args': converted_args})['value']
File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/webdriver.py", line 318, in execute
response = self.command_executor.execute(driver_command, params)
File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/remote_connection.py", line 375, in execute
return self._request(command_info[0], url, body=data)
File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/remote_connection.py", line 397, in _request
resp = self._conn.request(method, url, body=body, headers=headers)
File "/usr/local/lib/python3.5/dist-packages/urllib3/request.py", line 70, in request
*urlopen_kw)
File "/usr/local/lib/python3.5/dist-packages/urllib3/request.py", line 148, in request_encode_body
return self.urlopen(method, url, *extra_kw)
File "/usr/local/lib/python3.5/dist-packages/urllib3/poolmanager.py", line 321, in urlopen
response = conn.urlopen(method, u.request_uri, *kw)
File "/usr/local/lib/python3.5/dist-packages/urllib3/connectionpool.py", line 668, in urlopen
*response_kw)
File "/usr/local/lib/python3.5/dist-packages/urllib3/connectionpool.py", line 668, in urlopen
*response_kw)
File "/usr/local/lib/python3.5/dist-packages/urllib3/connectionpool.py", line 668, in urlopen
*response_kw)
File "/usr/local/lib/python3.5/dist-packages/urllib3/connectionpool.py", line 639, in urlopen
_stacktrace=sys.exc_info()[2])
File "/usr/local/lib/python3.5/dist-packages/urllib3/util/retry.py", line 388, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='127.0.0.1', port=36313): Max retries exceeded with url: /session/de0d806198f7efcd152c919b0d19e828/execute (Caused by NewConnectionError('
what's happening here?
@aku6640
It is the same error:
_[Errno 111] Connection refused_
Earlier in your older python 2.7.?
it was raised by socket.error
with the _errno_ of 111
and now it raises ConnectionRefusedError
in your new python (_introduced after python 3.3
_).
I will try to produce a solution with your feedback in my free time, keep up giving more 馃帀 details
_Although this issue has to be solved, I have a suggestion for you - get a healthy bandwith whether it is a proxy or local area connection_.
thanks @uluQulu, I appreciate your help as always, 脟ox sa臒 ol!
I have a 500 Mb/s glassfibre connection, that should be enough right? 馃槅
hi @uluQulu, did you manage to find the problem? still getting this error. Sometimes when the script starts and sometimes when in the middle of running the script..
You're welcome @aku6640
I still got not time to offer a solution but soon I will, hopefully 馃帄
This error has still not been fixed, anyone knows a solution? @timgrossmann maybe you?
I found that the Connection refused error could be because of this:
Connection refused means one of three things.
What do I have to do and where can I check this to have this in the right settings?
Hi @aku6640
First of all you must get a healthy connection.
_You will get lesser connection refused errors as you strengthen your connection health_.
Let's start to solve it.
Can you quickly tell the full python version (_e.g. 2.7.14
_) of your system so that I can produce a solution?
_If you have different systems with different pythons having that problem, provide all of their full python versions_.
I have completely reinstalled the raspberry, so I did everything again for the instapy
now I am getting this error:
ERROR [2018-10-01 13:32:09] [instaccount] Message: session not created exception
from tab crashed
(Session info: headless chrome=69.0.3497.92)
(Driver info: chromedriver=2.36 (a81166ad79e68fbfe7cf5ba243192d6412e26b37),platform=Linux 4.14.70-v7+ armv7l)
Traceback (most recent call last):
File "/home/pi/Projects/InstaPy/instapy/instapy.py", line 333, in set_selenium_local_session
chrome_options=chrome_options)
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/chrome/webdriver.py", line 81, in __init__
desired_capabilities=desired_capabilities)
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 157, in __init__
self.start_session(capabilities, browser_profile)
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 252, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
SessionNotCreatedException: Message: session not created exception
from tab crashed
(Session info: headless chrome=69.0.3497.92)
(Driver info: chromedriver=2.36 (a81166ad79e68fbfe7cf5ba243192d6412e26b37),platform=Linux 4.14.70-v7+ armv7l)
Traceback (most recent call last):
File "quickstart.py", line 26, in
multi_logs=True)
File "/home/pi/Projects/InstaPy/instapy/instapy.py", line 217, in __init__
self.set_selenium_local_session()
File "/home/pi/Projects/InstaPy/instapy/instapy.py", line 337, in set_selenium_local_session
Settings.chromedriver_location))
instapy.instapy.InstaPyError: ensure chromedriver is installed at /home/pi/Projects/InstaPy/assets/chromedriver
Not anymore the connection refused error but this one.
I already used this tutorial for installation: https://github.com/timgrossmann/InstaPy/blob/master/docs/How_to_Raspberry.md
I also did headless_browser=True in the instapy constructor
Can you help me with this?
@aku6640 how were you able to get chromedriver version 2.36? mine keeps retrieving 2.40
hi @andiskim I tried it with the beta version, but also one version earlier. I think that's the 2.36
Having the same error with latest chromedriver. Wasn't happening before updating the repo (I had a 2 month old version)
BTW, it happens both on headless_browser
True
and False
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. > If this problem still occurs, please open a new issue
I am also getting this error.
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='127.0.0.1', port=36137): Max retries exceeded with url: /session/c532a4e6dc3e33e698445273c7d09272/execute (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f5dd30a8748>: Failed to establish a new connection: [Errno 111] Connection refused',))
getting the same error:
-- -- EXCEPTION IN (/home/script.py, LINE 159 "driver.get(pageToLoad)"): HTTPConnectionPool(host='127.0.0.1', port=40641): Max retries exceeded with url: /session/eadd3489-b85e-45f3-99f0-2a99097b5bdb/url (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f7a0842fe90>: Failed to establish a new connection: [Errno 111] Connection refused',))
[Errno 2] No such file or directory: '/tmp/tmpHwv_sm'
Error does not always appear though, happens randomly in between runs.
Most helpful comment
thanks @uluQulu, I appreciate your help as always, 脟ox sa臒 ol!
I have a 500 Mb/s glassfibre connection, that should be enough right? 馃槅