Upgrading Butler SOS
Upgrading Butler SOS to a new version? Here's how to do it.
First: Don't Panic
Upgrading Butler SOS is usually a smooth process:
- Get the new version from the assets section on the download page. Extract the ZIP file.
- Back up your existing Butler SOS configuration file.
- Edit the configuration file to match the new version's requirements.
- Stop the Butler SOS process/service.
- Replace the Butler SOS binary with the new version.
- Start the process/service.
- 🥳 Celebrate!
Then: The Details
Version Number Hints
Different kinds of upgrades (usually) result in different levels of modifications needed in the main config file.
- "Patch" upgrades move from one patch version to another, without changing the minor version.
Example: Upgrading from 13.0.0 → 13.0.4. - "Minor" upgrades involves moving from one minor version to another, without changing the major version.
Example: Upgrading from 13.2.3 → 13.3.0 - "Major" upgrades is when you move to a new major version.
Example: 12.4.2 → 13.0.0
Always Upgrade to Latest
You should always upgrade to the latest available version.
That version has the latest features, bug fixes and security patches.
Patch Upgrades
The new release includes bug fixes, security patches, minor updates to documentation etc - but no new features.
In theory there should never be any changes to the config files when doing a patch upgrade.
Minor Upgrades
This scenario means that new features are added to Butler SOS.
Usually there are also various bug fixes included.
Most new features need to be configured somehow, meaning that minor upgrades usually require modification to the config files.
The most common change by far is that it's the main config file that needs to be modified, but a new scheduler related feature could for example mean that the scheduler config file must be modified too.
The changes needed to the config files are usually additive in nature, i.e. some settings must be added to the config file, but the existing settings and general structure of the file remain the same.
Major Upgrades
This scenario involves breaking changes of some kind.
These almost certainly require changes to the config files, sometimes even significant ones in the sense that the structure of the config file may have changed.
If very major rework has been done to Butler SOS, this may also result in a major version bump even if no breaking changes were introduced.
Config file breaking changes
Major Butler SOS releases can introduce breaking changes to the config file structure.
If you are upgrading from an earlier version, the safest approach is to:
- Back up your current config file
- Start fresh from the
production_template.yamlincluded in the release ZIP - Re-apply your custom settings from the backed-up config
Alternatively, use the template as a reference and add any missing sections to your existing config.
Know Your Config File
Butler SOS is entirely driven by its YAML-formatted configuration file, with an example file serving as a good starting point.
InfluxDB Considerations
Some versions include changes to the InfluxDB schema, meaning that you need to do some manual work in order to upgrade to the new schema.
The easiest way to do this is to delete the InfluxDB database used by Butler SOS, then let Butler SOS re-create it using the new schema.
If the InfluxDB database specified in the Butler SOS config file does not exist, Butler SOS will automatically create it for you.
Deleting the InfluxDB database "senseops" can be done with a command similar to this:
influx --host <ip-where-influxdb-is-running> --port <influxdb-port-usually-8086>
drop database senseops
exitUpgrade Checklist
Config File Validation
Butler SOS always checks that the config file has the correct format when starting.
This means that if you forget to add or change some setting in the main YAML config file, Butler SOS will tell you what's missing and refuse to start.
A consequence of this is that all settings are now mandatory, even if you don't use them.
From Butler SOS 15.4.0 you can check a config file with the new version before you switch to it, using --check-config. See step 6 below.
Make a backup of your YAML configuration file before upgrading. Just... do it.
Review release notes: Look at the release notes to get a general feeling for what is new and what has changed.
Those are the areas that may require changes in the config file.Compare config files: Compare your existing main config file with the template config file available on GitHub.
This comparison is a manual process and can be a bit tedious, but knowing your config file is really needed in order to make full and correct use of Butler SOS.That file is also included in the Butler SOS ZIP file available on the download page.
A more in-depth description of the config file is available in the Reference docs > Config file format section of the documentation.
Identify changes: The result of the comparison will show you what parts of the config file are new (for minor upgrades) and which parts have changed in a significant way (for major upgrades).
Get new binaries: Get the binaries for the new Butler SOS version from the download page.
Check the config file with the new version: Run the new Butler SOS version with
--check-configagainst your config file, while the old version keeps running. It runs every check a normal start runs, starts nothing, and exits with code 0 when the file is valid and 1 when it is not:bashbutler-sos -c /opt/butler-sos/config/production.yaml --check-configUse the same Butler SOS version you will run: the settings and values allowed can change between versions. See Config File Verification.
Start and verify: Start the new Butler SOS version and let it run for a few minutes.
- Review the console logs (or the log files) to make sure there are no warnings or errors.
- If there are warnings or errors it can be helpful to start Butler SOS with more verbose logging.
Adding--loglevel verboseor even--loglevel debugwill give you more details on what Butler SOS is doing and what might be causing the problems you are experiencing.
Finally: When Things Aren't Working - Check the Logs
By far the most common problem when upgrading to a new Butler SOS version (or doing a fresh install) is an incorrect config file.
All config entries are mandatory, even if you don't use them.
This may seem a bit harsh, but this way Butler SOS can tell you exactly what is missing in the config file.
Example: Missing Config Entry
Problems in the config file are listed in a report when Butler SOS starts, each with its setting, its line in the file and what is allowed. A missing setting looks like this:
line 2, col 1 Butler-SOS.fileLogging
is missing. Add it under Butler-SOS.A setting that is not in the file has no line of its own. The line given is the line of the section it belongs in, here the Butler-SOS: line at the top of the file. Add the setting inside that section, at the same indentation as the settings around it. The config file template for your version shows each setting's place and a sensible value.
See Reading a config file error for the whole report and the most common mistakes.
A Restart Loop After Upgrading
Changed in 15.1.0
Before Butler SOS 15.1.0, a Butler SOS that could not start stopped, but reported exit code zero: a clean exit. Docker restart: on-failure and systemd Restart=on-failure never restarted it, and monitoring that watched for a non-zero exit saw nothing.
When Butler SOS cannot start, it exits with code 1 and writes a crash dump describing why. If you run Butler SOS under Docker or systemd with an automatic restart policy, this may look at first like something has broken after an upgrade. It has not.
If Butler SOS fails to start because of something that will not fix itself — a typo in the config file, a certificate path that does not exist, a port permanently occupied by another service — then under an automatic restart policy it will fail, restart, fail again, and keep going. A crash loop.
This is intended behaviour, not a regression. A service that visibly cannot start is far easier to notice and diagnose than one that is silently absent. The loop is the symptom surfacing, not the disease.
If you see Butler SOS restarting repeatedly after upgrading:
- Do not assume the restart policy is misconfigured. It is working; it is telling you something.
- Read the log, or the crash dump, and find the underlying error. It will almost always be a configuration problem that was already present before the upgrade — it just was not visible.
- Fix that, and the loop stops. Butler SOS was never going to start successfully in this state; previously it just failed quietly.
To have Butler SOS report a config file problem once and stay up instead, start it with --on-invalid-config wait (Butler SOS 15.4.0 and later). See Crash Dump for more on startup failures and restart policies.
Troubleshooting Steps
Butler SOS is pretty good at figuring out what is wrong with the config file, but there may be cases where it's not obvious what is wrong.
- Double check your config file, then triple check it.
- Read the logs carefully when starting Butler SOS.
- Use verbose logging: If you need more details, start Butler SOS with the
--loglevel verboseor even--loglevel debugoptions to get more details on what's going on. - Get help: If things still don't work you can post a question in the Butler SOS forums.
By sharing your installation and upgrade challenges/issues you enable future improvements, which will benefit both yourself and others.
Next Steps
After a successful upgrade:
- Review the configuration reference
- Check out new features in the release notes
- Explore examples and dashboards