linuxserver / docker-unifi-network-application

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

[BUG] auto backup don't work #73

Closed ale82x closed 1 month ago

ale82x commented 3 months ago

Is there an existing issue for this?

Current Behavior

i enable auto backup but no available backup. i setup every day but after one week i don't see nothing...

Expected Behavior

execute autobackup every day.

Steps To Reproduce

i use this docker compose, works all fine. i use my access point without problem, only autobackup don't work

`

version: "2.1" services: unifi-db: image: mongo:4.4 container_name: unifi-db volumes:

Environment

- OS: rocky linux 9 arm64bit
- How docker service was installed: docker compose

CPU architecture

arm64

Docker creation

read docker compose posted before

Container logs

[migrations] started
[migrations] no migrations found
usermod: no changes
───────────────────────────────────────

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

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

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

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

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

[custom-init] No custom files found, skipping...
[ls.io-init] done.
github-actions[bot] commented 3 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.

j0nnymoe commented 3 months ago

You need to log into the unifi server log to see why it's failing.

ale82x commented 3 months ago

thank you fir reply. ok, i search in server.log

and find

[2024-01-25 00:00:12,032] ERROR schedule - Failed to execute[backup]: Exception authenticating MongoCredential{mechanism=SCRAM-SHA-1, userName='unifi', source='unifi_stat', password=, mechanismProperties=} com.mongodb.MongoSecurityException: Exception authenticating MongoCredential{mechanism=SCRAM-SHA-1, userName='unifi', source='unifi_stat', password=, mechanismProperties=}

but rest of controller works... i add another site yesterday also....

thank you

ale82x commented 3 months ago

sorry, i think is related...

if i run manual backup i can download file without problem.

only autobackup doesn't work

thank you

j0nnymoe commented 3 months ago

That error seems to be relate to not being able to talk to your mongodb.

ale82x commented 3 months ago

ok where i find how container talk to mongodb?

ale82x commented 3 months ago

i found in system.properties

db.mongo.uri=mongodb\://unifi\:my-pass@unifi-db\:27017/unifi?tls\=false statdb.mongo.uri=mongodb\://unifi\:my-pass@unifi-db\:27017/unifi_stat?tls\=false

but this is ok , unifi-db is name of host unifi is name of db password is correct...

thank you

j0nnymoe commented 3 months ago

Seems another related issue here: https://community.ui.com/questions/UniFi-network-application-not-able-to-do-backups/47e48e7f-c199-499e-b17a-ec6c8f8bae95

Seems like might not have setup the database correctly.

ale82x commented 3 months ago

ok but i can't understand how solve...

another way is schedule on crontab a script to backup file. but i can not find a command to manual backup (of course local)

like docker exec unifi-network-application /bin/bash unifi backup > /config/data/backup/................

thank you

j0nnymoe commented 3 months ago

If you didn't follow our instructions for setting up the mongodb in our read me, it looks like you need to make sure the mongo user has access to the database mentioned in the thread I linked.

LinuxServer-CI commented 2 months 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.

dayuanpan commented 2 months ago

sorry, i think is related...

if i run manual backup i can download file without problem.

only autobackup doesn't work

thank you

May I ask if your problem has been resolved? I have encountered the same problem as you. If it has been resolved, please let me know. If not, could you please let me know how to manually backup? I have not found the button for manual backup.

ale82x commented 2 months ago

i fixed with nano docker-compose.yml `

version: "3.4" services: unifi-network-application: image: linuxserver/unifi-network-application:latest container_name: unifi-network-application cpus: 0.75 environment:

nano ./init-mongo.js db.getSiblingDB("unifi").createUser({user: "unifi", pwd: "unifi", roles: [{role: "dbOwner", db: "unifi"}]}); db.getSiblingDB("unifi_stat").createUser({user: "unifi", pwd: "unifi", roles: [{role: "dbOwner", db: "unifi_stat"}]}); `

now my autobackup works fine

LinuxServer-CI commented 1 month 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.

github-actions[bot] commented 1 week ago

This issue is locked due to inactivity