Skip to content
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

[BUG] auto backup don't work #73

Closed
1 task done
ale82x opened this issue Mar 13, 2024 · 15 comments
Closed
1 task done

[BUG] auto backup don't work #73

ale82x opened this issue Mar 13, 2024 · 15 comments

Comments

@ale82x
Copy link

ale82x commented Mar 13, 2024

Is there an existing issue for this?

  • I have searched the existing issues

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:
- ./mongodb:/data/db
- ./mongodb-init/mongo.js:/docker-entrypoint-initdb.d/init-mongo.js:ro
restart: unless-stopped

unifi-network-application:
#image: lscr.io/linuxserver/unifi-network-application:latest
image: linuxserver/unifi-network-application:latest
container_name: unifi-network-application
cpus: 1
environment:
- PUID=1000
- PGID=1000
- TZ=Europe/Rome
- MONGO_USER=unifi
- MONGO_PASS=mypassword
- MONGO_HOST=unifi-db
- MONGO_PORT=27017
- MONGO_DBNAME=unifi-db
#- MEM_LIMIT=1024M #optional
#- MEM_STARTUP=128M #optional
- MONGO_TLS= #optional
- MONGO_AUTHSOURCE= #optional
volumes:
- ./config:/config
ports:
- 192.168.123.1:8443:8443
- 3478:3478/udp
#- 10001:10001/udp
- 8080:8080
#- 1900:1900/udp #optional
#- 8843:8843 #optional
#- 8880:8880 #optional
#- 6789:6789 #optional
- 5514:5514/udp #optional
restart: unless-stopped
`

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.
Copy link

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

@j0nnymoe
Copy link
Member

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

@ale82x
Copy link
Author

ale82x commented Mar 13, 2024

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
Copy link
Author

ale82x commented Mar 13, 2024

sorry, i think is related...

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

only autobackup doesn't work

thank you

@j0nnymoe
Copy link
Member

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

@ale82x
Copy link
Author

ale82x commented Mar 13, 2024

ok where i find how container talk to mongodb?

@ale82x
Copy link
Author

ale82x commented Mar 13, 2024

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
Copy link
Member

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
Copy link
Author

ale82x commented Mar 13, 2024

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
Copy link
Member

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
Copy link
Contributor

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
Copy link

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
Copy link
Author

ale82x commented Apr 13, 2024

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:
- PUID=1000
- PGID=1000
- TZ=Europe/Rome
- MONGO_USER=unifi
- MONGO_PASS=unifi
- MONGO_HOST=unifi-db
- MONGO_PORT=27017
- MONGO_DBNAME=unifi
- MEM_LIMIT=1024 #optional
- MEM_STARTUP=1024 #optional
- MONGO_TLS=false #optional
- MONGO_AUTHSOURCE= #optional
volumes:
- ./data/unifi/config:/config
ports:
- 192.168.123.1:8443:8443
- 3478:3478/udp
- 10001:10001/udp
- 8080:8080
#- 1900:1900/udp #optional
#- 8843:8843 #optional
#- 8880:8880 #optional
#- 6789:6789 #optional
#- 5514:5514/udp #optional
restart: unless-stopped

unifi-db:
image: mongo:4.4
container_name: unifi-db
environment:
- MONGO_DBNAME=unifi
- MONGO_USER=unifi
- MONGO_PASS=unifi
volumes:
- ./data/mongo/data/db:/data/db
- ./init-mongo.js:/docker-entrypoint-initdb.d/init-mongo.js:ro
restart: unless-stopped

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
Copy link
Contributor

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.

Copy link

This issue is locked due to inactivity

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Archived in project
Development

No branches or pull requests

5 participants