Script run error
Closed this issue · 2 comments
When I try to run prepare.py getting the below error. Any suggestion?
`[root@devops-node-01 vault-load-testing]# ./prepare.py 7XSdGjdXsLCJgzAQ0TSpmlgH
Creating test keys in Vault [------------------------------------] 0%
Traceback (most recent call last):
File "/usr/lib/python3.4/site-packages/urllib3/connection.py", line 159, in _new_conn
(self._dns_host, self.port), self.timeout, **extra_kw)
File "/usr/lib/python3.4/site-packages/urllib3/util/connection.py", line 80, in create_connection
raise err
File "/usr/lib/python3.4/site-packages/urllib3/util/connection.py", line 70, 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/lib/python3.4/site-packages/urllib3/connectionpool.py", line 600, in urlopen
chunked=chunked)
File "/usr/lib/python3.4/site-packages/urllib3/connectionpool.py", line 354, in _make_request
conn.request(method, url, **httplib_request_kw)
File "/usr/lib64/python3.4/http/client.py", line 1137, in request
self._send_request(method, url, body, headers)
File "/usr/lib64/python3.4/http/client.py", line 1182, in _send_request
self.endheaders(body)
File "/usr/lib64/python3.4/http/client.py", line 1133, in endheaders
self._send_output(message_body)
File "/usr/lib64/python3.4/http/client.py", line 963, in _send_output
self.send(msg)
File "/usr/lib64/python3.4/http/client.py", line 898, in send
self.connect()
File "/usr/lib/python3.4/site-packages/urllib3/connection.py", line 181, in connect
conn = self._new_conn()
File "/usr/lib/python3.4/site-packages/urllib3/connection.py", line 168, in _new_conn
self, "Failed to establish a new connection: %s" % e)
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f9edd60fa90>: 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 "/usr/lib/python3.4/site-packages/requests/adapters.py", line 449, in send
timeout=timeout
File "/usr/lib/python3.4/site-packages/urllib3/connectionpool.py", line 638, in urlopen
_stacktrace=sys.exc_info()[2])
File "/usr/lib/python3.4/site-packages/urllib3/util/retry.py", line 398, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8200): Max retries exceeded with url: /v1/secret/test/c0/e4358f10e3b3fd5dcbd7067ea3b13cdf (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f9edd60fa90>: 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 "./prepare.py", line 46, in
main()
File "/usr/lib/python3.4/site-packages/click/core.py", line 722, in call
return self.main(*args, **kwargs)
File "/usr/lib/python3.4/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/usr/lib/python3.4/site-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/lib/python3.4/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "./prepare.py", line 34, in main
paths = populate(host, secrets, secret_size, token)
File "./prepare.py", line 16, in populate
r = s.post("%s/v1/secret/test/%s" %(host,path), json={'value': common.random_data(size)})
File "/usr/lib/python3.4/site-packages/requests/sessions.py", line 581, in post
return self.request('POST', url, data=data, json=json, **kwargs)
File "/usr/lib/python3.4/site-packages/requests/sessions.py", line 533, in request
resp = self.send(prep, **send_kwargs)
File "/usr/lib/python3.4/site-packages/requests/sessions.py", line 646, in send
r = adapter.send(request, **kwargs)
File "/usr/lib/python3.4/site-packages/requests/adapters.py", line 516, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8200): Max retries exceeded with url: /v1/secret/test/c0/e4358f10e3b3fd5dcbd7067ea3b13cdf (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f9edd60fa90>: Failed to establish a new connection: [Errno 111] Connection refused',))
`
Looks like Vault is not running on localhost or is not listening on port 8200.
If you intend to run against localhost, make sure Vault is running.
If you intend to run the test against a remote Vault server, make sure you pass the -H
command line option to specify the hostname.
I have fixed this problem. This issue can be closed.