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

connection error #22

Open
Mohammadwh opened this issue Apr 4, 2021 · 4 comments
Open

connection error #22

Mohammadwh opened this issue Apr 4, 2021 · 4 comments

Comments

@Mohammadwh
Copy link

hi how i can fix this guys:

from ibsng import IBSng
con = IBSng("system:H5270041960n@http://127.0.0.1:1237")
con.auth()
Traceback (most recent call last):
File "/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/urllib3/connection.py", line 170, in _new_conn
(self._dns_host, self.port), self.timeout, **extra_kw
File "/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/urllib3/util/connection.py", line 96, in create_connection
raise err
File "/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/urllib3/util/connection.py", line 86, 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 "/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/urllib3/connectionpool.py", line 706, in urlopen
chunked=chunked,
File "/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/urllib3/connectionpool.py", line 394, in _make_request
conn.request(method, url, **httplib_request_kw)
File "/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/urllib3/connection.py", line 234, in request
super(HTTPConnection, self).request(method, url, body=body, headers=headers)
File "/opt/rh/rh-python36/root/usr/lib64/python3.6/http/client.py", line 1287, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/opt/rh/rh-python36/root/usr/lib64/python3.6/http/client.py", line 1333, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/opt/rh/rh-python36/root/usr/lib64/python3.6/http/client.py", line 1282, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/opt/rh/rh-python36/root/usr/lib64/python3.6/http/client.py", line 1042, in _send_output
self.send(msg)
File "/opt/rh/rh-python36/root/usr/lib64/python3.6/http/client.py", line 980, in send
self.connect()
File "/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/urllib3/connection.py", line 200, in connect
conn = self._new_conn()
File "/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/urllib3/connection.py", line 182, in _new_conn
self, "Failed to establish a new connection: %s" % e
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f7b0470da20>: Failed to establish a new connection: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/requests/adapters.py", line 449, in send
timeout=timeout
File "/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/urllib3/connectionpool.py", line 756, in urlopen
method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
File "/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/urllib3/util/retry.py", line 574, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='127.0.0.1', port=1237): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f7b0470da20>: Failed to establish a new connection: [Errno 111] Connection refused',))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/ibsng/connection/request.py", line 44, in send
data=data, timeout=self._timeout)
File "/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/requests/sessions.py", line 590, in post
return self.request('POST', url, data=data, json=json, **kwargs)
File "/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/requests/sessions.py", line 542, in request
resp = self.send(prep, **send_kwargs)
File "/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/requests/sessions.py", line 655, in send
r = adapter.send(request, **kwargs)
File "/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/requests/adapters.py", line 516, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=1237): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f7b0470da20>: Failed to establish a new connection: [Errno 111] Connection refused',))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "", line 1, in
File "/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/ibsng/connection/connection.py", line 109, in auth
action = self._call("login.login", **tmp_params)
File "/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/ibsng/connection/connection.py", line 138, in _call
action = self._request.send(method, **params)
File "/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/ibsng/connection/request.py", line 48, in send
raise ServerConnectionError(e)
ibsng.exception.connection.ServerConnectionError: [2021-04-04 12:56:14]:HTTPConnectionPool(host='127.0.0.1', port=1237): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f7b0470da20>: Failed to establish a new connection: [Errno 111] Connection refused',)) - 101

@mortymacs
Copy link
Contributor

mortymacs commented Apr 4, 2021

Would you please double check the port by telnet?

$ telnet 127.0.0.1 1237

@Mohammadwh
Copy link
Author

[root@IBSngfix ~]# telnet 127.0.0.1 1237
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refused
[root@IBSngfix ~]#

this is my result

@mortymacs
Copy link
Contributor

So, the host and port you mentioned are not available or the service is not running. Make sure your service is running correctly.

@amirmnoohi
Copy link

Hi,
I've installed IBSng multiple times and port 1237 is not listening, instead, 1235 is listening. I tried everything on any port! can you just tell me what is the problem?

P.S. I use free version

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