GoogleCloudPlatform / GoogleCloudPlatform/scion
bug: gce-start-hub.sh --full overwrites settings.yaml, destroying plugin config
- Dominant language
- Go
- Stars
- 1.7k
- Forks
- 263
- Avg merge
- 7h 6m
- Merged PRs (30d)
- 447
Description
## Problem
The GCE deploy script (`scripts/starter-hub/gce-start-hub.sh`) generates a minimal `settings.yaml` containing only `schema_version`, `default_runtime`, `server.mode`, and `telemetry` config. On `--full` deploys, it unconditionally overwrites the existing file:
```bash
sudo mv /tmp/scion-settings.yaml /home/scion/.scion/settings.yaml
```
This silently destroys any hand-configured sections, including:
- `server.message_broker` (enables the message broker)
- `server.plugins.broker.telegram` (bot token, webhook config, db path)
- `server.plugins.broker.discord` (or any other broker plugin config)
The result is that every `--full` deploy breaks all configured broker plugins. The hub starts without them, and there's no warning or error — the config is simply gone.
## Impact
Discovered during a Telegram plugin debugging session. The plugin had been configured and working, but after hub updates the entire plugin config was wiped. Rebuilding required SSH access to the VM to manually re-add the config.
## Expected Behavior
The deploy script should preserve existing plugin and message broker configuration when updating `settings.yaml`. New deployments (or `--reset-db`) can start fresh, but routine updates should merge, not replace.
## Fix
A patch has been prepared that:
1. Detects an existing `settings.yaml` and merges using Python's `yaml` library, preserving `server.plugins`, `server.message_broker`, and top-level `plugins` sections
2. Falls back to overwrite only if the merge fails or `--reset-db` is used
Related: #147 (admin settings lost on K8s pod restart — same category of problem, different deployment target)
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with scripts/starter-hub/gce-start-hub.sh and trace the --full deployment path that writes /home/scion/.scion/settings.yaml. Reproduce it with existing plugin and message broker settings, then verify that a routine update preserves those sections while a new deployment or --reset-db can start fresh.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, shell
- Domain
- devops, infrastructure
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 65/100