mirror of
https://github.com/louislam/uptime-kuma.git
synced 2026-03-02 22:57:00 -05:00
Connection issues with Uptime Kuma monitors after server restart #3838
Labels
No labels
A:accessibility
A:api
A:cert-expiry
A:core
A:dashboard
A:deployment
A:documentation
A:domain expiry
A:incidents
A:maintenance
A:metrics
A:monitor
A:notifications
A:reports
A:settings
A:status-page
A:ui/ux
A:user-management
Stale
ai-slop
blocked
blocked-upstream
bug
cannot-reproduce
dependencies
discussion
duplicate
feature-request
feature-request
good first issue
hacktoberfest
help
help wanted
house keeping
invalid
invalid-format
invalid-format
question
releaseblocker 🚨
security
spam
type:enhance-existing
type:new
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/uptime-kuma#3838
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @homelab-alpha on GitHub (Dec 16, 2024).
📑 I have found these related issues/pull requests
I have checked, but couldn’t find anything similar.
🛡️ Security Policy
Description
After restarting the server (Ubuntu Server 24.04.1 LTS), Uptime Kuma monitors fail to reconnect to services like Docker and MariaDB. The logs indicate a PROTOCOL_CONNECTION_LOST error, pointing to connection instability with the database and Docker monitors.
However, as shown in the logs, Uptime Kuma starts successfully despite the trace error.
👟 Reproduction Steps
Open the terminal and create the directory structure and files:
This command creates the necessary directories and empty files (
docker-compose.ymlandmy.cnf) for the Uptime Kuma setup.Edit the
docker-compose.ymlfile.Go to the configuration file below, called here is the docker-compose.yml file (click to expand), copy the contents of the
docker-compose.ymlfile, and paste it into the file using thenanoeditor.Edit the
my.cnffile.Go to the configuration file below, called here is the my.cnf file (click to expand), copy the contents of the
my.cnffile, and paste it into the file using thenanoeditor.Bring the stack online with the following command:
This command starts the Uptime Kuma stack using Docker Compose, runs it in the background (
--detach), and removes orphaned containers (--remove-orphans).Configure Uptime Kuma and create 5 monitors of different types (e.g., DNS, HTTPS, MySQL).
This step involves setting up Uptime Kuma and creating the necessary monitors to check the uptime of various services. To access the Uptime Kuma web interface, open a browser and navigate to:
After completing the setup and creating the necessary monitors, you can proceed to Step 6.
Restart the server (Ubuntu Server 24.04.1 LTS).
Note: Ensure that any important work is saved before running this command, as it will reboot the server immediately.
Observe the logs generated by Uptime Kuma and MariaDB before and after the server restart.
NOTE: For an easier way to view logs from your containers, use Dozzle, a convenient web-based log viewer for Docker containers.
You can monitor the logs of the Uptime Kuma container and MariaDB container to see how they behave before and after the server restart.
You can view both logs in the
CLIsimultaneously, but it may be difficult to follow. To monitor both logs at the same time, run the following:After testing, take the stack offline using the following command:
This command will stop and remove the containers, cleaning up the Docker environment while keeping the configuration files intact.
Cleanup: After completing your testing and confirming that everything is done, you can clean up the directory.
Remove the directory and all contents of the Uptime Kuma stack to finalize the cleanup process.
Note: This command will delete the
/docker/uptime-kuma-betadirectory along with all files and subdirectories inside it, including thedocker-compose.ymlandmy.cnffiles. Ensure you don't lose any important data before executing this step.⚙️ Config files
Here is the
docker-compose.ymlfile (click to expand)Here is the
my.cnffile (click to expand)👀 Expected behavior
Monitors should reconnect to all configured services after a server restart.
😓 Actual Behavior
Monitors are unable to connect to MariaDB and Docker services. Logs show
PROTOCOL_CONNECTION_LOSTafter auto retry, which seems to fix the issue.🐻 Uptime-Kuma Version
2.0.0-beta.0
💻 Operating System and Arch
Ubuntu Server 24.04.1 LTS (GNU/Linux 6.8.0-48-generic x86_64)
🌐 Browser
Brave Version 1.73.101 Chromium: 131.0.6778.139 (Official Build) (64-bit)
🖥️ Deployment Environment
📝 Relevant log output
Logs show errors related to connection loss. Examples:
Here is the
logs from Dec 16, 2024file (click to expand)Here is the
logs from Dec 17, 2024file (click to expand)@homelab-alpha commented on GitHub (Dec 19, 2024):
@louislam, @CommanderStorm, I’ve updated the issue and I think I’ve found the problem. It seems to be related to how I set up the MariaDB configuration in the docker-compose file.
I’ve now added a complete configuration file for MariaDB using
my.cnf. Hopefully, this was the issue. I’ll keep you updated.@homelab-alpha commented on GitHub (Dec 21, 2024):
@louislam,
UPDATE: After upgrading the container to
2.0.0-beta.1and adjusting the MariaDB configuration in thedocker-compose.ymlfile, most of the issues I previously encountered have been resolved. However, I am now experiencing aTrace Errorwhen rebooting the container.This error occurs during the
[DB] INFO: Closing the databasestep. Interestingly, it is not consistent—sometimes it happens multiple times in a row after several reboots, while other times it does not occur at all.Do you know what might be causing this
Trace Errorduring the database closure process?adjustments(click to expand)From
To
my.cnf(click to expand)comand + log(click to expand)Reboot command:
Output log:
Reboot command:
Output log:
Reboot command:
Output log:
Reboot command:
Output log: