Page MenuHomeSoftware Heritage

Migrate bojimans (netbox) to bullseye
Closed, MigratedEdits Locked

Description

Migrate the inventory (netbox) server to bullseye.

Plan:

  • Check in vagrant everything is fine...
  • Point of attention, netbox service relies on python3-venv, so we need to rebuild the venv after the upgrade
  • Actual migration [1]
  • Recreate the venv with the new python3 version (3.9) and ensure the netbox service starts ok
  • Fix whatever is broken (puppet agent --test is failing after reboot for some reasons)
  • Inventory update for that node

[1]

task=T3802
puppet agent --test
cd /etc
git add .
git commit -m "Commit left-over change prior to trigger dist-upgrade to bullseye"
# finally disable puppet
puppet agent --disable "$task: dist-upgrade to bullseye"
$CMD install -y python3  # keep python3.7 around during migration
sed -i -e 's/buster/bullseye/;s,bullseye/updates,bullseye-security,' /etc/apt/sources.list.d/*
git status
git diff
grep bullseye-security /etc/apt/sources.list.d/debian-security.list
git add .
git commit -m "$task: Migrate sources.list to bullseye"
apt update
CMD="apt -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confold"
export DEBIAN_FRONTEND=noninteractive
$CMD upgrade -y
$CMD dist-upgrade -y
rm -rf /opt/netbox/.upgrade_done
/opt/netbox/upgrade.sh  # will rebuild the venv
systemctl status netbox  # should still be ok
reboot

Event Timeline

vsellier triaged this task as Normal priority.Dec 13 2021, 11:56 AM
vsellier created this task.
ardumont renamed this task from upgrade bojimans(netbox) to bullseye to upgrade bojimans (netbox) to bullseye.Dec 13 2021, 4:49 PM
ardumont updated the task description. (Show Details)

"un coup ds l'eau" I failed the migration and reverted the node to the snapshot i took prior to the migration [1].

I'll dig in further but already, here goes the hints for tomorrow:

  • netbox is installed through a venv (I missed that the first time)
  • pin python3.7 version to keep the venv working after migration...

[1] I did not realize through vagrant as i have other issues with it and i tried

ardumont renamed this task from upgrade bojimans (netbox) to bullseye to Migrate bojimans (netbox) to bullseye.Dec 14 2021, 11:12 AM
  • Fix whatever is broken (puppet agent --test is failing after reboot for some reasons)
root@bojimans:~# puppet agent --test
Info: Using configured environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Retrieving locales
Info: Loading facts
Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Function Call, No preferred version defined or automatically detected. (file: /etc/puppet/code/environments/production/modules/postgresql/manifests/globals.pp, line: 228, column: 5) on node bojimans.internal.softwareheritage.org
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run

Fix pushed and deployed. Puppet agent unstuck [1].

The task can be closed.

root@bojimans:~# puppet agent --enable; puppet agent --test
Info: Using configured environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Retrieving locales
Info: Loading facts
Info: Caching catalog for bojimans.internal.softwareheritage.org
Info: Applying configuration version '1639489174'
Notice: /Stage[main]/Profile::Icinga2::Apt_config/Apt::Source[icinga-stable-release]/Apt::Setting[list-icinga-stable-release]/File[/etc/apt/sources.list.d/icinga-stable-release.list]/content:
--- /etc/apt/sources.list.d/icinga-stable-release.list  2021-12-14 10:34:14.272197969 +0000
+++ /tmp/puppet-file20211214-12402-1kaltb2      2021-12-14 13:39:48.343107216 +0000
@@ -1,3 +1,3 @@
 # This file is managed by Puppet. DO NOT EDIT.
 # icinga-stable-release
-deb http://packages.icinga.com/debian icinga-buster main
+deb http://packages.icinga.com/debian icinga-bullseye main

Info: Computing checksum on file /etc/apt/sources.list.d/icinga-stable-release.list
Info: /Stage[main]/Profile::Icinga2::Apt_config/Apt::Source[icinga-stable-release]/Apt::Setting[list-icinga-stable-release]/File[/etc/apt/sources.list.d/icinga-stable-release.list]: Filebucketed /etc/apt/sources.list.d/icinga-stable-release.list to puppet with sum 4c454cae4c26eee78d089c5038f7aa04
Notice: /Stage[main]/Profile::Icinga2::Apt_config/Apt::Source[icinga-stable-release]/Apt::Setting[list-icinga-stable-release]/File[/etc/apt/sources.list.d/icinga-stable-release.list]/content: content changed '{md5}4c454cae4c26eee78d089c5038f7aa04' to '{md5}fe5dbd7310994bfefc9fc63c2715b86e'
Info: /Stage[main]/Profile::Icinga2::Apt_config/Apt::Source[icinga-stable-release]/Apt::Setting[list-icinga-stable-release]/File[/etc/apt/sources.list.d/icinga-stable-release.list]: Scheduling refresh of Class[Apt::Update]
Info: Computing checksum on file /etc/apt/preferences.d/swh-backported-packages.pref
Info: /Stage[main]/Profile::Swh::Apt_config::Backports/Apt::Pin[swh-backported-packages]/Apt::Setting[pref-swh-backported-packages]/File[/etc/apt/preferences.d/swh-backported-packages.pref]: Filebucketed /etc/apt/preferences.d/swh-backported-packages.pref to puppet with sum a4805753567feb59c7323d2b3cd8c64e
Notice: /Stage[main]/Profile::Swh::Apt_config::Backports/Apt::Pin[swh-backported-packages]/Apt::Setting[pref-swh-backported-packages]/File[/etc/apt/preferences.d/swh-backported-packages.pref]/ensure: removed                                Notice: /Stage[main]/Profile::Swh::Apt_config/Apt::Source[debian]/Apt::Setting[list-debian]/File[/etc/apt/sources.list.d/debian.list]/content:
--- /etc/apt/sources.list.d/debian.list 2021-12-14 10:34:14.304203479 +0000                                                                                                                                                                    +++ /tmp/puppet-file20211214-12402-13dd3pl      2021-12-14 13:39:48.415107453 +0000
@@ -1,3 +1,3 @@
 # This file is managed by Puppet. DO NOT EDIT.
 # debian
-deb http://deb.debian.org/debian/ buster main
+deb http://deb.debian.org/debian/ bullseye main

Info: Computing checksum on file /etc/apt/sources.list.d/debian.list
Info: /Stage[main]/Profile::Swh::Apt_config/Apt::Source[debian]/Apt::Setting[list-debian]/File[/etc/apt/sources.list.d/debian.list]: Filebucketed /etc/apt/sources.list.d/debian.list to puppet with sum 6ddde35c41380a75cfff67656683f341
Notice: /Stage[main]/Profile::Swh::Apt_config/Apt::Source[debian]/Apt::Setting[list-debian]/File[/etc/apt/sources.list.d/debian.list]/content: content changed '{md5}6ddde35c41380a75cfff67656683f341' to '{md5}ec46afc7765bc77091e7494dbc1b9780'
Info: /Stage[main]/Profile::Swh::Apt_config/Apt::Source[debian]/Apt::Setting[list-debian]/File[/etc/apt/sources.list.d/debian.list]: Scheduling refresh of Class[Apt::Update]
Notice: /Stage[main]/Profile::Swh::Apt_config/Apt::Source[debian-updates]/Apt::Setting[list-debian-updates]/File[/etc/apt/sources.list.d/debian-updates.list]/content:
--- /etc/apt/sources.list.d/debian-updates.list 2021-12-14 10:34:14.324206922 +0000
+++ /tmp/puppet-file20211214-12402-177n65l      2021-12-14 13:39:48.519107796 +0000                                                                                                                                                            @@ -1,3 +1,3 @@
 # This file is managed by Puppet. DO NOT EDIT.
 # debian-updates
-deb http://deb.debian.org/debian/ buster-updates main
+deb http://deb.debian.org/debian/ bullseye-updates main

Info: Computing checksum on file /etc/apt/sources.list.d/debian-updates.list
Info: /Stage[main]/Profile::Swh::Apt_config/Apt::Source[debian-updates]/Apt::Setting[list-debian-updates]/File[/etc/apt/sources.list.d/debian-updates.list]: Filebucketed /etc/apt/sources.list.d/debian-updates.list to puppet with sum 6f4f271cba6ca2d545ef4a11e8079c7b
Notice: /Stage[main]/Profile::Swh::Apt_config/Apt::Source[debian-updates]/Apt::Setting[list-debian-updates]/File[/etc/apt/sources.list.d/debian-updates.list]/content: content changed '{md5}6f4f271cba6ca2d545ef4a11e8079c7b' to '{md5}3df5075ecb38588de2d4af11148a591f'
Info: /Stage[main]/Profile::Swh::Apt_config/Apt::Source[debian-updates]/Apt::Setting[list-debian-updates]/File[/etc/apt/sources.list.d/debian-updates.list]: Scheduling refresh of Class[Apt::Update]
Notice: /Stage[main]/Profile::Swh::Apt_config/Apt::Source[debian-security]/Apt::Setting[list-debian-security]/File[/etc/apt/sources.list.d/debian-security.list]/content:
--- /etc/apt/sources.list.d/debian-security.list        2021-12-14 10:34:14.344210367 +0000
+++ /tmp/puppet-file20211214-12402-2lmr8a       2021-12-14 13:39:48.543107876 +0000
@@ -1,3 +1,3 @@
 # This file is managed by Puppet. DO NOT EDIT.                                                                                                                                                                                                 # debian-security
-deb http://deb.debian.org/debian-security/ buster/updates main                                                                                                                                                                                +deb http://deb.debian.org/debian-security/ bullseye-security main

Info: Computing checksum on file /etc/apt/sources.list.d/debian-security.list
Info: /Stage[main]/Profile::Swh::Apt_config/Apt::Source[debian-security]/Apt::Setting[list-debian-security]/File[/etc/apt/sources.list.d/debian-security.list]: Filebucketed /etc/apt/sources.list.d/debian-security.list to puppet with sum 1ec3fdb08c4e0040080ef98bd5c32d26
Notice: /Stage[main]/Profile::Swh::Apt_config/Apt::Source[debian-security]/Apt::Setting[list-debian-security]/File[/etc/apt/sources.list.d/debian-security.list]/content: content changed '{md5}1ec3fdb08c4e0040080ef98bd5c32d26' to '{md5}61e7e51539cfd274dac46fd7fad658d4'
Info: /Stage[main]/Profile::Swh::Apt_config/Apt::Source[debian-security]/Apt::Setting[list-debian-security]/File[/etc/apt/sources.list.d/debian-security.list]: Scheduling refresh of Class[Apt::Update]
Notice: /Stage[main]/Profile::Swh::Apt_config/Apt::Source[softwareheritage]/Apt::Setting[list-softwareheritage]/File[/etc/apt/sources.list.d/softwareheritage.list]/content:
--- /etc/apt/sources.list.d/softwareheritage.list       2021-12-14 10:34:14.364213810 +0000
+++ /tmp/puppet-file20211214-12402-lgs5gb       2021-12-14 13:39:48.563107941 +0000
@@ -1,3 +1,3 @@
 # This file is managed by Puppet. DO NOT EDIT.
 # Software Heritage specific package repository
-deb [trusted=yes] https://debian.softwareheritage.org/ buster-swh main                                                                                                                                                                        +deb [trusted=yes] https://debian.softwareheritage.org/ bullseye-swh main

Info: Computing checksum on file /etc/apt/sources.list.d/softwareheritage.list
Info: /Stage[main]/Profile::Swh::Apt_config/Apt::Source[softwareheritage]/Apt::Setting[list-softwareheritage]/File[/etc/apt/sources.list.d/softwareheritage.list]: Filebucketed /etc/apt/sources.list.d/softwareheritage.list to puppet with sum 1a2f771433b000dc6281c921f4b317b3
Notice: /Stage[main]/Profile::Swh::Apt_config/Apt::Source[softwareheritage]/Apt::Setting[list-softwareheritage]/File[/etc/apt/sources.list.d/softwareheritage.list]/content: content changed '{md5}1a2f771433b000dc6281c921f4b317b3' to '{md5}4a171760bb752c91af408364c7602d2b'
Info: /Stage[main]/Profile::Swh::Apt_config/Apt::Source[softwareheritage]/Apt::Setting[list-softwareheritage]/File[/etc/apt/sources.list.d/softwareheritage.list]: Scheduling refresh of Class[Apt::Update]
Notice: /Stage[main]/Profile::Postgresql::Apt_config/Apt::Source[pgdg]/Apt::Setting[list-pgdg]/File[/etc/apt/sources.list.d/pgdg.list]/content:
--- /etc/apt/sources.list.d/pgdg.list   2021-12-14 10:34:14.404220698 +0000
+++ /tmp/puppet-file20211214-12402-1qf5y6f      2021-12-14 13:39:48.595108048 +0000
@@ -1,3 +1,3 @@
 # This file is managed by Puppet. DO NOT EDIT.
 # pgdg
-deb https://apt.postgresql.org/pub/repos/apt/ buster-pgdg main
+deb https://apt.postgresql.org/pub/repos/apt/ bullseye-pgdg main

Info: Computing checksum on file /etc/apt/sources.list.d/pgdg.list
Info: /Stage[main]/Profile::Postgresql::Apt_config/Apt::Source[pgdg]/Apt::Setting[list-pgdg]/File[/etc/apt/sources.list.d/pgdg.list]: Filebucketed /etc/apt/sources.list.d/pgdg.list to puppet with sum 33f3e4dfd60c941c575a1e0bfcee3050
Notice: /Stage[main]/Profile::Postgresql::Apt_config/Apt::Source[pgdg]/Apt::Setting[list-pgdg]/File[/etc/apt/sources.list.d/pgdg.list]/content: content changed '{md5}33f3e4dfd60c941c575a1e0bfcee3050' to '{md5}3be9967828a10378c1a774a94f4f1f4b'
Info: /Stage[main]/Profile::Postgresql::Apt_config/Apt::Source[pgdg]/Apt::Setting[list-pgdg]/File[/etc/apt/sources.list.d/pgdg.list]: Scheduling refresh of Class[Apt::Update]
Notice: /Stage[main]/Apt::Backports/Apt::Source[backports]/Apt::Pin[backports]/Apt::Setting[pref-backports]/File[/etc/apt/preferences.d/backports.pref]/content:
--- /etc/apt/preferences.d/backports.pref       2020-10-01 12:21:09.517425053 +0000
+++ /tmp/puppet-file20211214-12402-1mz98sz      2021-12-14 13:39:48.691108364 +0000
@@ -1,5 +1,5 @@
 # This file is managed by Puppet. DO NOT EDIT.
 Explanation: apt: backports
 Package: *
-Pin: release a=buster-backports
+Pin: release a=bullseye-backports
 Pin-Priority: 100

Info: Computing checksum on file /etc/apt/preferences.d/backports.pref
Info: /Stage[main]/Apt::Backports/Apt::Source[backports]/Apt::Pin[backports]/Apt::Setting[pref-backports]/File[/etc/apt/preferences.d/backports.pref]: Filebucketed /etc/apt/preferences.d/backports.pref to puppet with sum 8b23afda48fb6f44f763dd760315d974
Notice: /Stage[main]/Apt::Backports/Apt::Source[backports]/Apt::Pin[backports]/Apt::Setting[pref-backports]/File[/etc/apt/preferences.d/backports.pref]/content: content changed '{md5}8b23afda48fb6f44f763dd760315d974' to '{md5}d41347bc7d8b49b57450805369b05dd1'
Notice: /Stage[main]/Apt::Backports/Apt::Source[backports]/Apt::Setting[list-backports]/File[/etc/apt/sources.list.d/backports.list]/content:
--- /etc/apt/sources.list.d/backports.list      2021-12-14 10:34:14.528242051 +0000
+++ /tmp/puppet-file20211214-12402-1yfy1j9      2021-12-14 13:39:48.715108443 +0000
@@ -1,3 +1,3 @@
 # This file is managed by Puppet. DO NOT EDIT.
 # backports
-deb http://deb.debian.org/debian/ buster-backports main
+deb http://deb.debian.org/debian/ bullseye-backports main

Info: Computing checksum on file /etc/apt/sources.list.d/backports.list
Info: /Stage[main]/Apt::Backports/Apt::Source[backports]/Apt::Setting[list-backports]/File[/etc/apt/sources.list.d/backports.list]: Filebucketed /etc/apt/sources.list.d/backports.list to puppet with sum 5936718623f0443d655149a707471e39
Notice: /Stage[main]/Apt::Backports/Apt::Source[backports]/Apt::Setting[list-backports]/File[/etc/apt/sources.list.d/backports.list]/content: content changed '{md5}5936718623f0443d655149a707471e39' to '{md5}3dd4342012607031174752767513ac53'
Info: /Stage[main]/Apt::Backports/Apt::Source[backports]/Apt::Setting[list-backports]/File[/etc/apt/sources.list.d/backports.list]: Scheduling refresh of Class[Apt::Update]
Info: Class[Apt::Update]: Scheduling refresh of Exec[apt_update]
Notice: /Stage[main]/Apt::Update/Exec[apt_update]: Triggered 'refresh' from 1 event
Notice: Applied catalog in 10.97 seconds
ardumont changed the task status from Open to Work in Progress.Dec 14 2021, 2:42 PM
ardumont closed this task as Resolved.
ardumont claimed this task.
ardumont updated the task description. (Show Details)