Unable to access HAOS for long periods of time

I have HAOS installed on a ADATA 256GB SU750 attached to RPI4b using a StarTech.com USB 3.0 to 2.5" SATA III Hard Drive Adapter Cable w/UASP via a powered USB 3 hub. RPI4 is powered via a CanaKit 3.5A adapter.

I lose connection to the HAOS, during which times I can ping the rpi4 but can’t access the HAOS homepage. Even add-ons are inaccessible
If I restart just the rpi4 HAOS starts normally and remains accessible for a few hours.

which logs I should look at to find the cause of this?

image

Can you ssh in during this period?

What is a “long period of time”?

What ports are open?

nmap 192.168.18.whyareyouhidingthisnoonecares -p0-65535
1 Like

:joy:

output in windows


C:\>nmap 192.168.18.200 -p0-65535
'nmap' is not recognized as an internal or external command,
operable program or batch file.

C:\>

Long periods up to 6 to 12 hours or when I restart RPI4 manually by unplugging it’s power supply (during which the SSD is still on bcz it is being powered by the powered USB Hub)

==============
This graph illustrates the problem. Last increase when I restarted manually.

==========
output from the nmap command on HAOS terminal

➜  ~ nmap 192.168.18.200 -p0-65535                                                                                                                                                                       │5
Starting Nmap 7.92 ( https://nmap.org ) at 2022-11-10 12:20 PKT                                                                                                                                          │➜
Nmap scan report for 192.168.18.200                                                                                                                                                                      │ 
Host is up (0.000056s latency).                                                                                                                                                                          │ 
Not shown: 65509 closed tcp ports (reset)                                                                                                                                                                │~
PORT      STATE    SERVICE                                                                                                                                                                               │ 
22/tcp    open     ssh                                                                                                                                                                                   │n
53/tcp    open     domain                                                                                                                                                                                │m
139/tcp   open     netbios-ssn                                                                                                                                                                           │a
445/tcp   open     microsoft-ds                                                                                                                                                                          │p
1627/tcp  filtered t128-gateway                                                                                                                                                                          │ 
1883/tcp  open     mqtt                                                                                                                                                                                  │1
4357/tcp  filtered qsnet-cond                                                                                                                                                                            │9
4370/tcp  open     elpro_tunnel                                                                                                                                                                          │2
5355/tcp  open     llmnr                                                                                                                                                                                 │.
5369/tcp  open     unknown                                                                                                                                                                               │1
5541/tcp  open     unknown                                                                                                                                                                               │6
8080/tcp  filtered http-proxy                                                                                                                                                                            │8
8083/tcp  open     us-srv                                                                                                                                                                                │.
8086/tcp  filtered d-s-n                                                                                                                                                                                 │1
8123/tcp  open     polipo                                                                                                                                                                                │8
8754/tcp  filtered unknown                                                                                                                                                                               │.
9993/tcp  open     palace-2                                                                                                                                                                              │2
18083/tcp open     unknown                                                                                                                                                                               │0
30001/tcp filtered pago-services1                                                                                                                                                                        │0
30002/tcp filtered pago-services2                                                                                                                                                                        │ 
30003/tcp filtered amicon-fpsu-ra                                                                                                                                                                        │-
30004/tcp filtered amicon-fpsu-s                                                                                                                                                                         │p
30006/tcp filtered unknown                                                                                                                                                                               │0
40000/tcp open     safetynetp                                                                                                                                                                            │-
45545/tcp open     unknown                                                                                                                                                                               │6
58540/tcp open     unknown                                                                                                                                                                               │5
64236/tcp open     unknown                                                                                                                                                                               │5
                                                                                                                                                                                                         │3
Nmap done: 1 IP address (1 host up) scanned in 15.98 seconds      

Try it from a proper OS.

Noooooooo

Also nmap shows all ports are up, but that’s when you have access. I was interested in when you try it from another computer when you don’t have access.

Also you didn’t answer the ssh question?

SSH via Linux to HAOS?
SSH from Windows seems to be working but I got access back too while I was trying to SSH and trying to nmap from windows .

C:\Program Files (x86)\Nmap>nmap 192.168.18.200 -p0-65535
Starting Nmap 7.93 ( https://nmap.org ) at 2022-11-11 10:50 Pakistan Standard Time
Nmap scan report for 192.168.18.200
Host is up (0.0033s latency).
Not shown: 65510 closed tcp ports (reset)
PORT      STATE    SERVICE
22/tcp    open     ssh
53/tcp    open     domain
139/tcp   open     netbios-ssn
445/tcp   open     microsoft-ds
1883/tcp  open     mqtt
4357/tcp  filtered qsnet-cond
4370/tcp  open     elpro_tunnel
5355/tcp  open     llmnr
5369/tcp  open     unknown
5541/tcp  open     unknown
8080/tcp  open     http-proxy
8081/tcp  open     blackice-icecap
8083/tcp  open     us-srv
8086/tcp  open     d-s-n
8123/tcp  open     polipo
8754/tcp  open     unknown
9993/tcp  open     palace-2
18083/tcp open     unknown
30001/tcp open     pago-services1
30002/tcp open     pago-services2
30003/tcp open     amicon-fpsu-ra
30004/tcp open     amicon-fpsu-s
30006/tcp open     unknown
40000/tcp open     safetynetp
45545/tcp open     unknown
64236/tcp open     unknown
MAC Address: xxxxxxxxxxxxxxxxxxx (Raspberry Pi Trading)

Nmap done: 1 IP address (1 host up) scanned in 42.70 seconds

see just got my access back.

After you restart HA because of a problem, have a look at the bottom of home-assistant.log.1, which is the previous log file. It might give you a clue as to what is going on.

Alternatively (and probably only as a last resort), if you have a separate linux-based system that has ‘journalctl’ installed, you can open up port 22222 (see here and after reading the caveats), SSH on this port to HA, and use the following commands:

journalctl --list-boots
journalctl -b (number) -e

The first command will give you a list of reboots, where the first column is the number for the second command (0, -1, -2, etc). The second command shows you the log for that boot. When I tried it, it didn’t paginate like journalctl normally does, but you can append " -n 100" to the command (for example) to show 100 lines. Although given you know the time it stopped working you may have more luck by substituting a short time range into the following command:

journalctl --since "2022-11-11 04:00:00" --until "2022-11-11 04:01:00"

this log I have to look at?

Yes. Anything interesting at the bottom?

There is no point in running the nmap command unless

  1. You run it from another computer; and

  2. You do it when you have the problem.

Cant access it right now but this is the output. can’t SSH even

C:\Program Files (x86)\Nmap>nmap 192.168.18.200 -p0-65535
Starting Nmap 7.93 ( https://nmap.org ) at 2022-11-11 21:59 Pakistan Standard Time
Nmap scan report for 192.168.18.200
Host is up (0.0050s latency).
Not shown: 65509 closed tcp ports (reset)
PORT      STATE SERVICE
22/tcp    open  ssh
53/tcp    open  domain
139/tcp   open  netbios-ssn
445/tcp   open  microsoft-ds
1883/tcp  open  mqtt
4357/tcp  open  qsnet-cond
4370/tcp  open  elpro_tunnel
5355/tcp  open  llmnr
5369/tcp  open  unknown
5541/tcp  open  unknown
8080/tcp  open  http-proxy
8081/tcp  open  blackice-icecap
8083/tcp  open  us-srv
8086/tcp  open  d-s-n
8123/tcp  open  polipo
8754/tcp  open  unknown
9993/tcp  open  palace-2
10000/tcp open  snet-sensor-mgmt
18083/tcp open  unknown
30001/tcp open  pago-services1
30002/tcp open  pago-services2
30003/tcp open  amicon-fpsu-ra
30004/tcp open  amicon-fpsu-s
30006/tcp open  unknown
40000/tcp open  safetynetp
45545/tcp open  unknown
64236/tcp open  unknown
MAC Address: xxxxxxxxxxxxxxxxx (Raspberry Pi Trading)

Nmap done: 1 IP address (1 host up) scanned in 43.19 seconds

This is strange everything gets turned off when this happens




Found only this error

2022-11-12 08:35:07.537 ERROR (SyncWorker_4) [homeassistant.components.tomato.device_tracker] Connection to the router timed out
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 449, in _make_request
    six.raise_from(e, None)
  File "<string>", line 3, in raise_from
  File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 444, in _make_request
    httplib_response = conn.getresponse()
  File "/usr/local/lib/python3.10/http/client.py", line 1374, in getresponse
    response.begin()
  File "/usr/local/lib/python3.10/http/client.py", line 318, in begin
    version, status, reason = self._read_status()
  File "/usr/local/lib/python3.10/http/client.py", line 279, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
  File "/usr/local/lib/python3.10/socket.py", line 705, in readinto
    return self._sock.recv_into(b)
TimeoutError: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/requests/adapters.py", line 489, in send
    resp = conn.urlopen(
  File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 787, in urlopen
    retries = retries.increment(
  File "/usr/local/lib/python3.10/site-packages/urllib3/util/retry.py", line 550, in increment
    raise six.reraise(type(error), error, _stacktrace)
  File "/usr/local/lib/python3.10/site-packages/urllib3/packages/six.py", line 770, in reraise
    raise value
  File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 703, in urlopen
    httplib_response = self._make_request(
  File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 451, in _make_request
    self._raise_timeout(err=e, url=url, timeout_value=read_timeout)
  File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 340, in _raise_timeout
    raise ReadTimeoutError(
urllib3.exceptions.ReadTimeoutError: HTTPConnectionPool(host='192.168.18.xxxx', port=80): Read timed out. (read timeout=3)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/tomato/device_tracker.py", line 106, in _update_tomato_info
    response = requests.Session().send(self.req, timeout=3)
  File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 701, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/requests/adapters.py", line 578, in send
    raise ReadTimeout(e, request=request)
requests.exceptions.ReadTimeout: HTTPConnectionPool(host='192.168.18.xxxxx', port=80): Read timed out. (read timeout=3)

I have disabled tomato device tracker from integration but still this shows up.

2022-11-14 07:44:59.672 ERROR (SyncWorker_8) [homeassistant.components.tomato.device_tracker] Connection to the router timed out
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 449, in _make_request
    six.raise_from(e, None)
  File "<string>", line 3, in raise_from
  File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 444, in _make_request
    httplib_response = conn.getresponse()
  File "/usr/local/lib/python3.10/http/client.py", line 1374, in getresponse
    response.begin()
  File "/usr/local/lib/python3.10/http/client.py", line 318, in begin
    version, status, reason = self._read_status()
  File "/usr/local/lib/python3.10/http/client.py", line 279, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
  File "/usr/local/lib/python3.10/socket.py", line 705, in readinto
    return self._sock.recv_into(b)
TimeoutError: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/requests/adapters.py", line 489, in send
    resp = conn.urlopen(
  File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 787, in urlopen
    retries = retries.increment(
  File "/usr/local/lib/python3.10/site-packages/urllib3/util/retry.py", line 550, in increment
    raise six.reraise(type(error), error, _stacktrace)
  File "/usr/local/lib/python3.10/site-packages/urllib3/packages/six.py", line 770, in reraise
    raise value
  File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 703, in urlopen
    httplib_response = self._make_request(
  File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 451, in _make_request
    self._raise_timeout(err=e, url=url, timeout_value=read_timeout)
  File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 340, in _raise_timeout
    raise ReadTimeoutError(
urllib3.exceptions.ReadTimeoutError: HTTPConnectionPool(host='192.168.18.xxx', port=80): Read timed out. (read timeout=3)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/tomato/device_tracker.py", line 106, in _update_tomato_info
    response = requests.Session().send(self.req, timeout=3)
  File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 701, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/requests/adapters.py", line 578, in send
    raise ReadTimeout(e, request=request)
requests.exceptions.ReadTimeout: HTTPConnectionPool(host='192.168.18.xxx', port=80): Read timed out. (read timeout=3)

and third day

2022-11-14 22:44:05.964 INFO (SyncWorker_5) [homeassistant.components.tomato.device_tracker] Scanning
2022-11-14 22:44:12.344 DEBUG (MainThread) [custom_components.hacs] Nothing in the queue
2022-11-14 22:44:17.965 INFO (SyncWorker_5) [homeassistant.components.tomato.device_tracker] Scanning
2022-11-14 22:44:20.608 ERROR (MainThread) [custom_components.localtuya.common] [352...65a] Connect to 192.168.18.116 failed
Traceback (most recent call last):
  File "/config/custom_components/localtuya/common.py", line 186, in _make_connection
    self._interface = await pytuya.connect(
  File "/config/custom_components/localtuya/pytuya/__init__.py", line 704, in connect
    _, protocol = await loop.create_connection(
  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 1064, in create_connection
    raise exceptions[0]
  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 1049, in create_connection
    sock = await self._connect_sock(
  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 960, in _connect_sock
    await self.sock_connect(sock, address)
  File "/usr/local/lib/python3.10/asyncio/selector_events.py", line 500, in sock_connect
    return await fut
  File "/usr/local/lib/python3.10/asyncio/selector_events.py", line 535, in _sock_connect_cb
    raise OSError(err, f'Connect call failed {address}')
OSError: [Errno 113] Connect call failed ('192.168.18.116', 6668)