Skip to content

Instantly share code, notes, and snippets.

@0xIslamTaha
Created July 4, 2018 10:19
Show Gist options
  • Save 0xIslamTaha/022a9d415cd0182aa581c604aa542a78 to your computer and use it in GitHub Desktop.
Save 0xIslamTaha/022a9d415cd0182aa581c604aa542a78 to your computer and use it in GitHub Desktop.
In [25]: gw_data = {
...: 'nodeId': '525400000521',
...: 'hostname': 'mygw',
...: 'domain': 'lan',
...: 'nodeRobot': 'main',
...: 'networks': [{
...: 'name': 'private',
...: 'type': 'zerotier',
...: 'public': False,
...: 'id': '8850338390729392',
...: 'ztClient': 'newWorker2'
...: }],
...: 'portforwards':[{'name': 'pf',
...: ^I^I 'vm': 'vm000100010',
...: 'dstport': 22,
...: 'srcport': 22,
...: 'protocols': ['tcp']}]
...:
...: }
...:
In [26]:
In [26]: dmgw_1 = robot.services.create('github.com/jumpscale/digital_me/gateway/0.0.1', service_name='dm_gw_3', data=gw_data)
In [27]: dmgw_1.schedule_action('install').wait(die=True)
File "/usr/local/lib/python3.5/dist-packages/urllib3/connectionpool.py", line 354, in _make_request
conn.request(method, url, **httplib_request_kw)
File "/usr/lib/python3.5/http/client.py", line 1106, in request
self._send_request(method, url, body, headers)
File "/usr/lib/python3.5/http/client.py", line 1151, in _send_request
self.endheaders(body)
File "/usr/lib/python3.5/http/client.py", line 1102, 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 196, in connect
conn = self._new_conn()
File "/usr/local/lib/python3.5/dist-packages/urllib3/connection.py", line 180, in _new_conn
self, "Failed to establish a new connection: %s" % e)
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7fdacf46a630>: Failed to establish a new connection: [Errno 110] Connection timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/requests/adapters.py", line 445, in send
timeout=timeout
File "/usr/local/lib/python3.5/dist-packages/urllib3/connectionpool.py", line 638, in urlopen
_stacktrace=sys.exc_info()[2])
File "/usr/local/lib/python3.5/dist-packages/urllib3/util/retry.py", line 398, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='gw2.robot.threefoldtoken.com', port=6600): Max retries exceeded with url: /services?name=b4413327-4292-4534-9638-d36c488d947c&template_uid=github.com%2Fzero-os%2F0-templates%2Fpublic_gateway%2F0.0.1 (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fdacf46a630>: Failed to establish a new connection: [Errno 110] Connection timed out',))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/code/github/zero-os/0-robot/zerorobot/task/task.py", line 79, in execute
self._result = self._func()
File "/opt/code/github/jumpscale/digital_me/templates/gateway/gateway.py", line 73, in install
pgwservice = self._public_robot_api.services.find_or_create(PGW_UID, self.guid, {})
File "/opt/code/github/zero-os/0-robot/zerorobot/dsl/ZeroRobotManager.py", line 208, in find_or_create
return self.get(template_uid=template_uid, name=service_name)
File "/opt/code/github/zero-os/0-robot/zerorobot/dsl/ZeroRobotManager.py", line 122, in get
results = self.find(**kwargs)
File "/opt/code/github/zero-os/0-robot/zerorobot/dsl/ZeroRobotManager.py", line 102, in find
services, _ = self._client.api.services.listServices(query_params=kwargs)
File "/opt/code/github/zero-os/0-robot/JumpScale9Zrobot/clients/zerorobot/client/services_service.py", line 186, in listServices
resp = self.client.get(uri, None, headers, query_params, content_type)
File "/opt/code/github/zero-os/0-robot/JumpScale9Zrobot/clients/zerorobot/client/http_client.py", line 71, in get
return self._handle_data(uri, data, headers, params, content_type, self.session.get)
File "/opt/code/github/zero-os/0-robot/JumpScale9Zrobot/clients/zerorobot/client/http_client.py", line 53, in _handle_data
res = method(uri, headers=headers, params=params)
File "/usr/local/lib/python3.5/dist-packages/requests/sessions.py", line 525, in get
return self.request('GET', url, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/requests/sessions.py", line 512, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python3.5/dist-packages/requests/sessions.py", line 622, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/requests/adapters.py", line 513, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='gw2.robot.threefoldtoken.com', port=6600): Max retries exceeded with url: /services?name=b4413327-4292-4534-9638-d36c488d947c&template_uid=github.com%2Fzero-os%2F0-templates%2Fpublic_gateway%2F0.0.1 (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fdacf46a630>: Failed to establish a new connection: [Errno 110] Connection timed out',))
---------------------------------------------------------------------------
ErrorConditionObject Traceback (most recent call last)
/usr/local/bin/js9 in <module>()
----> 1 dmgw_1.schedule_action('install').wait(die=True)
/opt/code/github/zero-os/0-robot/zerorobot/task/task.py in wait(self, timeout, die)
129 logger.critical('task is in error state, but no eco')
130 else:
--> 131 raise self.eco
132
133 return self
ErrorConditionObject: HTTPConnectionPool(host='gw2.robot.threefoldtoken.com', port=6600): Max retries exceeded with url: /services?name=b4413327-4292-4534-9638-d36c488d947c&template_uid=github.com%2Fzero-os%2F0-templates%2Fpublic_gateway%2F0.0.1 (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fdacf46a630>: Failed to establish a new connection: [Errno 110] Connection timed out',))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment