[Resolved] LanManager: timeout error

Hello,

I’m encountering a configuration issue similar to what was reported here:

Before 4.40 or 4.39 (I can’t remember) … I used to have devices detected.

I removed all the devices detected up to that point thinking it would start working, but no.

The error:
2024-05-21T19:25:45+0200 \u003cerror\u003e lan-manager.scan.js:58 (NmapScan.onError) LANManager fails to discover devices over network - Over scan timeout 120000

I’m on v4.41.0 — I took the liberty of testing with a higher timeout by modifying it directly in the container.

I think I have a problem that’s not application-related because on my container I get an nmap result in 3s:

rpi3:~/gladys $ docker exec -it gladys sh
/src/server # nmap -sn -R 192.168.0.xxx/24
Starting Nmap 7.94 ( https://nmap.org ) at 2024-05-21 19:27 CEST
[...]
Nmap done: 256 IP addresses (24 hosts up) scanned in 3.30 seconds

The Docker container is run with privileged = true …

The OS:

rpi3:~/$ uname -a
Linux rpi3 6.6.20+rpt-rpi-v7 #1 SMP Raspbian 1:6.6.20-1+rpt1 (2024-03-07) armv7l GNU/Lin
rpi3:~/$ lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description:    Raspbian GNU/Linux 12 (bookworm)
Release:        12
Codename:       bookworm

On a dev instance, I don’t encounter the issue (provided I run the server as root, due to nmap permission issues…)

I can’t really understand it; if anyone has leads to help me I’m all ears :wink:

I just did a quick test like that: on a Debian VM with the same Docker Compose it works …

lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 12 (bookworm)
Release:        12
Codename:       bookworm

uname -a
Linux Debian12 6.1.0-12-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.52-1 (2023-09-07) x86_64 GNU/Linux

The only difference is that it’s on a fresh instance … (DB at 0) .. just in case I rebooted the prod Pi 3 but it doesn’t change anything.

My production DB dates from … (no idea - start of Gladys 4?) it’s 9gb
If I have the courage I’ll run a test in production with a fresh DB to rule out hardware and the OS …

Well … I’m pretty dismayed :

I’m sorry @ProtZ, I can’t help you, but please be a little patient — I think someone competent will come to help you!

Hi @ProtZ :slight_smile:

When you say you ran tests, was that on exactly the same hardware?

From the logs I see, your original installation is running on an « armv7l » processor so Raspberry Pi 1, 2 or Zero. However you mention you’re on a Pi 3, so you must have installed an ARMv7 system on your Pi 3 which is ARMv8 — that’s a pity ^^

You then run your tests on a Debian VM with an amd64 CPU, so I imagine a decent machine ^^

It’s not the same thing!

Especially between ARMv7 and v8 there are big performance differences in the JS engine because of instructions that were added in v8.

That said, it’s possible your installation has « things to do » in the background; for that you’d need to check the logs, CPU activity, and what’s happening.

Now, if you plan to get a Gladys installation back on track long-term, I strongly recommend revisiting your hardware — today we recommend mini‑PCs to get a good CPU, and especially an NVMe SSD that can hold up. On Pis, the SD card gets corrupted very quickly, and connecting an SSD over USB doesn’t work great (very common power issues, questionable USB port performance) :slight_smile: I recommend this mini‑PC myself.

If you’re interested, I’m offering a starter kit at the moment — contact me privately if you’re interested :wink:

Thanks @guim31 and @pierre-gilles for your answers.

When you say you ran tests, was it on exactly the same hardware?
Indeed, the most striking test on my Pi 3: with my original 9Gb database it’s KO (whereas it had worked one day) but with a fresh install (database at 0) it’s OK.

From the logs I see, your original installation runs on an « armv7l » processor so Raspberry Pi 1, 2 or Zero.
However you mention you’re on a Pi 3, so you must have installed an ARMv7 system on your Pi 3 which is ARMv8, that’s a shame ^^

Thanks for noticing that! What a hawk-eyed observation! I didn’t realize it; it is indeed a Pi 3 installed with Pi OS Bookworm (Debian 12) and it’s an install with the default image from the Raspberry installer. Strange that v8 isn’t offered and the explanation is in the instructions below for the curious.

I switched to arm v8 by following these instructions.

rpi3:~ $ uname -a
Linux rpi3 6.6.31-v8+ #1766 SMP PREEMPT Fri May 24 12:14:10 BST 2024 aarch64 GNU/Linux

You then run your tests on a Debian VM with an amd64 CPU, so I imagine a decent machine ^^
It’s not the same thing!
It’s on my NAS which is a separately assembled machine (TrueNAS Scale)

Especially between ARMv7 and v8 there are big performance differences in the JS engine because of instructions that were added in v8.

I notice a very visible gain indeed: just for that already THANKS.

That said, it’s possible your installation has « things to do » in the background; for that you’d need to look at the logs, CPU activity, what’s happening.

Not much, there’s nothing running and we see the nmap:

And then BAM! the thing that triggered me is the command:
nmap -oX - -sn -R 192.168.0.22/24 192.168.0.180/16 192.168.0.182/16

Running it by hand takes a very long time.

The culprits, the IPs I had put in the Presence scanner tab of Lan-Manager :frowning:
To be more precise the device IPs whose presence I wanted to check but /16 instead of /24 … I’ve always hated networking and it has always gotten back at me)

Now, if you plan to make a Gladys installation « long term » again, I strongly advise you to review your hardware; today mini-PCs are recommended to have a good CPU, and especially an NVMe SSD that can hold up.
On Pis, the SD gets corrupted very quickly, and connecting an SSD via USB doesn’t work great (very common power issues, questionable performance of the USB port) :slight_smile: I recommend this mini-PC myself .

This mini PC is great and on sale at the moment! But my SD card is brand new; the other one did indeed last only 6 years and then poof… I also have a Pi 4 with an SSD - which hasn’t had power issues so far - or my NAS with NVMe for apps but that’s overkill I think

What I mainly wanted was to understand it without changing anything (there was no reason to), so a big thanks for your time, that was quite an adventure!

2 Likes

Great that you’ve solved your issues :slight_smile:

Up to you, but if you plan to have a solid home automation setup running at your place 24/7 with dozens of devices, it’s the quickest way for it to fail very fast.

You may have been lucky with the last one, but it could last anywhere from 1 month to 6 years… And above all, the performance difference is pretty huge as soon as your setup gets fairly loaded.

I really recommend the mini-PC!