#Ubutu server shutting down when schedule backup cron
1 messages · Page 1 of 1 (latest)
@wild laurel
weeeird....i wonder if it's crashing or something
I have no idea too. the script should be fine as I copied and I tested manually backup. it is okay
Maybe there's extra load going on at that time
do you mean this is the server issue ? when backing up, the server crush and forced to restart?
if that so, why when it restarted, the service is no longer up.
Are containers not running after server restart?
it is running but the appwrite is no longer accessible
What are the logs for InfluxDB?
I think fluxdb could be shutting down or something so it's making Appwrite not being accessible
If you can get logs just after replicating the issue it will be very useful
Also what's the error you get when you can't access the appwrite instance?
500 error, timeout...?
How to get that logs
Run
docker compose logs influxdb in the folder where the docker compose file is located at
And Traefik?
docker compose logs traefik
Interesting. Looks like that's the issue
You will need to stop Traefik and start after backup
But I think it should not be needed 🤔
@swift palm In the video, you stop Traefik and after backup you turn it up again. What was the reason for that?
Awww then it should have script to restart
Not everything, just run
docker compose stop traefik
and then
docker compose up traefik
If stop doesn't work, then use down
It is auto back up then i need to restart every morning
In the backup.sh you can add after everything
docker compose down traefik && docker compose up traefik and it will be restarted automatically
Is it necessary
i restarted but still the same
What? 🤯
i did thiis. yet, it is still can't connect to appwrite console
What's the error you get while trying to access?
This site can’t be reached
After an unexpected reboot, i would run docker stats --no-stream to check to see if there's any suspiciously low resource usage for a container and dive into the logs on it and restart it if it's stale. Depending on the specs of your machine, you could be running out of memory potentially and the process picked up by the OOM Killer, somethin like dmesg -T | grep -i 'killed process' might confirm.
Well, the machine itself is not being restarted, only the docker instance supposedly, and what's even more weird is that the containers seems to still be running when the backup ends but although that, it's impossible to enter appwrite
Anyways, @wild laurel try checking that after it restarts
it works back after restarting somehow, restart machine manually
it will eventually happen again
How do i check the network log
That's weird. Do you have done what Evan said?
yes @jovial mango
Let's filter out the noise and look at the logs for mariadb and influx db. @wild laurel - try docker logs appwrite-mariadb 2>&1 | grep "error" and docker logs appwrite-influxdb 2>&1 | grep "error". (if those don't show anything, replace error with warn or exception) The suspicion im leaning towards is mariadb completely locking up after the sqldump and it not recovering appropriately.
show nothing
Let's try one without a filter on mariadb: docker logs appwrite-mariadb .
Thanks, I don't see anything alarming there from those logs as I get those warns when running an idle instance.
I'm curious about the following:
- what is your
_APP_MAINTENANCE_INTERVALenvironment variable set to? might be possible that it's conflicting with your scheduled backup - specs of the machine - gb/ram/disksize - it's important you have at least 2gb set for swap usage
I think as a band aid, you can add a compose down/up that occurs after the backup completes.
The server has 3gb of ram. I think that's not the issue, maybe I'm wrong. Anyways @wild laurel could you please send some screenshots of htop?
you are right, I just increased to 4GB. it should be okay. storage is fine.
I schedule backup everyday at 3:00AM
Do you have any system monitoring? For my home lab I use Prometheus+Grafana w Node Exporter for system metrics and cAdvisor for container metrics. It might be helpful to see what the load is like during the backup time and see what might be causing additional load
Could be
what could it be . less RAM or what?
Not enough ram
4GB? backup costs that much
4gb should be enough depending on the load that the server is having at such moment
If you run the backup manually, does the same happens?
And also, when it's run automatically, does the backup complete successfully? Or it fails on being created?
no it doesnt if i do manually
how do I verify
Basically, rename the backup folder/file that is being created to something else, wait for the auto backup to complete and see if a new file/folder is being created with all the corresponding files inside it (like mariadb export, storage files...)
yes. will have a try
Interesting. Does the upload folder contain something?
I searched and some people with this issue was due to docker not being updated. You have the latest version, right?
it should be the lastest
but when i open it , it failed
So the file is like corrupted? 🤔
i think so.
Do you have encryption enabled?
how do I check, it should be no, i didn't set
In the console, go to the bucket settings and there you should have an option to enable/disable. Check if it's enabled
FYI, this is right now.
This looks fine, I think?
i think so. RAM should be ok
@tepid swan what do you think
after manual restarting is okay again.
yes right "eanbled"
Then backup is correct. You can't open because it's encrypted
yep. right .
Is this a snippet of how it looks when the service is unreachable?
yes right.
This will be a tough one to diagnose. So to just to clarify - is the server getting restarted after the backup? Or are the containers dying and not recovering? I would be curious to see what your docker compose file looks like if it deviates from the template. (you can dm me if you don't feel comfortable posting here)
@wild laurel
I have no idea if is restarted after the backup. it should be NO. because when I restart the server the service will be back normal.
this happens again.
So it stopped happening and now it happens again? That's weird
What's your backup procedure?
it stopped for quite sometime.