I installed windows 10 through vmware workstation I want to connect remote machine using python winrm im getting error

0 votes

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Natraj\PycharmProjects\pythonProject2\venv\lib\site-packages\urllib3\connectionpool
.py", line 699, in urlopen
    httplib_response = self._make_request(
  File "C:\Users\Natraj\PycharmProjects\pythonProject2\venv\lib\site-packages\urllib3\connectionpool
.py", line 394, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "C:\Users\Natraj\PycharmProjects\pythonProject2\venv\lib\site-packages\urllib3\connection.py"
, line 234, in request
    super(HTTPConnection, self).request(method, url, body=body, headers=headers)
  File "C:\Python38\lib\http\client.py", line 1255, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "C:\Python38\lib\http\client.py", line 1301, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "C:\Python38\lib\http\client.py", line 1250, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "C:\Python38\lib\http\client.py", line 1010, in _send_output
    self.send(msg)
  File "C:\Python38\lib\http\client.py", line 950, in send
    self.connect()
  File "C:\Users\Natraj\PycharmProjects\pythonProject2\venv\lib\site-packages\urllib3\connection.py"
, line 200, in connect
    conn = self._new_conn()
  File "C:\Users\Natraj\PycharmProjects\pythonProject2\venv\lib\site-packages\urllib3\connection.py"
, line 181, in _new_conn
    raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x04350BB0>: Fai
led to establish a new connection: [WinError 10060] A connection attempt failed because the connecte
d party did not properly respond after a period of time, or established connection failed because co
nnected host has failed to respond

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Natraj\PycharmProjects\pythonProject2\venv\lib\site-packages\requests\adapters.py",
line 439, in send
    resp = conn.urlopen(
  File "C:\Users\Natraj\PycharmProjects\pythonProject2\venv\lib\site-packages\urllib3\connectionpool
.py", line 755, in urlopen
    retries = retries.increment(
  File "C:\Users\Natraj\PycharmProjects\pythonProject2\venv\lib\site-packages\urllib3\util\retry.py"
, line 573, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='192.168.209.129', port=5985): Max retries
exceeded with url: /wsman (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object
at 0x04350BB0>: Failed to establish a new connection: [WinError 10060] A connection attempt failed b
ecause the connected party did not properly respond after a period of time, or established connectio
n failed because connected host has failed to respond'))


During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "nsdk.py", line 8, in <module>
    a = x.run_cmd('hostname')
  File "C:\Users\Natraj\PycharmProjects\pythonProject2\venv\lib\site-packages\winrm\__init__.py", li
ne 39, in run_cmd
    shell_id = self.protocol.open_shell()
  File "C:\Users\Natraj\PycharmProjects\pythonProject2\venv\lib\site-packages\winrm\protocol.py", li
ne 166, in open_shell
    res = self.send_message(xmltodict.unparse(req))
  File "C:\Users\Natraj\PycharmProjects\pythonProject2\venv\lib\site-packages\winrm\protocol.py", li
ne 243, in send_message
    resp = self.transport.send_message(message)
  File "C:\Users\Natraj\PycharmProjects\pythonProject2\venv\lib\site-packages\winrm\transport.py", l
ine 310, in send_message
    self.build_session()
  File "C:\Users\Natraj\PycharmProjects\pythonProject2\venv\lib\site-packages\winrm\transport.py", l
ine 293, in build_session
    self.setup_encryption()
  File "C:\Users\Natraj\PycharmProjects\pythonProject2\venv\lib\site-packages\winrm\transport.py", l
ine 299, in setup_encryption
    self._send_message_request(prepared_request, '')
  File "C:\Users\Natraj\PycharmProjects\pythonProject2\venv\lib\site-packages\winrm\transport.py", l
ine 328, in _send_message_request
    response = self.session.send(prepared_request, timeout=self.read_timeout_sec)
  File "C:\Users\Natraj\PycharmProjects\pythonProject2\venv\lib\site-packages\requests\sessions.py",
line 655, in send
    r = adapter.send(request, **kwargs)
  File "C:\Users\Natraj\PycharmProjects\pythonProject2\venv\lib\site-packages\requests\adapters.py",
line 516, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='192.168.209.129', port=5985): Max retr
ies exceeded with url: /wsman (Caused by NewConnectionError('<urllib3.connection.HTTPConnection obje
ct at 0x04350BB0>: Failed to establish a new connection: [WinError 10060] A connection attempt faile
d because the connected party did not properly respond after a period of time, or established connec
tion failed because connected host has failed to respond'))
Dec 2, 2020 in Python by Natraj
• 120 points

edited Dec 2, 2020 by Niroj 946 views

1 answer to this question.

0 votes

Hey, @Natraj,

This basically means that no response (either positive or negative) was received from the remote host when the TCP connection attempt took place.

One reason this may happen is that a firewall is blocking the response from the server.

Another reason is that the hostname is incorrect.

This could also mean there is a (temporary) problem with the server (or some router along the way). You can try a traceroute to determine whether or not this is true.

Cause

TCP error code 10060 is usually caused by either:

  • DNS issues
  • A port being blocked

Resolution

To determine if a port is being blocked:

  1. Check the log to determine the affected IP address and port number.
    In the example above, the IP address is 10.92.234.137 and the IP address is 17777. Port 17777 is required by SWIS and the business layer.
  2. Verify that both the primary Orion server and any additional web servers (AWS) can reach port 17777 on the server with the specified IP address. To do this, open a command prompt on the primary server and the AWS and issue the following command:
    telnet <IP_address> <port_number>
answered Dec 2, 2020 by Gitika
• 65,770 points

Related Questions In Python

0 votes
1 answer

I have trained a model using machine learning algorithm in python , now i want to create a browser extension of that saved model , Is it possible ??

Hi@Shubham, It may possible. When you saved your ML ...READ MORE

answered Jun 13, 2020 in Python by MD
• 95,460 points
1,128 views
0 votes
1 answer

When I create and remove files rapidly on windows using python I get WindowsError (Error 5)

Here's the short answer: disable any antivirus or ...READ MORE

answered Aug 31, 2018 in Python by charlie_brown
• 7,720 points
1,912 views
0 votes
3 answers

i am installing wordcloud using pip but i am unable to do that ....i am getting the following error

word cloud is not supported for python ...READ MORE

answered Apr 15, 2020 in Python by anonymous
33,063 views
0 votes
1 answer

i write this python to read dataset into panda data frame but im getting NameError: name 'true' is not defined. Below is the code:

change  def parse(path):   g = gz ...READ MORE

answered Mar 15, 2020 in Python by Abhishek Shingadiya
3,661 views
0 votes
1 answer

I tried to install this pip cryptography in Pycharm but I'm getting an error

Hello @Dilpreet , Have you tried updating pip version? ...READ MORE

answered Aug 4, 2020 in Python by Niroj
• 82,840 points
3,363 views
0 votes
1 answer

I have created python chatbot using flask framework using yml file now i want to use json file what should i do now ?

Hello @golu , Try something like this: with open(yaml_file, 'r') ...READ MORE

answered Nov 19, 2020 in Python by Niroj
• 82,840 points
1,609 views
+2 votes
10 answers

How to fix this? ValueError: invalid literal for int() with base 10 error in Python

The following are totally acceptable in python: passing ...READ MORE

answered Nov 16, 2018 in Python by Nymeria
• 3,560 points
409,222 views
0 votes
1 answer

I want to download a file from the website by web scraping. Can anyone explain how to do this in jupyter lab (python) with an example?

Hey, Web scraping is a technique to automatically ...READ MORE

answered Apr 7, 2020 in Python by Gitika
• 65,770 points
2,388 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP