Bug 2238590

Summary: RFE: Upgrade databases on update
Product: [Fedora] Fedora Reporter: Orion Poplawski <orion>
Component: buildbotAssignee: Gwyn Ciesla <gwync>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: rawhideCC: besser82, dradez, giallu, gwync, igor.raits, ngompa13, smilner, tflink
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: buildbot-3.9.2-3.fc37 buildbot-3.9.2-3.fc38 buildbot-3.9.2-3.fc39 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-10-08 02:09:12 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Orion Poplawski 2023-09-12 15:49:10 UTC
After updating to buildbot 3.9.0, the buildbot master service would not start:

2023-09-12 05:12:05-0700 [-] Starting BuildMaster -- buildbot.version: 3.9.0
2023-09-12 05:12:05-0700 [-] Loading configuration from '/var/lib/buildbot/master/gpsii/master.cfg'
2023-09-12 05:12:05-0700 [-] Setting up database with URL 'sqlite:/state.sqlite'
2023-09-12 05:12:05-0700 [-] setting database journal mode to 'wal'
2023-09-12 05:12:05-0700 [-] The Buildmaster database needs to be upgraded before this version of
2023-09-12 05:12:05-0700 [-] buildbot can run.  Use the following command-line
2023-09-12 05:12:05-0700 [-] 
2023-09-12 05:12:05-0700 [-]     buildbot upgrade-master /var/lib/buildbot/master/gpsii
2023-09-12 05:12:05-0700 [-] 
2023-09-12 05:12:05-0700 [-] to upgrade the database, and try starting the buildmaster again.  You may
2023-09-12 05:12:05-0700 [-] want to make a backup of your buildmaster before doing so.
2023-09-12 05:12:05-0700 [-] BuildMaster startup failed

Perhaps a scheme for automatically updating the configured services could be created?

Reproducible: Always

Comment 1 Gwyn Ciesla 2023-09-13 19:45:33 UTC
What about something like this?

We compile a list of master enabled with the following:

find /etc/systemd/system/multi-user.target.wants/ -type l -name 'buildbot-master*service' | cut -d '@' -f 2 | cut -d '.' -f 1

We can then loop over that to stop the master, upgrade, and start it again.

We could do something similar with workers.

Comment 2 Orion Poplawski 2023-09-14 03:27:51 UTC
Can we use systemctl commands?

systemctl list-units 'buildbot-master@*.service' --all --plain --no-legend

buildbot-master loaded active running Buildbot master instance

I don't think anything needs to be done for the workers, but I may be wrong there.

Otherwise, seems like a good plan.

Comment 3 Gwyn Ciesla 2023-09-28 21:25:21 UTC
Good idea.

The workers need a restart, but no DB upgrade.

Comment 4 Fedora Update System 2023-09-29 14:56:41 UTC
FEDORA-2023-36f36e6ed3 has been submitted as an update to Fedora 38. https://bodhi.fedoraproject.org/updates/FEDORA-2023-36f36e6ed3

Comment 5 Fedora Update System 2023-09-29 14:56:43 UTC
FEDORA-2023-5b38626e43 has been submitted as an update to Fedora 37. https://bodhi.fedoraproject.org/updates/FEDORA-2023-5b38626e43

Comment 6 Fedora Update System 2023-09-30 03:31:18 UTC
FEDORA-2023-830604bbe5 has been pushed to the Fedora 39 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-830604bbe5`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-830604bbe5

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 7 Fedora Update System 2023-09-30 04:46:08 UTC
FEDORA-2023-36f36e6ed3 has been pushed to the Fedora 38 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-36f36e6ed3`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-36f36e6ed3

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 8 Fedora Update System 2023-09-30 05:54:29 UTC
FEDORA-2023-5b38626e43 has been pushed to the Fedora 37 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-5b38626e43`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-5b38626e43

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 9 Fedora Update System 2023-10-08 02:09:12 UTC
FEDORA-2023-5b38626e43 has been pushed to the Fedora 37 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 10 Fedora Update System 2023-10-08 02:47:34 UTC
FEDORA-2023-36f36e6ed3 has been pushed to the Fedora 38 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 11 Fedora Update System 2023-11-03 18:25:20 UTC
FEDORA-2023-830604bbe5 has been pushed to the Fedora 39 stable repository.
If problem still persists, please make note of it in this bug report.