louislam / uptime-kuma

A fancy self-hosted monitoring tool
https://uptime.kuma.pet
MIT License
60.43k stars 5.4k forks source link

Error: "Lost connection to the socket server" | It happens on adding a large json file! #2067

Closed perpi closed 11 months ago

perpi commented 2 years ago

⚠️ Please verify that this bug has NOT been raised before.

🛡️ Security Policy

Description

No response

👟 Reproduction steps

Try to add more than 500 items by one json file.

👀 Expected behavior

Adding json files with any size.

😓 Actual Behavior

By importing more than 400 addresses (>50,000 lines in JSON file), Kuma couldn't add them showing this error:

image

🐻 Uptime-Kuma Version

1.18.0

💻 Operating System and Arch

Ubuntu 22.04 64bit

🌐 Browser

Chrome, Edge, Firefox

🐋 Docker Version

Docker version 20.10.12, build 20.10.12-0ubuntu4

🟩 NodeJS Version

v16.16.0

📝 Relevant log output

No response

wojcikm commented 2 years ago

@louislam any ETA on this?

arioch commented 2 years ago

First time user, already ran into this error with a mere 10 items. What's the current preferred way to bulk import? The usual self-help channels lead me to the JSON import approach.

jstewart1982 commented 2 years ago

We are encountering this issue now, we have just over 1000 sensors and the console seems to be rendered inoperable

jkrause-Gold commented 1 year ago

Same issue here. Dashboard just keeps cycling through all the endpoints then errors out. "Lost connection to Server Socket Reconnecting......"

Dashboard is almost useless at this point

JohnnyChiang commented 1 year ago

Had the same issue here

PatyYe commented 1 year ago

We have 3 instances, 2 of them both with ~300 monitors. These respond without issue but tend to be a bit slow starting up. Our third instance is at 1100 monitors, and we broke down around 800, it keeps loadin and loading. I cannot use the dashbaord anymore.

If wanted I can provide additional information if it's required to help find the issue.

nocerainfosec commented 1 year ago

I am able to add 600 sensors per json file, I have added 1186 sensors to monitor in total, although, server becomes unresponsive after every 2 minutes losing connection with these 1186 sensors. is there anything that can be done to increase performance?

goksinenki commented 1 year ago

I have nearly 600 sensors and same problem. There is nginx proxy before Kuma and configured as told in the articles.

server { listen 8000;

Remove '#' in the next line to enable IPv6

# listen [::]:80;
server_name   xxxx.xxxxx.local;
location / {
    proxy_pass         http://localhost:3001;
    proxy_http_version 1.1;
    proxy_set_header   Upgrade $http_upgrade;
    proxy_set_header   Connection "upgrade";
    proxy_set_header   Host $host;
}

}

And the nginx log says : "[error] 67395#0: *226 recv() failed (104: Connection reset by peer) while proxying upgraded connection, client: 10.x.y.z, server: xxxx.xxx.local, request: "GET /socket.io/?EIO=4&transport=websocket HTTP/1.1", upstream: "http://127.0.0.1:3001/socket.io/?EIO=4&transport=websocket", host: "uptime.xxxx.xxx:8000"

Any Updates ?

CommanderStorm commented 1 year ago

v2 does include a lot of perfomance updates and should allow scaling past ~200-500 monitors. See https://github.com/louislam/uptime-kuma/milestone/24 for further progress

xyhcode commented 11 months ago

I didn't add any monitors, but the actions panel is always like this, refreshes every few seconds, so why

iShot_2023-12-09_10 55 05
chakflying commented 11 months ago

Obsolete as the backup feature has been dropped in https://github.com/louislam/uptime-kuma/pull/3892.

hrshv6 commented 7 months ago

In our case, the cause of this error was haproxy. To solve this problem, we needed to add the following two settings to our haproxy.cfg file:

2024-04-02_192016

Just wanted to comment in here for other people looking for a solution.

CommanderStorm commented 7 months ago

@hrshv6 Completely unrelated to the other posts. NONE of them have stated that they are using haproxy. This post is about connection timeouts caused by the now removed import/export functionality and thus between db and backend

[!NOTE] That timeout client-fin is necessary if timeout tunnel is used is documented in the docs ^^

Our knowledge of these niche reverse proxies is not the best and I know that that part of the docs is likely not the best => PRs from people who know more would be appreciated..