@page "/servizio" @layout ServiceLayout @attribute [AllowAnonymous] @inject AnubisHost Host @inject IClock Clock @* The error page of SPEC 15.1: what is wrong, what to do, and the engine stays off. Never another database. *@ @ServiceText.Title(_status.Mode) · Anubis @if (_refresh) { }

@ServiceText.Title(_status.Mode)

@switch (_status.Mode) { case HostMode.Starting:

Controllo configurazione e database. Questa pagina si aggiorna da sola.

break; case HostMode.ConfigProblem:

Il motore resta spento finché la configurazione non è completa. Non uso nessun altro database al posto di quello indicato.

@foreach (var problem in Host.Config.Problems) { }
VoceCosa non vaCome rimediare
@problem.Setting@problem.What@problem.Remedy

Le variabili si cambiano nella configurazione del container (su Unraid, nei campi del modello), poi si riavvia il container.

break; case HostMode.DatabaseUnavailable:

Il motore è fermo e aspetta il database. Non apro un altro database al suo posto: riprovo da solo ogni pochi secondi e riparto appena risponde.

Database
@Host.Config.Db?.Describe()
Risposta
@(_status.Detail ?? "nessuna")
Tentativi
@_status.Attempts, dal @Format.ShortDate(_status.Since, Clock.UtcNow, Host.Config.TimeZone)

Cosa controllare

break; case HostMode.SchemaProblem:

@_status.Detail

@if (Host.MigrationFailed is not null) { var copies = new Backups(Host.Config.Data, Clock).List();

Il motore resta spento. @if (copies.Count > 0) { L'ultimo salvataggio è @copies[0].Name, in @Host.Config.Data.Backups: per tornarci, indica nella configurazione un database nuovo e vuoto e sceglilo in questa pagina. } Se il problema è passeggero (spazio sul disco, permessi), risolvilo e riprova.

break; }

Per non rovinare i dati il motore resta spento. Aggiorna Anubis alla versione che ha creato questo database, oppure ripristina un salvataggio in un database vuoto.

break; case HostMode.IdentityProblem: break; } @if (Errore is { } errore) { } @code { private HostStatus _status = null!; private bool _refresh; [CascadingParameter] public HttpContext? HttpContext { get; set; } [SupplyParameterFromQuery(Name = "errore")] public string? Errore { get; set; } protected override void OnInitialized() { _status = Host.Status; _refresh = _status.Mode is HostMode.Starting or HostMode.DatabaseUnavailable or HostMode.ConfigProblem; if (HttpContext is not null) { if (!HttpContext.Response.HasStarted) { HttpContext.Response.StatusCode = StatusCodes.Status503ServiceUnavailable; HttpContext.Response.Headers.CacheControl = "no-store"; HttpContext.Response.Headers.RetryAfter = "5"; } } } }