-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Connection issues with Uptime Kuma monitors after server restart #5443
Comments
The issue youβve referenced, #5443, describes connection problems with Uptime Kuma monitors following a server restart. To address this and ensure efficient resolution of similar issues, consider the following steps:
By following these steps, you can enhance the resilience of Uptime Kuma and mitigate connection issues that arise after server restarts, ensuring continuous and reliable monitoring of your services. |
@IV-R, Quick question: Have you looked at the Docker Compose file? Health checks are applicable for both services. The issue occurs sometimes after a βShutdown requestedβ from Uptime Kuma and occasionally after the server restarts. Before Uptime Kuma can start, it must wait until the MariaDB container is in a service_healthy state. If this is not the case, the Uptime Kuma container will not start. |
@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 |
UPDATE: After upgrading the container to This error occurs during the Do you know what might be causing this
|
π 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.yml
andmy.cnf
) for the Uptime Kuma setup.mkdir -p /docker/uptime-kuma-beta && touch /docker/uptime-kuma-beta/docker-compose.yml /docker/uptime-kuma-beta/my.cnf
Edit the
docker-compose.yml
file.Go to the configuration file below, called here is the docker-compose.yml file (click to expand), copy the contents of the
docker-compose.yml
file, and paste it into the file using thenano
editor.Edit the
my.cnf
file.Go to the configuration file below, called here is the my.cnf file (click to expand), copy the contents of the
my.cnf
file, and paste it into the file using thenano
editor.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
CLI
simultaneously, but it may be difficult to follow. To monitor both logs at the same time, run the following:sudo docker logs --follow --details uptime-kuma-beta & sudo docker logs --follow --details uptime-kuma-beta_db
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-beta
directory along with all files and subdirectories inside it, including thedocker-compose.yml
andmy.cnf
files. Ensure you don't lose any important data before executing this step.βοΈ Config files
Here is the
docker-compose.yml
file (click to expand)Here is the
my.cnf
file (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_LOST
after 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, 2024
file (click to expand)Here is the
logs from Dec 17, 2024
file (click to expand)The text was updated successfully, but these errors were encountered: