Repository navigation
Weird "extra config" - maybe I've missed something obvious #502
Replies: 3 comments
|
I believe this is a genuine bug. The container incorrectly overcounts backup jobs when DB##_MONGO_CUSTOM_URI is present because the instance detection regex in functions/10-db-backup: matches any MONGO_CUSTOM_URI globally instead of scoping it to a specific DB index. This results in a phantom job. The regex should be constrained to indexed variables only:
so only valid, numbered database definitions for MONGO are counted. Here's the log output for that section as-is: container-db-backup | ++ set -o posix
container-db-backup | ++ set
container-db-backup | ++ grep -Pc '^(DB[0-9]._HOST=|.*MONGO_CUSTOM_URI=)'
container-db-backup | + local backup_instances=7
container-db-backup | + print_debug '[create_schedulers] Found '\''7'\'' DB_HOST instances'
container-db-backup | + output_off
container-db-backup | + '[' true = true ']'
container-db-backup | + set +x
container-db-backup | 2026-03-26.10:55:03 [DEBUG] /etc/cont-init.d/10-db-backup ** [db-backup] [create_schedulers] Found '7' DB_HOST instances |
|
Switching my .env to be: DB06_TYPE=mongo
DB06_HOST=wekan-db
DB06_NAME=wekanand not using the |
|
I see now how perhaps this was because I foolishly provided extraneous entries in the environment that conflicted / collided with the values extracted from the If I change my env to just contain: DB06_TYPE=mongo
DB06_HOST=wekan-db
DB06_NAME=wekanor, alternatively: DB06_TYPE=mongo
DB06_MONGO_CUSTOM_URI=mongodb://wekan-db/wekanIt doesn't enter trip up that same code. Perhaps a 'note' in the README would be a good idea. I'm happy to do that and submit a PR, if you'd like, @tiredofit Sorry for the chatter, and THANKS for a kickass utility!! Very powerful. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Summary
I have only 6 configs, and when the container runs, it shows an error:
No 'appropriate database type' Entered! - Set '$DB07_TYPE' environment variable - Halting Backup Number 07Incidentally, all 6 backups are working fine.
Steps to reproduce
Here's my (sanitized) .env (and no configs defined in the compose):
I've deleted the image, cleaned out the logs and backup folder... still seems to think there's an 07? It happened after I added the mongo definition as 06, so maybe my mongo definition is missing something?
What is the expected correct behavior?
Should only be 6 jobs defined.
Relevant logs and/or screenshots
Environment
:latestDetails
My compose:All reactions