linuxserver / docker-unifi-controller

GNU General Public License v3.0
899 stars 125 forks source link

[BUG] Auto backup on a modified schedule does not appear to run #216

Closed andybee closed 1 year ago

andybee commented 1 year ago

Is there an existing issue for this?

Current Behavior

When setting the auto backup to run, for example, daily at 10am, some time after 10am no files exist in config/data/backup/autobackup.

Potentially interesting to note, the UI suggests files will be stored in a macOS path format (/Users/<user>/Library/Application Data etc.) - though I suspect this is the UI sniffing the browser client as it talks about macOS in several places...?

Expected Behavior

I would expect a backup file to be present in the autobackup directory, or alternative behaviour to be documented somewhere.

Steps To Reproduce

  1. Setup Unifi controller defaults
  2. In System settings, under backup, reschedule the auto backups to be daily and at time just ahead of your current time
  3. Wait for time to elapse past the backup date/time point
  4. Observe the config/data/backup/autobackup directory

Environment

- OS: macOS 12.6.6
- How docker service was installed: Homebrew Cask

CPU architecture

x86-64

Docker creation

services:
  unifi-controller:
    image: lscr.io/linuxserver/unifi-controller:latest
    container_name: unifi-controller
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Etc/UTC
      - MEM_LIMIT=1024
      - MEM_STARTUP=1024
    volumes:
      - ./config:/config
    ports:
      - 8443:8443
      - 3478:3478/udp
      - 10001:10001/udp
      - 8080:8080
      - 1900:1900/udp
      - 8843:8843
      - 8880:8880
      - 6789:6789
      - 5514:5514/udp
    restart: unless-stopped

Container logs

[migrations] started
[migrations] no migrations found
───────────────────────────────────────

      ██╗     ███████╗██╗ ██████╗
      ██║     ██╔════╝██║██╔═══██╗
      ██║     ███████╗██║██║   ██║
      ██║     ╚════██║██║██║   ██║
      ███████╗███████║██║╚██████╔╝
      ╚══════╝╚══════╝╚═╝ ╚═════╝

   Brought to you by linuxserver.io
───────────────────────────────────────

To support LSIO projects visit:
https://www.linuxserver.io/donate/

───────────────────────────────────────
GID/UID
───────────────────────────────────────

User UID:    1000
User GID:    1000
───────────────────────────────────────

*** Setting Java memory limit to 1024 ***
*** Setting Java memory minimum to 1024 ***
[custom-init] No custom files found, skipping...
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.apache.catalina.loader.WebappClassLoaderBase (file:/usr/lib/unifi/lib/tomcat-embed-core-9.0.65.jar) to field java.io.ObjectStreamClass$Caches.localDescs
WARNING: Please consider reporting this to the maintainers of org.apache.catalina.loader.WebappClassLoaderBase
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[ls.io-init] done.
Exception in thread "WsSitesList" java.lang.IllegalStateException: Timer already cancelled.
    at java.base/java.util.Timer.sched(Timer.java:398)
    at java.base/java.util.Timer.schedule(Timer.java:194)
    at com.ubnt.service.sdn.Objectsuper$_o.run(Unknown Source)
    at java.base/java.util.TimerThread.mainLoop(Timer.java:556)
    at java.base/java.util.TimerThread.run(Timer.java:506)
Exception in thread "WsSitesList" java.lang.NullPointerException
    at com.ubnt.service.sdn.Objectsuper$_o.run(Unknown Source)
    at java.base/java.util.TimerThread.mainLoop(Timer.java:556)
    at java.base/java.util.TimerThread.run(Timer.java:506)
Exception in thread "WsSitesList" java.lang.NullPointerException
    at com.ubnt.service.sdn.Objectsuper$_o.run(Unknown Source)
    at java.base/java.util.TimerThread.mainLoop(Timer.java:556)
    at java.base/java.util.TimerThread.run(Timer.java:506)
Exception in thread "WsSitesList" java.lang.NullPointerException
    at com.ubnt.service.sdn.Objectsuper$_o.run(Unknown Source)
    at java.base/java.util.TimerThread.mainLoop(Timer.java:556)
    at java.base/java.util.TimerThread.run(Timer.java:506)
Exception in thread "WsSitesList" java.lang.NullPointerException
    at com.ubnt.service.sdn.Objectsuper$_o.run(Unknown Source)
    at java.base/java.util.TimerThread.mainLoop(Timer.java:556)
    at java.base/java.util.TimerThread.run(Timer.java:506)
org.tuckey.web.filters.urlrewrite.UrlRewriteFilter INFO: destroy called
github-actions[bot] commented 1 year 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 1 year ago

The autobackup definitely does work correctly OOTB, though I've not fiddled with the default schedule, and will output to /config/data/backup/autobackup:

root@7372ebbc109f:/# ls -la /config/data/backup/autobackup/
total 153672
drwxr-xr-x 2 abc abc     4096 Jun 25 23:55 .
drwxr-xr-x 3 abc abc     4096 Jun 20 17:00 ..
-rw-r--r-- 1 abc abc 22347984 May 14 23:55 autobackup_7.3.83_20230514_2255_1684104900029.unf
-rw-r--r-- 1 abc abc 22209728 May 21 23:55 autobackup_7.3.83_20230521_2255_1684709700011.unf
-rw-r--r-- 1 abc abc 22228992 May 28 23:55 autobackup_7.3.83_20230528_2255_1685314500048.unf
-rw-r--r-- 1 abc abc 22582864 Jun  4 23:55 autobackup_7.3.83_20230604_2255_1685919300007.unf
-rw-r--r-- 1 abc abc 22810656 Jun 11 23:55 autobackup_7.3.83_20230611_2255_1686524100026.unf
-rw-r--r-- 1 abc abc 22598064 Jun 18 23:55 autobackup_7.3.83_20230618_2255_1687128900008.unf
-rw-r--r-- 1 abc abc 22550416 Jun 25 23:55 autobackup_7.4.156_20230625_2255_1687733700028.unf
-rw-r--r-- 1 abc abc     1186 Jun 25 23:55 autobackup_meta.json
andybee commented 1 year ago

That's good to know. I've tweaked the title of the bug accordingly. I wondered if it might be a timezone issue, I'm starting the container with UTC set in the Docker Compose, but I set it to my local time zone (UTC+1) in the UI which presumably would be when the backup actually runs.

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. This might be due to missing feedback from OP. It will be closed if no further activity occurs. Thank you for your contributions.

drizuid commented 1 year ago

This situation would be the same as having UTC on a bare metal host and setting UTC+1 in the application. Unfortunately, we do not support the application, we support the container. The majority of our users (you're the only one that reported an issue) and ourselves do not face any issue with automatic backups. I would suggest engaging ubiquiti support.

github-actions[bot] commented 1 year ago

This issue is locked due to inactivity