Landscape-server upgrade failed

Ubuntu Version:
VM is on 22.04 LTS

Problem Description:
I was patching our selfhosted landscape-server today and the upgrade failed.
This is the upgrade log:

2025-10-28 08:09:12.506Z INFO landscape-setup "Bootstrapping from service.conf file ..."
2025-10-28 08:09:12.517Z INFO landscape-setup "Skipping configuration migration ..."
2025-10-28 08:09:12.517Z INFO landscape-setup "Checking Landscape databases ..."
2025-10-28 08:09:12.527Z INFO landscape-setup "Checking database schema ..."
gpg: WARNING: no command supplied. Trying to guess what you mean ...
gpg: signature verification suppressed
2025-10-28 08:09:12.852Z INFO landscape-setup "Schema configuration output:\n\nLoading site configuration...\nSetting up database schemas (will timeout after 86400 seconds) ...\nSchema patch
version: 502\n"
2025-10-28 08:09:12.853Z INFO landscape-setup "Checking package database initial data ..."
2025-10-28 08:09:12.864Z INFO landscape-setup "Package database already initialized."
2025-10-28 08:09:12.864Z INFO landscape-setup "Renaming stock hash-id stores ..."
2025-10-28 08:09:12.864Z INFO landscape-setup "Stock package database not loaded, ignoring stock hash-id stores."
Job for landscape-appserver.service failed because the control process exited with error code.
See "systemctl status landscape-appserver.service" and "journalctl -xeu landscape-appserver.service" for details.
invoke-rc.d: initscript landscape-appserver, action "start" failed.
x landscape-appserver.service - LSB: Enable Landscape frontend UI
Loaded: loaded (/etc/init.d/landscape-appserver; generated)
Active: failed (Result: exit-code) since Tue 2025-10-28 09:09:17 CET; 6ms ago
Docs: man:systemd-sysv-generator(8)
Process: 3341119 ExecStart=/etc/init.d/landscape-appserver start (code=exited, status=1/FAILURE)
CPU: 3.552s

Oct 28 09:09:16 P5-AC-LNDSCP landscape-appserver[3341139]: Failed to load application: File "/opt/canonical/landscape/canonical/landscape/ui/snap/configure.zcml", line 7.4-9.47
Oct 28 09:09:16 P5-AC-LNDSCP landscape-appserver[3341139]: File "/opt/canonical/landscape/configs/standalone/landscape.zcml", line 9.4-9.48
Oct 28 09:09:16 P5-AC-LNDSCP landscape-appserver[3341139]: File "/opt/canonical/landscape/configs/standalone/landscape-configure.zcml", line 11.0-11.44
Oct 28 09:09:16 P5-AC-LNDSCP landscape-appserver[3341139]: File "/opt/canonical/landscape/canonical/landscape/ui/configure.zcml", line 27.2-27.29
Oct 28 09:09:16 P5-AC-LNDSCP landscape-appserver[3341139]: ImportError: cannot import name 'ConfigDict' from 'pydantic' (/usr/lib/python3/dist-packages/pydantic/init.py)
Oct 28 09:09:17 P5-AC-LNDSCP landscape-appserver[3341119]: ...fail!
Oct 28 09:09:17 P5-AC-LNDSCP systemd[1]: landscape-appserver.service: Control process exited, code=exited, status=1/FAILURE
Oct 28 09:09:17 P5-AC-LNDSCP systemd[1]: landscape-appserver.service: Failed with result 'exit-code'.
Oct 28 09:09:17 P5-AC-LNDSCP systemd[1]: Failed to start LSB: Enable Landscape frontend UI.
Oct 28 09:09:17 P5-AC-LNDSCP systemd[1]: landscape-appserver.service: Consumed 3.552s CPU time.
dpkg: error processing package landscape-server (--configure):
installed landscape-server package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of landscape-server-quickstart:
landscape-server-quickstart depends on landscape-server (>= 24.04.11-0landscape0); however:
Package landscape-server is not configured yet.

dpkg: error processing package landscape-server-quickstart (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
Errors were encountered while processing:
landscape-server
landscape-server-quickstart
needrestart is being skipped since dpkg has failed
E: Sub-process /usr/bin/dpkg returned an error code (1)

After reverting to get the service back up, all of the devices started to show up as “Computers needing authorization
There are 20 computers waiting for your authorization.”

This is not great since each of them now has to be admitted and connected to its previous hostname (clones).

This seems to be another problem, reverting the VM snapshot breaks server-client completely.

Why is it happening and is there a way to re-admit the devices faster?
API is showing this option but mapping them correctly to each other seems like a nightmare.
[–existing-ids ] [–access-group ]