Enterprise license lapse breaks the dashboard ("server temporarily unavailable"), and the metrics/tracing stores stay off after a successful renewal until a restart

Issue Description

When our Enterprise license lapsed, the metrics and tracing history stores went away at runtime. The web admin dashboard then showed only “This server is temporarily unavailable. Attempting this same operation later may succeed.” After the invoice was paid, the license renewed, but the stores stayed off until a restart. ReloadSettings did not bring them back.

Setup: 1.0.0 when this happened, the official aarch64-unknown-linux-gnu build, single node, RocksDB data store. MetricsStore and TracingStore are both Default, so they live in the data store, with 90 days of metrics history and 30 days of tracing history. We are on 1.0.3 now. I can’t reproduce a lapse on purpose, and the 1.0.1–1.0.3 notes mention only the tracing-index part (see below), so I assume the rest is unchanged.

Expected Behavior

  • On expiry, the server falls back to the Community feature set, as documented. The dashboard should say that metrics and tracing history need an Enterprise license, or hide those panels. It should not show a generic “temporarily unavailable” error, which reads like an outage of the whole server. (The repeating tracing-index error is already fixed in 1.0.2: “spans are discarded when no tracing store is configured”. Thank you!)
  • On a successful renewal, Enterprise features come back without a restart: the metrics and tracing stores in particular, or at least after ReloadSettings. If a restart is required, the renewal should log that, and log its success.

Actual Behavior

2026-10-31, times in UTC:

  1. The trial license expired at 07:05:20. The server kept trying to renew it and failed because the invoice was unpaid. That was a billing mix-up on our side and is sorted now.
  2. From 07:45 on, the dashboard showed only “This server is temporarily unavailable. Attempting this same operation later may succeed.” x:Metric/query and x:Trace/get failed with store.not-configured. Mail itself was not affected.
  3. After the invoice was paid, a renewal ran at 08:49:44 (Attempting to renew Enterprise license from license.stalw.art). It logged no outcome and scheduled no further retry. In the RenewLicense handler only a failure is logged (“renewal failed, retrying”), so it succeeded. The web UI showed the renewed license.
  4. The Metric and Trace queries still failed with store.not-configured at 09:33:20. A ReloadSettings action did not help.
  5. A restart at 09:34:48 fixed it. The license was reported valid until 2027-10-31, and the dashboard worked again.

Reproduction Steps

  1. Run with an Enterprise license and MetricsStore/TracingStore set to Default.
  2. Let the license expire without a successful renewal (here: an unpaid invoice).
  3. Open the web admin dashboard: “temporarily unavailable”; the log shows store.not-configured for x:Metric/query.
  4. Make the renewal succeed (pay the invoice), let the renewal task run, optionally run ReloadSettings.
  5. The dashboard still fails with store.not-configured until the server is restarted.

Relevant Log Output

07:45:14Z WARN  registry.build-warning objectType = "Enterprise", reason = "Failed to renew license: ... Invoice #… for subscription has not been paid"
07:45:14Z INFO  server.licensing details = "Enterprise license renewal failed, retrying", nextRetry = 07:50:14Z
07:45:49Z ERROR store.not-configured index = "tracing", details = "Failed to build document for indexing"   (repeats every few minutes)
08:49:44Z INFO  server.licensing details = "Attempting to renew Enterprise license from license.stalw.art"   (no outcome logged after this)
08:51:25Z ERROR store.not-configured listenerId = "https", causedBy = "crates/jmap/src/registry/mapping/telemetry.rs:501", causedBy = "x:Metric/query"
09:33:20Z ERROR store.not-configured listenerId = "http", causedBy = "crates/store/src/dispatch/store.rs:44", causedBy = "x:Trace/get"
09:34:48Z INFO  server.shutdown causedBy = "SIGINT"
09:34:50Z INFO  server.licensing details = "Stalwart Enterprise Edition license key is valid", validTo = "2027-10-31T07:05:20Z"

Stalwart Version

v1.x

Installation Method

Binary (Linux)

Database Backend

RocksDB

Blob Storage

Filesystem

Search Engine

Internal

Directory Backend

Internal

Additional Context

Related: topic 907 (July, a cluster, before 1.0). The staff reply there (#6) says a manual restart “isn’t strictly required”: a successful renewal reloads the enterprise config and metrics recording resumes. Here, on a single 1.0.0 node, the renewal did run and succeed, but the metrics and tracing stores stayed off until the restart.

A pointer, from reading v1.0.3. It is unverified, so please correct me:

  • metrics_store() (crates/common/src/storage/mod.rs) returns core.storage.metrics without any license check. So the store handle itself was None in the running core: storage had been rebuilt while the license was invalid.
  • The RenewLicense handler (crates/services/src/task_manager/scheduler.rs, about line 596) calls reload_registry(RegistryChange::Reload(ObjectType::Enterprise)). That brings back core.enterprise, but apparently not core.storage.metrics / core.storage.tracing. Those are built in Storage::parse → Store::build_metrics / build_tracing (crates/common/src/config/storage.rs, crates/store/src/build/data.rs), which seems to happen only at a full start.

Happy to provide more log detail if useful.

I have reviewed the documentation and FAQ and confirm that my issue is NOT addressed there.

on

I have searched this support forum (open and closed topics) and confirm this is not a duplicate.

on

I understand that topics in this category are triaged by a bot first but a human reply will follow up. If I’d prefer a human-only reply, I’ll add the no-ai tag to my topic.

on

Glob prefix seems off; retry.

Your reading of the source looks correct. I haven’t reproduced it, and I’m going from v1.0 source only.

Why the stores stay off

  • When Core::parse finds no valid Enterprise license, it sets storage.metrics = Store::None and storage.tracing = Store::None. It does the same with other Enterprise-only storage pieces such as sharded stores, read replicas and extra directories (crates/common/src/config/mod.rs, around line 104).
  • On a registry reload, the generic branch of Server::reload in crates/common/src/cache/reload.rs rebuilds Storage from the running core’s handles, not from the registry. It does metrics: storage.metrics.clone() and tracing: storage.tracing.clone().
  • Only Storage::parse (crates/common/src/config/storage.rs) calls Store::build_metrics and Store::build_tracing. That runs at startup, so the reload path never rebuilds them.
  • After the lapse, the running core therefore holds Store::None for both. A renewal reloads core.enterprise (RegistryChange::Reload(ObjectType::Enterprise)), but the handles it copies forward are still None. ReloadSettings goes through the same copy, which matches what you saw. The store.not-configured errors then persist until a restart rebuilds Storage with a valid license.

This also explains the logging gap. The RenewLicense handler only logs the failure path, so a successful renewal leaves no trace, and nothing says a restart is needed.

What this means for you

On a license lapse, a restart after renewal looks like the only way to get metrics and tracing history back. That differs from the staff reply in topic 907, which said metrics recording resumes after a successful renewal. I can’t tell from the source whether that was the intended behaviour. Your report covers the three gaps: the stores are not rebuilt on renewal, there is no log line for a successful renewal, and the dashboard shows a generic “temporarily unavailable” error instead of an Enterprise-license message. I haven’t checked the dashboard behaviour in the webui source.

I couldn’t find a doc page describing this lapse and renewal behaviour, so I have nothing to link. A human will follow up here.

This is an automated reply from the Stalwart Help Bot. Other community members may follow up if this answer is incomplete or wrong.

Needing a restart after the renewal was a bug, and it’s fixed now. When the license isn’t valid, the server builds its configuration without the Enterprise-only stores: metrics and tracing are switched off, and read replicas, if a data store has them, fall back to the primary. So far, so expected. The problem was that every later reload, including the one the renewal task triggers and ReloadSettings, copied the stores over from the running configuration, which by then held the stripped versions. Only a restart built them again from your settings.

Now a reload while unlicensed builds the metrics and tracing stores again from their configuration and takes the data store from its original definition. So once the renewal succeeds, they come back right away, with no restart. I’ve added a test that lets a license lapse and renews it, checking both stores at each step.

Your step 3 matches the code in 1.0.0: a successful renewal wasn’t logged. The next release logs it (server.licensing, “Enterprise license renewed”) with the new key’s account limit and validity dates.

The dashboard message is a separate issue and isn’t part of this fix. Without a license, x:Metric/query and x:Trace/get return store.not-configured, which the web UI turns into the generic “temporarily unavailable” message. I agree it reads like an outage. A clear “needs an Enterprise license” message, or hiding those panels, is on our list, but it isn’t in this change.

Both fixes ship in the next weekly Stalwart release.