From e79f1b070dde00ddaee4d3bc578029711903d799 Mon Sep 17 00:00:00 2001 From: Maurus Decimus <11444311+mdecimus@users.noreply.github.com> Date: Mon, 20 Apr 2026 19:58:55 +0200 Subject: [PATCH] Migration script: Fix error fetching /api/principal in community edition --- CHANGELOG.md | 2 +- resources/scripts/migrate_v016.py | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 32fb7f58..c6bfa67e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). -## [0.16.0] - 2026-XX-XX +## [0.16.0] - 2026-04-20 This version includes **multiple breaking changes**. If you are upgrading from v0.15.x and below, please read the [upgrading documentation](https://github.com/stalwartlabs/stalwart/blob/main/UPGRADING/v0_16.md) for more information on how to upgrade from previous versions. diff --git a/resources/scripts/migrate_v016.py b/resources/scripts/migrate_v016.py index c1977742..ce08b4bc 100644 --- a/resources/scripts/migrate_v016.py +++ b/resources/scripts/migrate_v016.py @@ -239,10 +239,18 @@ def cmd_dump(args: argparse.Namespace) -> int: file=sys.stderr) print("Listing principals...", file=sys.stderr) - names = client.list_principal_names() - print(f" found {len(names)} principals across all types", file=sys.stderr) - + names: list[tuple[str, str]] = [] principals: list[dict[str, Any]] = [] + try: + names = client.list_principal_names() + except ApiError as exc: + print(f" WARN could not list principals: {exc}", file=sys.stderr) + print(" skipping principal dump (continuing without principals)", + file=sys.stderr) + else: + print(f" found {len(names)} principals across all types", + file=sys.stderr) + for i, (typ, name) in enumerate(names, 1): try: full = client.get_principal(name)