bunkerity / bunkerity/bunkerweb
[BUG] Scheduler config saver failures and manual plugin handling issues with poor observability
- Dominant language
- Python
- Stars
- 10.9k
- Forks
- 643
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 42
Description
### What happened?
# Config saver failures were opaque:
- Logs only showed: Config saver failed, configuration will not work as expected...
- No exit code, command, or save_config.py output was logged.
- Failures happened both:
-- On scheduler startup (--first-run path).
-- On SIGHUP / reload and on “plugins-only” saves.
# Manual external plugin kept breaking:
- Initial import failed with sqlite3.IntegrityError: NOT NULL constraint failed: bw_settings.regex.
- When import failed, the UI removed the plugin (“plugin not found”) and the scheduler tried to re‑sync from DB, effectively fighting the on‑disk version.
- UI and scheduler both tried to overwrite manual plugin content based on database state instead of treating disk as source of truth.
### How to reproduce?
# Config saver error handling:
- scheduler/main.py ran save_config.py with check=False and did:
-- first-run path: only LOGGER.error("Config saver failed, ..."), no details.
-- reload/plugins-only path: same generic message.
- stdout/stderr from save_config.py were not captured, so the real exception (e.g. DB validation failure, bad setting) was hidden.
# Manual plugin + DB schema mismatch:
- Some malware-scan settings in plugin.json lacked a regex field while the DB schema enforced bw_settings.regex NOT NULL.
- Database.update_external_plugins passed these settings through unmodified → insert failed.
- When import failed:
-- UI cleanup logic saw “plugin not in DB” and deleted /etc/bunkerweb/plugins/malware-scan.
-- Scheduler logic also treated DB as authoritative, re-extracting plugins and overwriting manual changes.
# Checksum / method handling for plugins:
- Scheduler’s external/pro plugin sync logic did not:
-- Respect method="manual" for external or Pro plugins.
-- Treat /etc/bunkerweb/plugins as the source of truth in the no-version-change + manual case.
- Result: on‑disk manual changes could be overwritten by DB content.
### Configuration file(s) (yaml or .env)
```YAML
```
### Relevant log output
```shell
```
### BunkerWeb version
1.6.9-rc2
### What integration are you using?
Linux
### Linux distribution (if applicable)
debian 13.3
### Removed private data
- [x] I have removed all private data from the configuration file and the logs
### Code of Conduct
- [x] I agree to follow this project's Code of Conduct
Contributor guide
Research direction
Start with scheduler/main.py and save_config.py, tracing both the --first-run and reload/plugins-only paths, then inspect Database.update_external_plugins and the malware-scan plugin.json under /etc/bunkerweb/plugins. Reproduce the config saver failure and manual-plugin import or sync behavior. Done means failures expose command, exit status, and output, while manual plugins remain the disk source of truth and imports handle missing regex values.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, sqlite
- Domain
- backend, database, devops
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100