pub enum BlobCacheError {
Show 16 variants
Path(PathTokenError),
Storage(StorageError),
NoCloudHome,
Io(String),
Metadata(DbError),
StorageSetup(String),
ChangesetWalkMismatch {
old_count: usize,
new_count: usize,
},
ExternalMissing {
id: String,
path: PathBuf,
source: String,
},
ExternalSizeMismatch {
id: String,
path: PathBuf,
},
NoLocalCopy {
namespace: String,
id: String,
},
LocalityUnresolved {
id: String,
},
NoExternalRef {
id: String,
},
CloudSizeMismatch {
namespace: String,
id: String,
expected: u64,
actual: u64,
},
CloudHashMismatch {
namespace: String,
id: String,
expected: String,
actual: String,
},
MissingContentHash {
namespace: String,
id: String,
},
LocalIntegrity {
path: PathBuf,
expected_size: u64,
actual_size: u64,
expected_hash: ObjectHash,
actual_hash: ObjectHash,
},
}Expand description
Why a blob-cache operation failed.
Variants§
Path(PathTokenError)
A blob id/namespace/cloud_path that can’t form a safe path — bad data
that could escape the store dir or can’t be partitioned. The blob is
refused before any path is built (the same gate the pull runs).
Storage(StorageError)
A cloud read failed: the blob isn’t in the cloud, or the backend errored
(surfaced from [SyncStorage::get_blob]).
NoCloudHome
A Remote blob’s bytes were needed from the cloud but no cloud home is connected, so there is no storage to fetch them from. A home-less store holds only Local blobs (external refs + the local store), which serve straight off disk and never reach the cloud-miss path; reaching here means a Remote blob was read with no provider connected — a real fault, surfaced rather than masked.
Io(String)
A local-disk failure: a cache write, a folder move, or a test cache reset. Carries a human-readable cause.
Metadata(DbError)
A blob-metadata query failed — resolving the blob’s locality, looking up its external ref, or reading its cache budget or expected size. A database read the blob path depends on, distinct from a disk I/O failure.
StorageSetup(String)
Building the sync storage from config failed — missing credentials or cloud configuration — when a Remote blob needed it. A configuration fault, not a disk I/O error.
ChangesetWalkMismatch
The old-value and new-value walks of one changeset disagreed on row count. They are two views of the same changeset; a mismatch means cleanup cannot pair updated rows with their previous blob ids.
ExternalMissing
A registered external blob ref (a user-provided Local blob’s user-owned file) points at a file that is no longer there — the user moved, renamed, or deleted it. Terminal: an external blob has no cloud copy to fall back to, so this never re-fetches. The host surfaces a “files missing / moved” state whose actions are relocate (pick the new folder, re-register) or re-import.
Fields
ExternalSizeMismatch
A registered external blob’s file is present but its length no longer matches
the registered size — the user truncated it or replaced it with a
different-length file. Terminal like Self::ExternalMissing: a mismatch
means this is not the exact file coven registered.
NoLocalCopy
A Local blob (its gated locality root’s gate is off) has no copy in the local store. A Local blob has no cloud copy, so there is nothing to fall back to: the state is broken, not a cache miss. Surfaced loud rather than silently fetching from the cloud — a make_local rollback leftover, an interrupted materialize, or a lost local file would otherwise be papered over. The host re-materializes or repairs.
LocalityUnresolved
A blob could not be resolved to a locality: its namespace declares no blob-bearing table, or that table has no row with the id, or the row reaches no gated root or remote root — so the source of Local-vs-Remote truth can’t be read. In a consistent store every readable blob has a locality root, so this is a real fault — surfaced rather than guessing a source by probing.
NoExternalRef
The gate resolved a blob to Local + user-provided, but no external-ref row is registered for it. A user-provided Local blob’s bytes live only at the user’s path, tracked by that ref; its absence is corruption (a lost or never-written ref), not a cache miss to fall through — surfaced loud so the host repairs or re-imports.
CloudSizeMismatch
A Remote blob fetched whole from the cloud came back with a plaintext length that disagrees with the row’s declared size. The bytes are not what the row describes, so they are refused before caching or returning: caching them would fail the read’s own length check on every later read, warning and refetching the same wrong object forever. Terminal like the length checks the cache-hit and file-download paths run.
CloudHashMismatch
A Remote blob fetched from the cloud decrypted to plaintext whose content hash disagrees with the author-signed hash on the blob’s row. The bytes are not the ones the row’s author pinned — a tampered object, a rolled-back prior version, or a same-size object planted under a different uploader’s prefix — so they are refused before caching or returning. The row’s hash is the authority; a mismatch is tamper, never a cache miss to refetch.
MissingContentHash
A blob’s row carries no content hash, so a whole-blob download cannot be verified against the author’s signed value. The hash is a required column, so an absent one is bad data (a row that predates the field, or a NULL where a hash must be), surfaced rather than serving unverified bytes.
LocalIntegrity
An authoritative local plaintext file exists at the exact path but its bytes differ from the row’s signed size/hash.