OSError: [Errno 113] No route to host

Hi,

I am trying to run the object detection model in Nvidia. Quite often I am getting the below error while executing detect.py model.

Could someone help me to resolve this issue?
Traceback (most recent call last):
File “/home/sgan/.local/lib/python3.6/site-packages/urllib3/connection.py”, line 160, in _new_conn
(self._dns_host, self.port), self.timeout, **extra_kw
File “/home/sgan/.local/lib/python3.6/site-packages/urllib3/util/connection.py”, line 84, in create_connection
raise err
File “/home/sgan/.local/lib/python3.6/site-packages/urllib3/util/connection.py”, line 74, in create_connection
sock.connect(sa)
OSError: [Errno 113] No route to host

During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “/home/sgan/.local/lib/python3.6/site-packages/urllib3/connectionpool.py”, line 677, in urlopen
chunked=chunked,
File “/home/sgan/.local/lib/python3.6/site-packages/urllib3/connectionpool.py”, line 381, in _make_request
self._validate_conn(conn)
File “/home/sgan/.local/lib/python3.6/site-packages/urllib3/connectionpool.py”, line 978, in _validate_conn
conn.connect()
File “/home/sgan/.local/lib/python3.6/site-packages/urllib3/connection.py”, line 309, in connect
conn = self._new_conn()
File “/home/sgan/.local/lib/python3.6/site-packages/urllib3/connection.py”, line 172, in _new_conn
self, “Failed to establish a new connection: %s” % e
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x7f302d6668>: Failed to establish a new connection: [Errno 113] No route to host
During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/home/sgan/.local/lib/python3.6/site-packages/requests/adapters.py”, line 449, in send
timeout=timeout
File “/home/sgan/.local/lib/python3.6/site-packages/urllib3/connectionpool.py”, line 727, in urlopen
method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
File “/home/sgan/.local/lib/python3.6/site-packages/urllib3/util/retry.py”, line 446, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host=‘internal.vantiq.com’, port=443): Max retries exceeded with url: /api/v1/resources/topics//camera/alert (Caused by NewConnectionError(‘<urllib3.connection.HTTPSConnection object at 0x7f302d6668>: Failed to establish a new connection: [Errno 113] No route to host’,))

Error Messages you have guide you need to check network configuration.
Could you find and connect the destination host on your Jetson Nano?

Hi,

This issue is caused from the firewall from the server side.
Could you check this error with ‘internal.vantiq.com’ first?

Thanks.

Hi,
I am able to ping the server all the time.
I was able to connect most of the times. Once in a while this issue happens. Please let me know which port or firewall seetings to be checked.

Thank you!

Thanks for the response. Please help me with the instructions.

Would you post your code to test?

Hi,

Max retries exceeded with url: /api/v1/resources/topics//camera/alert (Caused by NewConnectionError(’<urllib3.connection.HTTPSConnection object at 0x7f302d6668>: Failed to establish a new connection: [Errno 113] No route to host’,))

According to the error, it’s recommended to check the detail access limit to the server team first.
Thanks.

Just some additional information on this: Your DHCP will normally set up an address and a route. You could check what the following show during a failure:

ifconfig
route
iwconfig

If there is a route (either by default or by specification of a subnet), then DHCP will have provided this. If the route fails when provided, then perhaps the DHCP information has been updated and is no longer valid. If the route is not available, then there is probably something along the route hop which failed, e.g., hardware missing or firewall in the way. Once it is known that there is a route then most of what else might fail is completely out of the control of the Jetson.

You might want to give details on what kind of hardware is along the route, e.g., if this is all in some private network and goes through a router and switch to another local system, versus some public routing.

Thanks for your response. Sorry how to do that? could you please help with the instructions?

Thank you for your respomse.
Sorry just realized that the destination server ping also unreachable whenever I try to ping the destination server.

The application is able to send the data in to the destination server most of the time. Only few times It returns the no route to host error.

Do I need to verify any specific firewall setting? I checked UFW is not installed in my jetson. Please let me know if any specific port/ip address should be enabled. Thank you.

If you did not install UFW and intentionally enable the Jetson firewall, then there is nothing to worry about on the Jetson itself.

The router might have its own firewall, though most consumer router/modem devices only have a possibility of simple security. No modem would pass through traffic originating from the outside world and aimed at the Jetson because the modem would have on way to know the external traffic wants to reach the Jetson (versus any other computer on the inside). Router/modem devices know what to forward to which device and port if the internal traffic generated the response, but outside world logins do not provide enough information for the router/modem to know.

As such routers generally have an admin login and an ability to tell the modem/router itself that unknown incoming external traffic for a given port and protocol should be forwarded to a specific inside computer. For example, the modem would have some method to know to always forward unknown port 22 TCP traffic to a given device on the inside. Instructions for doing so are custom to every different brand and model of router/modem, and always requires admin login ability to change this setup.

Keep in mind that ping addresses and ssh addresses, when arriving from the outside world and trying to reach a computer on the inside of the router/modem, are for the modem itself. Your ISP issues only one IP address, and this is your modem’s. Internal IP addresses can’t be pinged from the outside world.

  • Do you know your router/modem’s IP address?
  • Do you have admin access to the router/modem?

If you do, then your modem could be told to forward port 22 TCP to the internal IP address of the Jetson. Often people will tell you to use some other port on the outside, e.g., port 8000 has no definition, so you could have port 8000 TCP of the outside world forwarded to port 22 of the Jetson. The reason for using unassigned ports in the outside world is that almost every bot intended to break in will constantly bombard port 22; if the port is 8000 they might do something after scanning, but there will be a much lower amount of exploit traffic directed against port 8000 versus that of 22. Your ssh client can just name the alternate port 8000, and then otherwise operate normally. However, I’d advise keeping it simple with port 22 TCP while testing. Make sure you have good passwords.