F5Networks / f5-common-python

Python SDK for configuration and monitoring of F5® BIG-IP® devices via the iControl® REST API.
https://f5-sdk.readthedocs.org
Apache License 2.0
262 stars 134 forks source link

after import ManagementRoot still cannot connect to F5 #1051

Closed colelove closed 7 years ago

colelove commented 7 years ago

Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python2.6/site-packages/f5/bigip/__init__.py", line 67, in __init__ self._get_tmos_version() File "/usr/lib/python2.6/site-packages/f5/bigip/__init__.py", line 84, in _get_tmos_version response = connect.get(base_uri) File "/usr/lib/python2.6/site-packages/icontrol/session.py", line 258, in wrapper response = method(self, REST_uri, **kwargs) File "/usr/lib/python2.6/site-packages/icontrol/session.py", line 427, in get return self.session.get(uri, **kwargs) File "/usr/lib/python2.6/site-packages/requests/sessions.py", line 501, in get return self.request('GET', url, **kwargs) File "/usr/lib/python2.6/site-packages/requests/sessions.py", line 488, in request resp = self.send(prep, **send_kwargs) File "/usr/lib/python2.6/site-packages/requests/sessions.py", line 609, in send r = adapter.send(request, **kwargs) File "/usr/lib/python2.6/site-packages/requests/adapters.py", line 487, in send raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: HTTPSConnectionPool(host='https', port=443): Max retries exceeded with url: //172.16.4.20:443/mgmt/tm/sys/ (Caused by NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x2df0990>: Failed to establish a new connection: [Errno -2] Name or service not known',))

what can i do after recieving that ?

wojtek0806 commented 7 years ago

@colelove

Are you using development branch or the main release? If main release, this looks like connection issue to your unit, verify if you can access it using standard REST client from the same host you are using SDK on.

Also a worthy note, we are dropping python 2.6 support next release which should happen soon.

caphrim007 commented 7 years ago

@colelove this error usually indicates that the hostname provided was not resolvable in DNS.

Looking at the error you provided, this line stands out to me

 HTTPSConnectionPool(host='https', port=443): Max retries exceeded with url: 
//172.16.4.20:443/mgmt/tm/sys/ (Caused by 

It's unclear to me why your host is named "https" and then is curiously followed with an error where the URL known to requests in //172......

The name and error remind me an awful lot of "https://"

What does your python usage of the sdk look like?

wojtek0806 commented 7 years ago

@colelove do you need any further assistance in this?

wojtek0806 commented 7 years ago

closing please come back if the issue persists and the above did not help

colelove commented 7 years ago

thx all for your helps