linuxserver / docker-unifi-network-application

GNU General Public License v3.0
551 stars 40 forks source link

[BUG] Scheduled automatic backups are not stored anywhere #44

Closed raidenlal closed 6 months ago

raidenlal commented 6 months ago

Is there an existing issue for this?

Current Behavior

No backups are found. It seems the files are not creating inside container anywhere.

Few days ago I have found out I am unable to log in (mongdb was empty?), and no autobackups were being done. Had to restore to some older manual backup.

Expected Behavior

Backups are created.

Previously they were inside (/config)/data/backup/autobackup.

Tooltip inside Backup settings menu says backups will get stored inside C:\Users\<Username>\Ubiquiti UniFi\data\backups\autobackup, but we are inside linux environment.

Steps To Reproduce

Set-up autobackups: Settings->System->Backups->Auto Backup. No backups are generated.

Environment

- OS: Windows 10
- How docker service was installed: manually inside WSL

CPU architecture

x86-64

Docker creation

docker run --name=unifi -e MONGO_USER=user -e MONGO_PASS=pass -e MONGO_HOST=host-e MONGO_DBNAME=unifi -e MONGO_PORT=27017 -p 3478:3478/udp -p 8080:8080 -p 11000:8443 -p 10001:10001/udp -v /mnt/c/dockerdir/Unifi:/config -d lscr.io/linuxserver/unifi-network-application:latest

Container logs

2023-12-03T06:01:52.714681200+01:00 ───────────────────────────────────────
2023-12-03T06:01:52.714683800+01:00 GID/UID
2023-12-03T06:01:52.714686000+01:00 ───────────────────────────────────────
2023-12-03T06:01:52.742953800+01:00 
2023-12-03T06:01:52.742971500+01:00 User UID:    911
2023-12-03T06:01:52.743029400+01:00 User GID:    911
2023-12-03T06:01:52.743033300+01:00 ───────────────────────────────────────
2023-12-03T06:01:52.743093900+01:00 
2023-12-03T06:01:53.925921700+01:00 [custom-init] No custom files found, skipping...
2023-12-03T06:03:14.419606223+01:00 [ls.io-init] done.

--no logs afterwards--
github-actions[bot] commented 6 months ago

Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.

thespad commented 6 months ago

This is not a container issue, autobackups are definitely working:

image

If your autobackups are not working that suggests a configuration/permissions issue or an upstream bug with the software itself.

aptalca commented 6 months ago

Works here as well.

I noticed that you're mapping windows paths. We recommend against that. When running in wsl2, please use Linux paths so the container uses the Linux filesystem instead of going through an abstraction layer to access ntfs.

I recommend something like -v /home/youruser/unifi:/config

raidenlal commented 6 months ago

I noticed that you're mapping windows paths. We recommend against that.

I fully understand the performance hit, but this is the only way for me to have this deployed in my homelab. Everything else is fine with this setup. Even previous Unifi controller dockerized by someone else was fine with this.

Works here as well.

And where are the backups stored?

raidenlal commented 6 months ago

Last backup I have is from 2023-11-12 midnight and it was done using lscr.io/linuxserver/unifi-network-application:latest which I migrated to sometime around 2023-10-31 using exactly the same docker creation command.

So this was working properly before and because of that this is a regression.

aptalca commented 6 months ago

I fully understand the performance hit, but this is the only way for me to have this deployed in my homelab. Everything else is fine with this setup. Even previous Unifi controller dockerized by someone else was fine with this.

I'm not talking about a performance hit. I'm talking about data corruption. It's not the only way you can do it. I already explained another way. But you do you.

And where are the backups stored?

/config/data/backup/autobackup

raidenlal commented 6 months ago

I'm not talking about a performance hit. I'm talking about data corruption. It's not the only way you can do it. I already explained another way. But you do you.

Why are we even discussing this? How is that relevant for this issue? Everything else works with this setup, even the backups were working properly with this setup.

aptalca commented 6 months ago

Why are we even discussing this? How is that relevant for this issue? Everything else works with this setup, even the backups were working properly with this setup.

  1. You are running the container in an unsupported manner (wsl2 with windows paths mapped)
  2. The reason we don't support it is because that has caused various unexpected issues in the past
  3. We can't reproduce your issue in supported installs

Sounds like you also have other issues going on. Like your mongodb being empty all of a sudden.

raidenlal commented 6 months ago

Why the other issues happened does not matter.

I understood two things:

So I am closing this ticket as this is absolutely unhelpful thread.

Roxedus commented 6 months ago

If you decide you want to troubleshoot this yourself, as you are the only one in this thread that has this issue, there should be application logs in the config volume.