Issue Description
I’m trying to back up my configuration using stalwart-cli via the following command:
stalwart-cli snapshot \
Tenant Domain DkimSignature AcmeProvider Certificate Role \
Account Directory \
SystemSettings DataRetention \
PublicKey DnsServer \
--output "backup-$(date +%Y-%m-%d).ndjson" \
--url https://<url> \
--api-key <key>
However I get the following error:
unexpected server response: no schema available for x:DnsServer
If I remove DnsServer from the snapshot group I get another error:
Domain references DnsServer but DnsServer is not in the snapshot selection
(It works when I add DnsServer to --allow-unresolved but I’m not sure if that’s the correct solution)
Expected Behavior
Created backup file without error messages.
Actual Behavior
No Backup is created because of missing schema or reference.
Stalwart Version
v0.16.x
Installation Method
Binary (Linux)
Database Backend
RocksDB
Blob Storage
RocksDB
Search Engine
Internal
Directory Backend
Internal
Additional Context
Relaxed / follow up to (automatic) Server backup - RocksDB
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
Let me look into this snapshot issue with the CLI.
The issue has two parts, and the docs clarify both.
1. no schema available for x:DnsServer
This error means the CLI version you are running does not yet include the DnsServer schema locally (it was added in a later CLI release). Updating stalwart-cli to the latest binary should resolve this.
2. Domain references DnsServer but DnsServer is not in the snapshot selection
This is the expected dependency-closure check. Domain objects hold a reference to DnsServer, so DnsServer must be included in the snapshot selection. The documented “Configuration backup” command in the snapshot docs explicitly includes DnsServer in the selection alongside Domain:
stalwart-cli snapshot \
Tenant Domain Directory DkimSignature AcmeProvider Certificate DnsServer Role \
Account \
SystemSettings DataRetention BlobStore InMemoryStore SearchStore \
--allow-unresolved PublicKey \
--output "backup-$(date +%Y-%m-%d).ndjson"
Note that compared to your command:
DnsServer is listed alongside the other types (not in a separate group), so the dependency resolver sees a complete closure.
PublicKey is placed in --allow-unresolved (not in the main selection), because it does not have a full schema of its own and is referenced but not directly snapshotted.
So the short answer is: include DnsServer in the main selection (which you already tried, but the schema error is a CLI version issue), and move PublicKey to --allow-unresolved.
Docs reference: Exporting server state - snapshot
This is an automated reply from the Stalwart Help Bot. Other community members may follow up if this answer is incomplete or wrong.
Thanks, it was an issue with the version of stalwart-cli. I’ve been running 1.0.4 and with 1.0.8 it worked as expected.
What’s the best way to update stalwart-cli (or check for available updates)? I added the Linux (shell installer) in front of my backup script so that it always uses the latest version, but surely that’s not the best solution.