Reference

Publish DH Snapshot

Uploads a staged Distant Horizons snapshot to a bucket and publishes its download page.

Category
Action
Topics
Scheduler · Distant Horizons · Destinations
01

Ports

Publish DH Snapshotaction
  • triggercontrol
  • Staged folderstring
  • onCompletecontrol
  • onFailedcontrol
  • Snapshot URLstring
  • Parts uploadednumber
  • Parts skippednumber
  • Bytes sentnumber
  • Levels assemblednumber
  • Snapshots deletednumber
  • Parts deletednumber
  • Bytes freednumber
Ports Control Data
Data types string number bool

Strings accept any data input.
Numbers accept boolean input.

02

Fields

Field What it does Default Limits
Destination The saved bucket the snapshot is published to. None Must name a saved destination that still exists.
Key prefix Text added to the destination's key prefix for every object of the snapshot. None No . or .. segments.
Staged folder (default: this server's staging folder) The folder holding the staged snapshot, empty for this server's staging folder. None An absolute path that exists, outside the server's folder and other servers' staging folders.
Snapshots to keep (at least 1) How many snapshots stay in the bucket once this one is published. 3 A whole number from 1 to 2147483647.
03

What a run does

The block holds this server's snapshot claim for the whole run.
A snapshot or publish already running for the server fails it.
A wired Staged folder replaces the Staged folder field.

  1. Reads and checks index.json in the staged folder.
  2. Reads the bucket's latest.json to learn which parts are already there.
  3. Sends the parts the bucket lacks, and counts a part it already holds as skipped.
  4. Assembles each level's whole database inside the bucket, from its parts.
  5. Writes the snapshot's index.json and download page, then latest.json last.
  6. Deletes snapshots beyond Snapshots to keep, and the parts no kept snapshot uses.

A run that stops before latest.json is written leaves the previous snapshot as the current one.
The next run resumes, because parts already in the bucket are not sent again.
The newest complete snapshots are kept, plus the one latest.json points at.

It leaves by onComplete once latest.json is written, and by onFailed on any error.
A prune that fails does not fail the block: it leaves by onComplete and records a warning.
Snapshot URL is the address of latest.json, under the destination's public base URL if it has one.
A private link shows [redacted] in place of its token.
Copy that link from the destination's Snapshot link row in Settings.
The other outputs count the parts sent and skipped, the levels assembled, and what the prune deleted.
Progress and failures appear in the server's console, and the block can run for up to 12 hours.

04

Errors

Message says Do
destination validation failed: Publish DH Snapshot (node): the destination "name" does not exist. It was deleted or renamed in Settings, or this graph came from another install. Pick a destination that exists, or add it in Settings.
key prefix "prefix" must not contain "segment" Remove the . or .. segment from the prefix.
the staged folder folder cannot be read: reason Check that the folder exists and can be read.
cannot read the previous snapshot from destination: reason Check the destination and the network, then run it again.
part hash: reason Run it again; parts already sent are skipped.
assemble level folder: reason Run it again; parts already sent are skipped.
timed out after 43200s: reason Run it again; parts already sent are skipped.