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

Closed
opened 2026-02-28 02:19:28 -05:00 by deekerman · 13 comments
Owner

Originally created by @perpi on GitHub (Sep 10, 2022).

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

  • I checked and didn't find similar issue

🛡️ 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

Originally created by @perpi on GitHub (Sep 10, 2022). ### ⚠️ Please verify that this bug has NOT been raised before. - [X] I checked and didn't find similar issue ### 🛡️ Security Policy - [X] I agree to have read this project [Security Policy](https://github.com/louislam/uptime-kuma/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](https://user-images.githubusercontent.com/7093244/189482516-927df378-4472-4312-8bf6-283e915fccd4.png) ### 🐻 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_
deekerman 2026-02-28 02:19:28 -05:00
  • closed this issue
  • added the
    bug
    A:core
    labels
Author
Owner

@wojcikm commented on GitHub (Sep 22, 2022):

@louislam any ETA on this?

@wojcikm commented on GitHub (Sep 22, 2022): @louislam any ETA on this?
Author
Owner

@arioch commented on GitHub (Nov 14, 2022):

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.

@arioch commented on GitHub (Nov 14, 2022): 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.
Author
Owner

@jstewart1982 commented on GitHub (Nov 21, 2022):

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

@jstewart1982 commented on GitHub (Nov 21, 2022): We are encountering this issue now, we have just over 1000 sensors and the console seems to be rendered inoperable
Author
Owner

@jkrause-Gold commented on GitHub (Feb 16, 2023):

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

@jkrause-Gold commented on GitHub (Feb 16, 2023): 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
Author
Owner

@johnny-chiang commented on GitHub (Feb 21, 2023):

Had the same issue here

@johnny-chiang commented on GitHub (Feb 21, 2023): Had the same issue here
Author
Owner

@PatyYe commented on GitHub (Apr 21, 2023):

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.

@PatyYe commented on GitHub (Apr 21, 2023): 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.
Author
Owner

@nocerainfosec commented on GitHub (Apr 26, 2023):

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?

@nocerainfosec commented on GitHub (Apr 26, 2023): 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?
Author
Owner

@goksinenki commented on GitHub (Oct 19, 2023):

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 ?

@goksinenki commented on GitHub (Oct 19, 2023): 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 ?
Author
Owner

@CommanderStorm commented on GitHub (Oct 19, 2023):

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

@CommanderStorm commented on GitHub (Oct 19, 2023): 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
Author
Owner

@xyhcode commented on GitHub (Dec 8, 2023):

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

@xyhcode commented on GitHub (Dec 8, 2023): I didn't add any monitors, but the actions panel is always like this, refreshes every few seconds, so why <img width="454" alt="iShot_2023-12-09_10 55 05" src="https://github.com/louislam/uptime-kuma/assets/64968400/ac421401-7e4e-4701-b102-9bbd6886121a">
Author
Owner

@chakflying commented on GitHub (Dec 9, 2023):

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

@chakflying commented on GitHub (Dec 9, 2023): Obsolete as the backup feature has been dropped in https://github.com/louislam/uptime-kuma/pull/3892.
Author
Owner

@hrshv6 commented on GitHub (Apr 2, 2024):

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.

@hrshv6 commented on GitHub (Apr 2, 2024): 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](https://github.com/louislam/uptime-kuma/assets/5875821/77462dc8-db4a-49b0-9b68-40f2f4ed79a2) Just wanted to comment in here for other people looking for a solution.
Author
Owner

@CommanderStorm commented on GitHub (Apr 2, 2024):

@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..

@CommanderStorm commented on GitHub (Apr 2, 2024): @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](https://github.com/louislam/uptime-kuma/wiki/Reverse-Proxy#haproxy) ^^ > > 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..
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/uptime-kuma#1386
No description provided.