louislam / uptime-kuma

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

Cannot connect to the socket server. [ Reconnecting ] #5011

Closed rajveer-bhati closed 1 month ago

rajveer-bhati commented 3 months ago

โš ๏ธ Please verify that this question has NOT been raised before.

๐Ÿ›ก๏ธ Security Policy

๐Ÿ“ Describe your problem

Hello,

We are encountering a connection timeout issue when attempting to monitor. The system is deployed on a Linux server and managed using PM2. Despite configuring the environment to handle a large number of requests, the monitoring process fails with connection timeouts, leading to incomplete or failed checks for many of the URLs. Using nginx as reverse proxy. Below is the nginx configruation.

nginx.conf ```nginx server { listen 80; listen [::]:80; server_name uptime.codiantdev.com; location /{ return 301 https://uptime.codiantdev.com$request_uri; } } server { listen 443 ssl http2; #listen [::]:443 ssl http2; server_name uptime.codiantdev.com; client_max_body_size 200M; ssl_certificate /etc/nginx/ssl/codiantdev.crt; ssl_certificate_key /etc/nginx/ssl/codiantdev.key; access_log /var/log/nginx/uptime-access.log; error_log /var/log/nginx/uptime-error.log; access_log /var/log/monitoring/uptime-access.log updated_json_combined; location / { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $host; proxy_set_header X-Forwarded-Proto $scheme; proxy_pass http://localhost:3001/; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } } ```

๐Ÿ“ Error Message(s) or Log

connection

๐Ÿป Uptime-Kuma Version

3.3.17

๐Ÿ’ป Operating System and Arch

Ubuntu 22.04

๐ŸŒ Browser

Chrome

๐Ÿ–ฅ๏ธ Deployment Environment

CommanderStorm commented 3 months ago

image

Seems to work on my end. Could you please provide

rthidden commented 1 month ago

I am having the same issues. Deployed on PikaPod. Using the latest stable versions of Edge and Chrome browsers.

Error Logs:

Trace: TypeError: callback is not a function
at Socket.<anonymous> (/app/server/server.js:934:17)
at runNextTicks (node:internal/process/task_queues:60:5)
at listOnTimeout (node:internal/timers:538:9)
at process.processTimers (node:internal/timers:512:7)
at process.unexpectedErrorHandler (/app/server/server.js:1905:13)
at process.emit (node:events:517:28)
at emit (node:internal/process/promises:149:20)
at processPromiseRejections (node:internal/process/promises:283:27)
at processTicksAndRejections (node:internal/process/task_queues:96:32)
at runNextTicks (node:internal/process/task_queues:64:3)
at listOnTimeout (node:internal/timers:538:9)
at process.processTimers (node:internal/timers:512:7)

image

image

image

image

CommanderStorm commented 1 month ago

Please see https://github.com/louislam/uptime-kuma/issues/5010#issuecomment-2283550401 I don't know where that issue is coming from and it is not reproducible in any case. Maybe some FS-corruption? I don't know..

Closing as a duplicate / other issue is a better fit for your issue

rthidden commented 1 month ago

When I searched for "Cannot connect to the socket server" for issues for the repo, I found 61 hits.

Do you know if any solution has been offered to this at all? Or is it everyone's individual system that is causing issues, not the software, if you are not able to reproduce it?

CommanderStorm commented 1 month ago

not being able to connect to the socket server has 20 different root causes, but most of them boil down to

Depending on the problem you are having solutions mostly exist (low IO will need #4500 for example). Lets root-cause your issue in a fresh issue with the full context about your environment and all the logs.