Pilot migration UI and sandbox: scenario check for v1.0.0-beta

Checked on 2026-11-17 against Pilot develop at f2459a11. Live tests ran on an Ubuntu 26.04 test server (4 vCPU, 15 GB RAM).

Pilot has a new update and migration UI, and a new workload sandbox. Before the v1.0.0-beta release, this page checks two things:

Each problem that I found has a pull request. A few problems need a decision first. They are in Open items.

Summary

36migration scenarios checked
5of them run live on the test server
12 / 12sites pass with the sandbox on (6 apps × v16 and nightly)
13Pilot pull requests open (#850–#862)

Live pass means that I ran the case on the test server. Unit test means that a test in the Pilot suite covers the case. Fixed means that the case was broken and a pull request fixes it. Gap means that the case is not handled yet.

How the migration workflow works

An update or a site migration is a migration operation. The operation is a JSON record in <bench>/migrations/. It holds the state, the sites, the app revisions and the recovery data. Small tasks do the work, one step at a time. After each step, the operation selects the next task.

The normal path is: preparing → backing_up (one task per site) → updating (one task) → migrating (one task per site) → completed. When a step fails, the operation stops in needs_attention. The user can then choose Retry, Skip patch, Restore or Dismiss. While the backups run, the user can also choose Stop.

Sources: docs/migration.md, pilot/core/bench/migration/, and the UI in admin/frontend/dashboard/src/pages/updates/.

Migration scenarios

Normal path

#ScenarioWhat Pilot doesStatus
1Update apps that change the schemaBacks up each affected site, updates the apps, migrates each site, restarts the services.Unit test
2Update apps with no migrate changesSkips backup and migrate. Updates the apps, rebuilds assets, restarts. The dialog hides the backup option.Unit test
3Update some apps on a bench with many sitesBacks up and migrates only the sites that have a selected app. A site whose apps are unknown is included.Unit test
4Migrate one site with safeguardsBackup, migrate, complete. The site leaves maintenance mode.Live pass (sandboxed v16, CRM)
5Migrate one site in place (no safeguards)No backup, so no Restore later.Unit test
6Switch an app's branch on a bench with sitesSwitches the code, then queues a site migration with backups. The migration takes over the switch task's locks.Unit test
7The disk cannot hold the backupsRefuses before any site enters maintenance (HTTP 507).Unit test
8Backups go to S3Streams the MariaDB table dumps to the bucket. The disk check counts only local backups.Unit test
9Background jobs are still runningWaits up to 300 s before each step. If the jobs do not finish, it pauses before the step starts.Unit test
10Web restart around maintenance modeRestarts web once after maintenance turns on and once after it turns off. A failed restart pauses the operation.Unit test
11A second update while one is unresolvedRefuses the second update (409).Unit test

Failures

#ScenarioWhat Pilot doesStatus
12A backup failsPauses in needs_attention and returns every site to its old maintenance settings. Retry takes all backups again.Unit test
13App fetch, validation, install or build failsNo site data has changed, so Pilot reverts the apps by itself and ends in reverted.Unit test
14A site migrate fails on a patchPauses in needs_attention. The site stays in maintenance. The UI shows the failing patch and the output.Live pass (v16 and nightly, LMS, test patch)
15The final service restart failsPauses. Retry restarts the services again and does not migrate the sites again.Unit test
16A task is killed, or its process diesThe task's callback pauses the operation with "The task stopped before it finished".Unit test
17A killed migrate had changed some tablesKeeps the list of touched tables, so Restore puts them back.Unit test
18The operation fails to start (for example, a branch switch with too little disk space)Before the fix: the record stayed in preparing. That blocked every new update and every backup of its sites. No UI action could close it. The app also stayed on the new branch.Fixed: #859
19A backup fails after a branch switchBefore the fix: Pilot took the sites out of maintenance. They then served the new code on a database that was not migrated.Fixed: #860

Recovery actions

#ScenarioWhat Pilot doesStatus
20RetryRuns the failed step again. Sites that already succeeded are not migrated again.Unit test
21Skip patchOnly for the diagnosed patch. Marks the patch as done, and the migration continues by itself.Live pass (nightly, LMS)
22Skip patch with an old patch nameRefuses (409). The name must match the current diagnosis.Unit test
23RestoreReverts the apps, restores the touched tables, drops the tables that the migration made, then restarts. The site leaves maintenance.Live pass (v16, LMS: the table that the test patch made was removed)
24Restore with a missing or bad backup fileChecks every dump before it imports any.Unit test
25Restore fails part wayGoes to revert_failed. Restore again resumes from the last checkpoint.Unit test
26Restore when the list of touched tables is not trustedRestores every table in the backup.Unit test
27Restore after a site was dropped or an app was removedSkips them. Nothing is left to restore.Unit test
28DismissRestarts on the code that is on disk, lifts maintenance, deletes the backups, and keeps the record as history.Unit test
29Dismiss while the update runs, or when the restart failsRefuses while it runs. A failed restart keeps the operation open.Unit test
30Stop during backupsCancels the backup task, deletes the backups taken so far, lifts maintenance and ends in stopped.Live pass (nightly, ERPNext)
31Stop after the update started, or after a branch switchRefuses (409). The code has changed.Unit test
32Stop while the chain queues its next taskCancels the queued task too, or withdraws the stop if that task already runs.Unit test
33A stopped update's detail pageShows the interrupted backup as stopped, not as running.Code check (UpdateFlow.vue)
34Buttons shown in each stateRetry only in needs_attention. Skip patch only with a diagnosed patch. Restore only when every site has a backup. Stop only while backing up. Dismiss from the alert.Code check
35Restore after a branch-switch backup failureRestore needs a backup of every site, so it is not offered. The user can only Retry or Dismiss. They cannot return the app to its old branch from the UI.Gap
36Docs for the UIdocs/migration.md pointed to the removed pages/migrations/, and its Closed tab did not include stopped.Fixed: #862

Sandbox

The sandbox runs each workload process (web, workers, redis) with an empty home folder, without the other benches, and with a read-only system. A new systemd bench has the sandbox on by default. Before Pilot writes the units, it starts a trial unit. If the trial fails, Pilot runs the bench without the sandbox and only logs a warning.

Finding: the sandbox never runs on Ubuntu 24.04 and later

Ubuntu 24.04 and 26.04 set kernel.apparmor_restrict_unprivileged_userns = 1. systemd then cannot make the user namespace that the sandbox needs, and the trial fails with exit code 226. On the test server both benches ran without the sandbox, and no one saw a warning.

An AppArmor profile that lets systemd-executor make user namespaces fixes this. With that profile, both benches started in the sandbox. #861 adds the profile to install.sh. It is a draft, because the profile applies to the whole host. See Open items.

Apps with the sandbox on

Both benches are in production mode (systemd, nginx, lite mode) with sandbox = true. Each check ran on each site:

AppBenchPagesLogged inJobMigrateApps on the site
ERPNextv16passpasspasspassfrappe, erpnext
ERPNextnightlypasspasspasspassfrappe, erpnext
CRMv16passpasspasspassfrappe, crm
CRMnightlypasspasspasspassfrappe, crm, whatsapp
Helpdeskv16passpasspasspassfrappe, helpdesk, telephony
Helpdesknightlypasspasspasspassfrappe, helpdesk, telephony
Learning (LMS)v16passpasspasspassfrappe, lms, payments
Learning (LMS)nightlypasspasspasspassfrappe, lms, payments
Gameplanv16passpasspasspassfrappe, gameplan
Gameplannightlypasspasspasspassfrappe, gameplan
Builderv16passpasspasspassfrappe, builder
Buildernightlypasspasspasspassfrappe, builder

CRM's /crm gives 403 and ERPNext's /app gives 301 to a guest. These are the normal login redirects. As Administrator, all pages load. ERPNext v16 sends /app to /desk.

The migration workflow also works with the sandbox on: rows 4, 14, 21, 23 and 30 above ran on the sandboxed benches.

Finding: Helpdesk article search fails on Pilot

Helpdesk's knowledge-base search uses the RediSearch module (FT.SEARCH, FT.CREATE). Ubuntu 26.04 ships Redis 8.0.5 without that module, so helpdesk.api.article.search gives HTTP 500, and the search index job fails. The sandbox does not cause this. Article saves still work, because Helpdesk checks for the index first. To fix it, Pilot must run a Redis build that has the search module, for example from packages.redis.io. That choice affects licensing, so this page lists it as an open item.

Pull requests

PRWhat it fixesFound by
#850Ubuntu's mariadbd AppArmor profile blocks Pilot's MariaDB, so pilot init fails (issue #844). Keeps admin rules in local/mariadbd.Issue
#851The stdlib-only CLI has no PyMySQL, so every site-database read returned nothing (clone-site, install-app, restore, backups; issue #845). Queries now run with the bench's own driver. No new CLI dependency.Issue
#852clone-site writes no db_socket, so a clone can reach a system MariaDB (issue #846).Issue
#853Admin SQL batches time out after 5 s under load (issue #847).Issue
#854The prebuilt asset build does not check out required apps, so CRM develop has no prebuilt assets.App tests
#855get-app takes dependency ranges from an old marketplace entry, so nightly CRM installs whatsapp 1.1.1 and fails.App tests
#856Two benches that initialise at once race on MariaDB setup.App tests
#857Two benches that initialise at once race on the Admin frontend build (dev installs).App tests
#858get-app clones the whole app before it finds that the bench is not initialised.App tests
#859A migration that fails to start stays in preparing and blocks all updates (row 18).This check
#860A branch switch's sites leave maintenance when a backup fails (row 19).This check
#861 (draft)The sandbox never runs on Ubuntu 24.04 and later.This check
#862Migration docs point to the old UI files (row 36).This check

#853 and #856 both add a test at the end of tests/pilot/managers/test_mariadb_manager.py. The PR that merges second gets a small conflict.

Open items

ItemWhy it needs a decision
Decide Sandbox on Ubuntu (#861)The profile lets every service that systemd starts on the host make user namespaces again. That reopens part of what Ubuntu's restriction closes. The other options: leave the sandbox off on Ubuntu and document it, or make the installer step opt-in.
Decide Redis search moduleHelpdesk article search needs it. Ubuntu's Redis does not have it. A Redis build with the module comes with different license terms.
Gap Restore after a branch-switch backup failureRow 35. Restore could revert the app when no site has been migrated, without site backups. This needs a small change to can_revert and the restore chain.
Gap No CLI key for the sandboxpilot set-bench-config has no production.sandbox key, so the only way to turn the sandbox on or off is to edit bench.toml.

The app branches and release checks are on the earlier plan page: V2 app sign-ups on v16 and nightly.