Error errno 113 no route to host

I have 2 computers on the same LAN. The first PC has an ip address 192.168.178.30, the other PC has an ip address 192.168.178.26. Ping, traceroute, telnet, ssh, everything works between the two PCs...

I have 2 computers on the same LAN. The first PC has an ip address 192.168.178.30, the other PC has an ip address 192.168.178.26.
Ping, traceroute, telnet, ssh, everything works between the two PCs. Both PCs run the same OS — CentOS 7 and both PCs have the same python version 2.7.5 (checked with the python -V command).

I copied simple python code from a computer networking book.

client.py

from socket import *
serverName = '192.168.178.30'
serverPort = 12000
clientSocket = socket(AF_INET, SOCK_STREAM)
clientSocket.connect((serverName,serverPort))
sentence = raw_input('Input lowercase sentence: ')
clientSocket.send(sentence)
modifiedSentence = clientSocket.recv(1024)
print 'From Server:', modifiedSentence
clientSocket.close()

server.py

from socket import *
serverPort = 12000
serverSocket = socket(AF_INET,SOCK_STREAM)
serverSocket.bind(('192.168.178.30',serverPort))
serverSocket.listen(5)
print 'The server is ready to receive'
while 1:
       connectionSocket, addr = serverSocket.accept()
       sentence = connectionSocket.recv(1024)
       capitalizedSentence = sentence.upper()
       connectionSocket.send(capitalizedSentence)
       connectionSocket.close()

The code works when it is ran on the same PC (where the server is listening on localhost).
When I run the client code on one PC and the server code on the other PC I get this error on the client side.

Traceback (most recent call last):
  File "client.py", line 5, in <module>
    clientSocket.connect((serverName,serverPort))
  File "/usr/lib64/python2.7/socket.py", line 224, in meth
    return getattr(self._sock,name)(*args)
socket.error: [Errno 113] No route to host

Can someone help?

Содержание

  1. Running example yields: urllib.error.URLError: #1364
  2. Comments
  3. 1. What you did:
  4. 2. What you observed:
  5. 3. What you expected, if not obvious.
  6. 4. Your environment:
  7. Ошибка urlopen [Errno 110] с https и python 2.7 на ubuntu 12.10
  8. Flutter try catch can’t catch SocketException ( Exception has occurred. SocketException (SocketException: OS Error: No route to host, errno = 113) #551
  9. Comments
  10. urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 113] No route to host #836
  11. Comments

Running example yields: urllib.error.URLError: #1364

If you’re asking about an unexpected problem which you do not know the root cause,
use this template. PLEASE DO NOT DELETE THIS TEMPLATE, FILL IT:

If you already know the root cause to your problem,
feel free to delete everything in this template.

1. What you did:

(1) run:** ./imagenet-resnet.py —data ../../../data/ILSVRC2012/ -d 50 —load ImageNet-ResNet18.npz —eval

2. What you observed:

(1) Include the ENTIRE logs here:

OpenCV is built with OpenMP support. This usually results in poor performance. For details, see https://github.com/tensorpack/benchmarks/blob/master/ImageNet/benchmark-opencv-resize.py
/home/pqdung/.conda/envs/pqdung/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:458: FutureWarning: Passing (type, 1) or ‘1type’ as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / ‘(1,)type’.
_np_qint8 = np.dtype([(«qint8», np.int8, 1)])
/home/pqdung/.conda/envs/pqdung/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:459: FutureWarning: Passing (type, 1) or ‘1type’ as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / ‘(1,)type’.
_np_quint8 = np.dtype([(«quint8», np.uint8, 1)])
/home/pqdung/.conda/envs/pqdung/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:460: FutureWarning: Passing (type, 1) or ‘1type’ as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / ‘(1,)type’.
_np_qint16 = np.dtype([(«qint16», np.int16, 1)])
/home/pqdung/.conda/envs/pqdung/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:461: FutureWarning: Passing (type, 1) or ‘1type’ as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / ‘(1,)type’.
_np_quint16 = np.dtype([(«quint16», np.uint16, 1)])
/home/pqdung/.conda/envs/pqdung/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:462: FutureWarning: Passing (type, 1) or ‘1type’ as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / ‘(1,)type’.
_np_qint32 = np.dtype([(«qint32», np.int32, 1)])
/home/pqdung/.conda/envs/pqdung/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:465: FutureWarning: Passing (type, 1) or ‘1type’ as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / ‘(1,)type’.
np_resource = np.dtype([(«resource», np.ubyte, 1)])
[1119 16:59:15 @ilsvrc.py:128] [ILSVRC12] Assuming directory ../../../data/ILSVRC2012/val has ‘original’ structure.
[1119 16:59:15 @fs.py:101] WRN Env var $TENSORPACK_DATASET not set, using /home/pqdung/tensorpack_data for datasets.
caffe_ilsvrc12.tar.gz: 0.00B [00:35, ?B/s]
[1119 16:59:50 @fs.py:64] ERR Failed to download http://dl.caffe.berkeleyvision.org/caffe_ilsvrc12.tar.gz
Traceback (most recent call last):
File «/home/pqdung/.conda/envs/pqdung/lib/python3.6/urllib/request.py», line 1318, in do_open
encode_chunked=req.has_header(‘Transfer-encoding’))
File «/home/pqdung/.conda/envs/pqdung/lib/python3.6/http/client.py», line 1239, in request
self._send_request(method, url, body, headers, encode_chunked)
File «/home/pqdung/.conda/envs/pqdung/lib/python3.6/http/client.py», line 1285, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File «/home/pqdung/.conda/envs/pqdung/lib/python3.6/http/client.py», line 1234, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File «/home/pqdung/.conda/envs/pqdung/lib/python3.6/http/client.py», line 1026, in _send_output
self.send(msg)
File «/home/pqdung/.conda/envs/pqdung/lib/python3.6/http/client.py», line 964, in send
self.connect()
File «/home/pqdung/.conda/envs/pqdung/lib/python3.6/http/client.py», line 936, in connect
(self.host,self.port), self.timeout, self.source_address)
File «/home/pqdung/.conda/envs/pqdung/lib/python3.6/socket.py», line 724, in create_connection
raise err
File «/home/pqdung/.conda/envs/pqdung/lib/python3.6/socket.py», line 713, 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 «./imagenet-resnet.py», line 138, in
ds = get_imagenet_dataflow(args.data, ‘val’, batch)
File «/home/pqdung/project/tensorpack/examples/ResNet/imagenet_utils.py», line 96, in get_imagenet_dataflow
ds = dataset.ILSVRC12Files(datadir, name, shuffle=False)
File «/home/pqdung/.conda/envs/pqdung/lib/python3.6/site-packages/tensorpack/dataflow/dataset/ilsvrc.py», line 159, in init
meta = ILSVRCMeta(meta_dir)
File «/home/pqdung/.conda/envs/pqdung/lib/python3.6/site-packages/tensorpack/dataflow/dataset/ilsvrc.py», line 32, in init
self._download_caffe_meta()
File «/home/pqdung/.conda/envs/pqdung/lib/python3.6/site-packages/tensorpack/dataflow/dataset/ilsvrc.py», line 56, in _download_caffe_meta
fpath = download(CAFFE_ILSVRC12_URL[0], self.dir, expect_size=CAFFE_ILSVRC12_URL[1])
File «/home/pqdung/.conda/envs/pqdung/lib/python3.6/site-packages/tensorpack/utils/fs.py», line 60, in download
fpath, _ = urllib.request.urlretrieve(url, fpath, reporthook=hook(t))
File «/home/pqdung/.conda/envs/pqdung/lib/python3.6/urllib/request.py», line 248, in urlretrieve
with contextlib.closing(urlopen(url, data)) as fp:
File «/home/pqdung/.conda/envs/pqdung/lib/python3.6/urllib/request.py», line 223, in urlopen
return opener.open(url, data, timeout)
File «/home/pqdung/.conda/envs/pqdung/lib/python3.6/urllib/request.py», line 526, in open
response = self._open(req, data)
File «/home/pqdung/.conda/envs/pqdung/lib/python3.6/urllib/request.py», line 544, in _open
‘_open’, req)
File «/home/pqdung/.conda/envs/pqdung/lib/python3.6/urllib/request.py», line 504, in _call_chain
result = func(*args)
File «/home/pqdung/.conda/envs/pqdung/lib/python3.6/urllib/request.py», line 1346, in http_open
return self.do_open(http.client.HTTPConnection, req)
File «/home/pqdung/.conda/envs/pqdung/lib/python3.6/urllib/request.py», line 1320, in do_open
raise URLError(err)
urllib.error.URLError:

(2) Other observations, if any:
For example, CPU/GPU utilization, output images, tensorboard curves, if relevant to your issue.

3. What you expected, if not obvious.

If you expect the model to work better, only in one of the two conditions can we help with it:
(1) You’re unable to reproduce the results documented in tensorpack examples.
(2) It appears to be a tensorpack bug.

Otherwise, how to train a good model on your task or your
modifications is a machine learning question.
We do not answer machine learning questions and it is your responsibility to
figure out how to make your models more accurate.

4. Your environment:

Paste the output of this command: python -c ‘import tensorpack.tfutils as u; print(u.collect_env_info())’
If this command failed, tell us your version of Python/TF/tensorpack.

  • You can install Tensorpack master by pip install -U git+https://github.com/ppwwyyxx/tensorpack.git
    and see if your issue is already solved.
  • If you’re not using tensorpack under a normal command line shell (e.g.,
    using an IDE or jupyter notebook), please retry under a normal command line shell.

You may often want to provide extra information related to your issue, but
at the minimum please try to provide the above information accurately to save effort in the investigation.

The text was updated successfully, but these errors were encountered:

Источник

Ошибка urlopen [Errno 110] с https и python 2.7 на ubuntu 12.10

Заранее благодарим за предоставленную помощь.

Я на ubuntu 12.10 с установленным python 2.7. Я написал простой script на основе других сообщений для проверки соединений http и https:

Тест с http работает нормально, но с https производит следующий вывод:

Вот моя настройка:

Я видел в аналогичные более старые сообщения для восстановления python из источника с установленным openssl. Я надеюсь, что есть другое решение моей проблемы, так как это гораздо более новая версия ubuntu/python, и openssl уже включен в систему.

Любые указатели оценили.

Примечание. Настройка HTTPS_PROXY в среде изменила сообщение об ошибке на следующее (от номера ошибки от 110 до 113):

Btw, также не выполняется следующее:

Не уверен, что я могу что-то сделать, чтобы решить эту проблему.

URLError: ошибка urlopen [Errno 113] Нет маршрута к хосту

У меня была такая же ошибка: я хотел удаленно выполнить некоторые сценарии на машине B с машины A (что делает некоторые вещи для автоматизации браузера), и, наконец, я получил ошибку, как указано выше, позже я отключил настройку брандмауэра для HTTPS.

Как я отключил установку огневой стены на RHEL6.4?
— нажмите настройки (в левой части панели) > Администрирование > Брандмауэp > в окне «Настройка брандмауэра»: проверьте «безопасный WWW (HTTPS)» — (вам нужно быть пользователем root) → нажмите «Применить» → нажмите кнопка отключения.

позже я смог выполнить скрипты на удаленной машине B без каких-либо проблем.

Источник

Flutter try catch can’t catch SocketException ( Exception has occurred. SocketException (SocketException: OS Error: No route to host, errno = 113) #551

Exception has occurred.
SocketException (SocketException: OS Error: No route to host, errno = 113, address = 10.162.18.32, port = 60208)

THE same URL is accessible from the testing phone, Postman.
also tried with

Still, Exception is not handled.

The text was updated successfully, but these errors were encountered:

same here:
flutter: SocketException: Connection failed (OS Error: Network is unreachable, errno = 51), address = 192.168.4.1, port = 80
though it’s accessible from my phone’s google chrome.

tested on stable, dev, and master channels.
using latest package release

I also had a similar problem in case the server still hasn’t started.
App crash right at this line of code

If it could catch the exception and proceed logically instead of crashing the app then maybe better.

If it could catch the exception and proceed logically instead of crashing the app then maybe better.

so is there is a workaround?

@EgHubs how did it workaround??

Iam asking if you solved it.

I still haven’t solved it yet 😅

I got a similar issue when using http.post and my test server is not running.

At least for my issue, it seems like IOClient is only catching HttpException s but somewhere in HttpClient.openUrl a SocketException can be thrown.

But I use some async code to catch the error and don’t have issues with this; maybe worth trying for others with issues

I also encountered this with a socket exception. Quite frustrating.
SocketException: OS Error: Connection timed out, errno = 110, address = 192.168.0.1, port = 37694

I should clarify that I’m not just getting a random socket exception — the method I’m calling that contains my http.get method is throwing a socket exception and then exiting the method without falling to any catch blocks.

Like flo80 said, this happens when the server in question is offline, meaning no response is possible.

Источник

urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 113] No route to host #836

I often have this error, but script works :

GET http://x.x.x.x:9200/_nodes/_all/http [status:N/A request:2.992s]
Traceback (most recent call last):
File «/usr/lib/python3.6/site-packages/urllib3/connection.py», line 171, in _new_conn
(self._dns_host, self.port), self.timeout, **extra_kw)
File «/usr/lib/python3.6/site-packages/urllib3/util/connection.py», line 79, in create_connection
raise err
File «/usr/lib/python3.6/site-packages/urllib3/util/connection.py», line 69, 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 «/usr/lib/python3.6/site-packages/elasticsearch/connection/http_urllib3.py», line 172, in perform_request
response = self.pool.urlopen(method, url, body, retries=Retry(False), headers=request_headers, **kw)
File «/usr/lib/python3.6/site-packages/urllib3/connectionpool.py», line 638, in urlopen
_stacktrace=sys.exc_info()[2])
File «/usr/lib/python3.6/site-packages/urllib3/util/retry.py», line 343, in increment
raise six.reraise(type(error), error, _stacktrace)
File «/usr/lib/python3.6/site-packages/urllib3/packages/six.py», line 686, in reraise
raise value
File «/usr/lib/python3.6/site-packages/urllib3/connectionpool.py», line 600, in urlopen
chunked=chunked)
File «/usr/lib/python3.6/site-packages/urllib3/connectionpool.py», line 354, in _make_request
conn.request(method, url, **httplib_request_kw)
File «/usr/lib64/python3.6/http/client.py», line 1239, in request
self._send_request(method, url, body, headers, encode_chunked)
File «/usr/lib64/python3.6/http/client.py», line 1285, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File «/usr/lib64/python3.6/http/client.py», line 1234, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File «/usr/lib64/python3.6/http/client.py», line 1026, in _send_output
self.send(msg)
File «/usr/lib64/python3.6/http/client.py», line 964, in send
self.connect()
File «/usr/lib/python3.6/site-packages/urllib3/connection.py», line 196, in connect
conn = self._new_conn()
File «/usr/lib/python3.6/site-packages/urllib3/connection.py», line 180, in _new_conn
self, «Failed to establish a new connection: %s» % e)
urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 113] No route to host

The text was updated successfully, but these errors were encountered:

It sounds like there might be some problem in the connection between your python program and your Elasticsearch cluster.

Unfortunately I can’t offer any advice here because there’s not enough information.

How many nodes are in your cluster. Do you have them sitting behind a proxy or not? are you using x-pack or not? are you using a hosted service or hosting it your self.

There’s a lot of factors here going on that can cause HTTP connection errors.

Any more info would be helpful.

@laurentvv thanks for that. This is helpful.

My next question is you say you have 3 nodes, 3 VM’s. Where are those VM’s running? Are they all on one computer? On 3 computers? In a data center? On your desk?

On a related note:

If you use curl instead of the python client. Do you experience similar errors?

the error you’re getting is a result of a network connection or firewall rule or something.
It is actually not an error related to

  1. Elasticsearch
  2. Elasticsearch-py (this library)

This error is coming from urllib3. And the reason you’re getting this error is because python can not make a connection to the HTTP host it’s trying to connect to.

If we take out Elasticsearch and Elasticsearch-py. This error happens because a python process using URLlib3 can not connect to a networked host.

This is why I asked all the questions, because somewhere you have a network configuration that’s causing the python process to not be able to connect to a host in your cluster. It could be related to anything from the VM firewall rules, the host firewall rules, the data center firewall rules, routers, etc..

Источник

Выводит ошибку в логе «Нет маршрута для размещения»

error.log:

2017/12/15 10:49:12 [error] 377#377: *6 connect() failed (113: No route to host) while connecting to upstream, client: 10.12.4.5, server: 10.12.4.245, request: "GET /favicon.ico HTTP/1.1", upstream: "http://10.12.4.245:80/favicon.ico", host: "10.12.4.242", referrer: "http://10.12.4.242/"

Помогите пожалуйста кто сможет, что я не так настроил?

nginx.conf:

upstream puma {
  server unix:///home/solovievga/phonebook-api/tmp/sockets/puma.sock;
}
server {
listen   80 default;
listen   [::]:80 default ipv6only=on;

server_name 10.12.4.245;
root /home/solovievga/phonebook-api;

location / {
root /home/solovievga/phonebook-api/phonebook-app/dist;
index index.html index.htm;
        try_files $uri @app;
        gzip_static on;
        expires max;
        proxy_read_timeout 150;
        add_header Cache-Control public;
  }


  try_files $uri/index.html $uri @puma;
  location @puma {
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;
    proxy_redirect off;
    proxy_pass http://puma;
  }
   location @app {
     proxy_pass        http://10.12.4.245;
     proxy_set_header  X-Real-IP  $remote_addr;
     proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
     proxy_set_header  X-Forwarded-Proto http;
     proxy_set_header  Host $http_host  ;
     proxy_redirect    off;
     proxy_next_upstream error timeout invalid_header http_502;
    }

  client_max_body_size 50M;
  keepalive_timeout 10;
}

Sentry Issue: THOTH-3Q1

ConnectionError: HTTPConnectionPool(host='result-api', port=80): Max retries exceeded with url: /api/v1/subgraph-check?package_name=cliquet&package_version=1.1.3&index_url=https%3A%2F%2Fpypi.org%2Fsimple (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f0f439f2cc0>: Failed to establish a new connection: [Errno 113] No route to host',))
(11 additional frame(s) were not displayed)
...
  File "requests/api.py", line 75, in get
    return request('get', url, params=params, **kwargs)
  File "requests/api.py", line 60, in request
    return session.request(method=method, url=url, **kwargs)
  File "requests/sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
  File "requests/sessions.py", line 646, in send
    r = adapter.send(request, **kwargs)
  File "requests/adapters.py", line 516, in send
    raise ConnectionError(e, request=request)

MaxRetryError: HTTPConnectionPool(host='result-api', port=80): Max retries exceeded with url: /api/v1/subgraph-check?package_name=cliquet&package_version=1.1.3&index_url=https%3A%2F%2Fpypi.org%2Fsimple (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f0f439f2cc0>: Failed to establish a new connection: [Errno 113] No route to host',))
  File "requests/adapters.py", line 449, in send
    timeout=timeout
  File "urllib3/connectionpool.py", line 638, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "urllib3/util/retry.py", line 398, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))

NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f0f439f2cc0>: Failed to establish a new connection: [Errno 113] No route to host
(4 additional frame(s) were not displayed)
...
  File "http/client.py", line 1234, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "http/client.py", line 1026, in _send_output
    self.send(msg)
  File "http/client.py", line 964, in send
    self.connect()
  File "urllib3/connection.py", line 181, in connect
    conn = self._new_conn()
  File "urllib3/connection.py", line 168, in _new_conn
    self, "Failed to establish a new connection: %s" % e)

OSError: [Errno 113] No route to host
  File "urllib3/connection.py", line 159, in _new_conn
    (self._dns_host, self.port), self.timeout, **extra_kw)
  File "urllib3/util/connection.py", line 80, in create_connection
    raise err
  File "urllib3/util/connection.py", line 70, in create_connection
    sock.connect(sa)

I am trying to mount hdfs on my local machine(ubuntu) using nfs by following the below link:—

https://www.cloudera.com/documentation/enterprise/5-2-x/topics/cdh_ig_nfsv3_gateway_configure.html#xd_583c10bfdbd326ba--6eed2fb8-14349d04bee--7ef4

So,at my machine I installed nfs-common using:-

sudo apt-get install nfs-common

Then,before mounting I have ran these commands:-

rpcinfo -p 192.168.170.52
program vers proto   port  service
100000    4   tcp    111  portmapper
100000    3   tcp    111  portmapper
100000    2   tcp    111  portmapper
100000    4   udp    111  portmapper
100000    3   udp    111  portmapper
100000    2   udp    111  portmapper
100024    1   udp  48435  status
100024    1   tcp  54261  status
100005    1   udp   4242  mountd
100005    2   udp   4242  mountd
100005    3   udp   4242  mountd
100005    1   tcp   4242  mountd
100005    2   tcp   4242  mountd
100005    3   tcp   4242  mountd
100003    3   tcp   2049  nfs

showmount -e 192.168.170.52
Export list for 192.168.170.52:
/ *

after that i tried mounting the hdfs using:—

sudo mount -t nfs  -o vers=3,proto=tcp,nolock 192.168.170.52:/ /mnt/hdfs_mount/

But i was getting this error:—

mount.nfs: mount system call failed

Then i googled for the problem and installed nfs-kernel-server,portmap using

sudo apt-get install nfs-kernel-server portmap

After executing the above command,the output for:—

rpcinfo -p 192.168.170.52

is:—

192.168.170.52: RPC: Port mapper failure - Unable to receive: errno 113 (No route to host)

and for

showmount -e 192.168.170.52

is:—

clnt_create: RPC: Port mapper failure - Unable to receive: errno 113 (No route to host)

Also the output for:—

sudo service nfs start

comes out to be:—

Failed to start nfs.service: Unit nfs.service not found.

Please help me with this.

Понравилась статья? Поделить с друзьями:

Читайте также:

  • Error enoent no such file or directory scandir
  • Error enoent no such file or directory open etc ksc web console setup json
  • Error enoent no such file or directory lstat index pug
  • Error english cover
  • Error endl was not declared in this scope

  • 0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии