Closed bhumitra closed 3 years ago
WinRM is likely not configured on the server. Try running winrm qc
from an Administrator command prompt, then try again.
Closing as per the above. The requests library is unable to connect to the host which could be due to a myriad of reasons. Make sure you've enabled WinRM and opened the firewall.
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "C:\python3.9\lib\site-packages\urllib3\connectionpool.py", line 699, in urlopen httplib_response = self._make_request( File "C:\python3.9\lib\site-packages\urllib3\connectionpool.py", line 394, in _make_request conn.request(method, url, **httplib_request_kw) File "C:\python3.9\lib\site-packages\urllib3\connection.py", line 234, in request super(HTTPConnection, self).request(method, url, body=body, headers=headers) File "C:\python3.9\lib\http\client.py", line 1255, in request self._send_request(method, url, body, headers, encode_chunked) File "C:\python3.9\lib\http\client.py", line 1301, in _send_request self.endheaders(body, encode_chunked=encode_chunked) File "C:\python3.9\lib\http\client.py", line 1250, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "C:\python3.9\lib\http\client.py", line 1010, in _send_output self.send(msg) File "C:\python3.9\lib\http\client.py", line 950, in send self.connect() File "C:\python3.9\lib\site-packages\urllib3\connection.py", line 200, in connect conn = self._new_conn() File "C:\python3.9\lib\site-packages\urllib3\connection.py", line 181, in _new_conn raise NewConnectionError( urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x0000022B1DB447C0>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "C:\python3.9\lib\site-packages\requests\adapters.py", line 439, in send resp = conn.urlopen( File "C:\python3.9\lib\site-packages\urllib3\connectionpool.py", line 755, in urlopen retries = retries.increment( File "C:\python3.9\lib\site-packages\urllib3\util\retry.py", line 573, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=5985): Max retries exceeded with url: /wsman (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x0000022B1DB447C0>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "", line 1, in
File "C:\python3.9\lib\site-packages\pypsrp\shell.py", line 98, in enter
self.open()
File "C:\python3.9\lib\site-packages\pypsrp\shell.py", line 203, in open
response = self.wsman.create(self.resource_uri, shell,
File "C:\python3.9\lib\site-packages\pypsrp\wsman.py", line 269, in create
res = self.invoke(WSManAction.CREATE, resource_uri, resource,
File "C:\python3.9\lib\site-packages\pypsrp\wsman.py", line 389, in invoke
response = self.transport.send(xml)
File "C:\python3.9\lib\site-packages\pypsrp\wsman.py", line 761, in send
return self._send_request(prep_request)
File "C:\python3.9\lib\site-packages\pypsrp\wsman.py", line 764, in _send_request
response = self.session.send(request, timeout=(
File "C:\python3.9\lib\site-packages\requests\sessions.py", line 655, in send
r = adapter.send(request, **kwargs)
File "C:\python3.9\lib\site-packages\requests\adapters.py", line 516, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=5985): Max retries exceeded with url: /wsman (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x0000022B1DB447C0>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it'))
How do I get past this?