errs

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 10, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package errs holds every sentinel error of the Scrinium engine. One package, one source of truth — anything matched via errors.Is/errors.As lives here.

Why a flat shared package and not per-layer files (core/errors.go, domain/errors.go, driver/driver.go) — sentinels are part of the public contract, not of the implementation that returns them. `Walk`'s ErrStopWalk is the same idea regardless of whether it surfaces from the storage core or from a driver-level list call; `ErrUnsupportedURIScheme` originates in a driver but is matched by callers two layers up. Splitting the same identity into per-layer duplicates with `var X = otherpkg.X` re-exports has been tried and produced exactly the kind of confusion this package is meant to remove.

Files in this package are organised by domain (manifest, store lifecycle, lease, etc.) so the package stays scannable as it grows. Callers that need only one or two errors are still fine — Go's import system makes the file split transparent.

DAG note: errs is a leaf package, the same as event. It imports only stdlib. driver, domain, core all import errs; nothing imports the other direction.

Index

Constants

This section is empty.

Variables

View Source
var ErrAgentAlreadyRunning = errors.New("scrinium: agent already running")

ErrAgentAlreadyRunning — Run was called again on an already running agent.

View Source
var ErrAgentNotRunning = errors.New("scrinium: agent not running")

ErrAgentNotRunning — command-style methods (ForceCommit, Eject, Trigger, TakeSnapshot, ...) called on an agent whose Run is not active.

View Source
var ErrArchivedArtifact = errors.New("scrinium: archived artifact")

ErrArchivedArtifact — the artifact is reachable only through a Backup with ReadPolicy: Never; AllowColdRead is required.

View Source
var ErrArtifactNotFound = newBridgedSentinel(
	"scrinium: artifact not found", fs.ErrNotExist,
)

ErrArtifactNotFound — no manifest with the given ArtifactID exists in the Store, or it is a ManifestTypePack (an internal type that does not exist for the client). Bridges to fs.ErrNotExist for host code that handles missing artifacts the same way as missing files.

View Source
var ErrArtifactUnreadable = errors.New("scrinium: projection artifact unreadable")

ErrArtifactUnreadable — the artifact is physically present but cannot be read in the current state (Store Locked, Corrupted, pipeline misconfiguration). Original error via errors.Unwrap.

View Source
var ErrConfigMismatch = errors.New("scrinium: config mismatch")

ErrConfigMismatch — an attempt to change an immutable parameter through UpdateConfig, or a conflict between the cfg passed to OpenStore and the configuration loaded from system.config/current, or an attempt to remove NoDelete while DeletionPolicyLock is in effect.

View Source
var ErrCorruptedBlob = errors.New("scrinium: corrupted blob")

ErrCorruptedBlob — the hash of the physical blob does not match its BlobRef.

View Source
var ErrCorruptedConfigPointer = errors.New("scrinium: corrupted config pointer")

ErrCorruptedConfigPointer — system.config/current exists but is invalid (empty, oversized, malformed ArtifactID).

View Source
var ErrCorruptedContent = errors.New("scrinium: corrupted content")

ErrCorruptedContent — after the inverse Pipeline the hash does not match ContentHash.

View Source
var ErrCorruptedManifest = errors.New("scrinium: corrupted manifest")

ErrCorruptedManifest — the hash of the manifest file does not match its ArtifactID.

View Source
var ErrCuratorClosed = errors.New("scrinium: curator closed")

ErrCuratorClosed — operation issued on a closed Curator.

View Source
var ErrDanglingConfigPointer = errors.New("scrinium: dangling config pointer")

ErrDanglingConfigPointer — the pointer is syntactically valid but the artifact it references does not exist.

View Source
var ErrDecryptionFailed = errors.New("scrinium: decryption failed")

ErrDecryptionFailed — the key was found but decryption failed (wrong key, corrupted bytes, authentication-tag failure).

View Source
var ErrDeletionForbidden = errors.New("scrinium: deletion forbidden")

ErrDeletionForbidden — Delete on a Store with DeletionPolicy: NoDelete.

View Source
var ErrDescriptorSplitBrain = errors.New("scrinium: descriptor split-brain (L0 and L1 diverged at the same sequence)")

ErrDescriptorSplitBrain — L0 and L1 are both valid, hold different content, and carry the same Sequence number. The engine cannot pick a winner without external input: a higher Sequence on either side would have made it the canonical version, but identical sequences mean two writers produced divergent descriptors with no causal order.

Recovery is manual: the operator inspects both replicas and either picks one explicitly (overwriting both) or falls back to the Recovery Kit through RebuildIndexAgent.

View Source
var ErrDrainNoTarget = errors.New("scrinium: drain has no target")

ErrDrainNoTarget — at Drain time the Router returned an empty target list; follow-up behaviour is determined by OnDrainNoTarget.

View Source
var ErrEditingDisabled = newBridgedSentinel(
	"scrinium: projection editing disabled", fs.ErrPermission,
)

ErrEditingDisabled — an editing operation (rename, setattr, truncate, append) was attempted while the corresponding policy bit is off, or any mutation was attempted on a read-only FSOps. Bridges to fs.ErrPermission; surfaces translate to EROFS (FUSE) or 403 (WebDAV).

View Source
var ErrEjectorQueueFull = errors.New("scrinium: ejector queue full")

ErrEjectorQueueFull — Ejector.Eject called while the task queue is already full.

View Source
var ErrEmptySessionID = errors.New("scrinium: empty session ID")

ErrEmptySessionID — RollbackSession called with an empty string; guards against a mass deletion of sessionless artifacts.

View Source
var ErrFUSENotSupported = errors.New("scrinium: FUSE not supported in this build")

ErrFUSENotSupported — MountFUSE called without the `fuse` build tag.

View Source
var ErrHostStorageFull = errors.New("scrinium: host storage full")

ErrHostStorageFull — HostStorage hit its hard limit while OnHostStorageFull: Reject was in effect; soft eviction was insufficient.

View Source
var ErrHostStorageLocked = errors.New("scrinium: host storage locked by another process")

ErrHostStorageLocked — Curator startup aborted: the WorkspaceDir of the transit buffer is held by another process (OS-level lock).

View Source
var ErrHostStorageRequired = errors.New("scrinium: HostStorage required for ManifestStorage=Local")

ErrHostStorageRequired — RebuildIndexAgent.Validate with ManifestStorage: Local without a HostStorage passed in. See docs/2. Internals/10 §10.4.2 step 3.

View Source
var ErrIndexCorrupted = errors.New("scrinium: index corrupted")

ErrIndexCorrupted — the StoreIndex is missing or its checksum does not match.

View Source
var ErrIndexSchemaMismatch = errors.New("scrinium: index schema mismatch")

ErrIndexSchemaMismatch — the StoreIndex schema version is incompatible with the running binary.

View Source
var ErrIngesterNoState = errors.New("scrinium: ingester watch mode requires StateFile")

ErrIngesterNoState — NewIngester invoked with Mode: Watch but no StateFile configured.

View Source
var ErrInjected = errors.New("scrinium: injected fault")

ErrInjected is the sentinel returned by the faulty test driver for a deliberately injected fault. Test code asserts errors.Is(err, ErrInjected) to confirm a fault landed.

Lives in errs (rather than driver/faulty) so that a test outside the faulty package can match the sentinel without importing the driver subpackage just for that.

View Source
var ErrInvalidConfig = errors.New("scrinium: invalid config")

ErrInvalidConfig — a StoreConfig parameter is out of range or violates the Rules Engine.

View Source
var ErrInvalidKDFParams = errors.New("scrinium: invalid KDF params")

ErrInvalidKDFParams — KDFParams fail the minimum-validity check: Time < 1, Memory < 19456 KiB, Threads < 1.

View Source
var ErrInvalidKey = errors.New("scrinium: invalid key")

ErrInvalidKey — the KEK does not decrypt the DEK: wrong password or corrupted EncryptedDEK.

View Source
var ErrInvalidPath = newBridgedSentinel(
	"scrinium: projection invalid path", fs.ErrInvalid,
)

ErrInvalidPath — the path is malformed (forbidden characters, absolute when relative is required, etc.).

View Source
var ErrInvalidRecoveryKey = errors.New("scrinium: invalid recovery key")

ErrInvalidRecoveryKey — failed to decrypt the DEK from the Recovery Kit.

View Source
var ErrInvalidTombstoneGracePeriod = errors.New("scrinium: invalid tombstone grace period")

ErrInvalidTombstoneGracePeriod — TombstoneGracePeriod < 1h. A dedicated sentinel because this is the only param with runtime implications for multi-host safety.

View Source
var ErrIsADirectory = newBridgedSentinel(
	"scrinium: projection is a directory", fs.ErrInvalid,
)

ErrIsADirectory — Open on a path that points to a directory. Bridges to fs.ErrInvalid for the same reason as ErrNotADirectory.

View Source
var ErrKeyNotFound = errors.New("scrinium: key not found")

ErrKeyNotFound — the KeyResolver does not know the key for the requested KeyID.

View Source
var ErrLeaseHeld = errors.New("scrinium: lease held")

ErrLeaseHeld — an attempt to acquire a lease held by an active owner.

View Source
var ErrLeaseLost = errors.New("scrinium: lease lost")

ErrLeaseLost — the lease was lost in flight or right after a takeover (concurrent steal).

View Source
var ErrLocked = errors.New("scrinium: store locked")

ErrLocked — the operation was invoked in StateLocked on an encrypted store. Unlock is required. NOT used for closed stores — those return os.ErrClosed; conflating the two confused Plain-store users into searching for a passphrase.

View Source
var ErrMaintenanceInProgress = errors.New("scrinium: maintenance in progress")

ErrMaintenanceInProgress — another Maintenance Agent holds the lease.

View Source
var ErrManifestTooLarge = errors.New("scrinium: manifest too large")

ErrManifestTooLarge — serialised Manifest > 1 MB.

View Source
var ErrManifestsLost = errors.New("scrinium: manifests lost")

ErrManifestsLost — RebuildIndexAgent did not find any manifests: ManifestStorage: Local with the local disk lost and no HostStorage available.

View Source
var ErrMetaKeyNotFound = errors.New("scrinium: meta key not found")

ErrMetaKeyNotFound — the requested key is missing in store_meta.

View Source
var ErrMetadataTooLarge = errors.New("scrinium: metadata too large")

ErrMetadataTooLarge — Artifact.Metadata > 64 KB.

View Source
var ErrMissingConfigPointer = errors.New("scrinium: missing config pointer")

ErrMissingConfigPointer — system.config/current is absent.

View Source
var ErrNamespaceTooLong = errors.New("scrinium: namespace too long")

ErrNamespaceTooLong — namespace > 255 bytes.

View Source
var ErrNoSnapshot = errors.New("scrinium: no valid snapshot for Source=Snapshot")

ErrNoSnapshot — RebuildIndexAgent.Validate with Source: Snapshot when no valid snapshots are available.

View Source
var ErrNotADirectory = newBridgedSentinel(
	"scrinium: projection not a directory", fs.ErrInvalid,
)

ErrNotADirectory — List on a path that points to a file. Bridges to fs.ErrInvalid (mirrors the historical vfs.WrapErr translation; surfaces map fs.ErrInvalid to ENOTDIR themselves).

View Source
var ErrNotEmpty = newBridgedSentinel(
	"scrinium: projection directory not empty", fs.ErrInvalid,
)

ErrNotEmpty — Rmdir on a directory that has children. Bridges to fs.ErrInvalid (mirrors vfs.WrapErr); translates to ENOTEMPTY at the FUSE layer.

View Source
var ErrNotImplemented = errors.New("scrinium: not implemented")

ErrNotImplemented signals that a method or branch is part of the declared public surface but its implementation has not landed yet. Distinct from forward-compat sentinels (ErrUnsupportedEncoding, ErrUnsupportedCrypto), which mark "this binary does not support that format" — ErrNotImplemented says "no binary supports this path yet".

Returned (wrapped, with concrete context) by stub bodies of types that exist for compile-time DAG enforcement: agents, the projection layer, chunker / bundler decorators, the curator's constructor — anywhere the M0 contract has a signature but the flesh arrives at M3 or later.

Tests that exercise stubs match against this with errors.Is.

View Source
var ErrPassphraseAlreadySet = errors.New("scrinium: passphrase already set (use RotateKEK to change it)")

ErrPassphraseAlreadySet — Store.SetPassphrase was called on a Store whose DEK is already wrapped. The intended path for rotating the passphrase is RotateKEK, which proves possession of the current passphrase before accepting the new one.

Returned only by SetPassphrase; the unwrap-then-wrap flow of RotateKEK does not surface it.

View Source
var ErrPassphraseProvider = errors.New("scrinium: passphrase provider error")

ErrPassphraseProvider — the provider returned an error. Wraps the underlying cause (available through errors.Unwrap).

View Source
var ErrPassphraseRequired = errors.New("scrinium: passphrase required")

ErrPassphraseRequired — the operation needs a KEK but WithPassphrase was not configured. Also returned by ExportRecoveryKit on a ManifestCrypto: Plain Store.

View Source
var ErrPathExists = newBridgedSentinel(
	"scrinium: projection path already exists", fs.ErrExist,
)

ErrPathExists — Create/Mkdir at a path that is already taken (real artifact or pending directory). Bridges to fs.ErrExist; translates to EEXIST at the FUSE layer.

View Source
var ErrPathNotFound = newBridgedSentinel(
	"scrinium: projection path not found", fs.ErrNotExist,
)

ErrPathNotFound — Get/Open at a non-existent virtual path. Bridges to fs.ErrNotExist so host code can errors.Is against the standard-library sentinel without knowing scrinium specifics.

View Source
var ErrRandomAccessNotSupported = errors.New("scrinium: random access not supported")

ErrRandomAccessNotSupported — ReadAt/ReadAtCtx was called on a stream that does not support random access.

View Source
var ErrRecoveryKitCorrupted = errors.New("scrinium: recovery kit corrupted")

ErrRecoveryKitCorrupted — the Recovery Kit is corrupted (the checksum does not match).

View Source
var ErrRecoveryKitRequired = errors.New("scrinium: RecoveryKit required (descriptor lost, encrypted store)")

ErrRecoveryKitRequired — RebuildIndexAgent.Validate with the Store in Corrupted after every descriptor replica has been lost and RecoveryKit is nil in the configuration.

View Source
var ErrReservedNamespace = errors.New("scrinium: reserved namespace")

ErrReservedNamespace — an attempt to use "*" or the "system." prefix without a CapabilityToken.

View Source
var ErrRetentionNotExpired = errors.New("scrinium: retention not expired")

ErrRetentionNotExpired — Delete or RollbackSession on an artifact with an active RetentionUntil.

View Source
var ErrScratchQuota = newBridgedSentinel(
	"scrinium: projection scratch quota exceeded", fs.ErrPermission,
)

ErrScratchQuota — FSOps.Create/Write would exceed the configured scratch quota. Bridges to fs.ErrPermission (host surfaces map it to ENOSPC); the bridge keeps "is it permission-class?" answers uniform across editing-policy and quota refusals.

View Source
var ErrSessionIDTooLong = errors.New("scrinium: session ID too long")

ErrSessionIDTooLong — SessionID > 255 bytes.

View Source
var ErrSharedIndexRequired = errors.New("scrinium: shared index required")

ErrSharedIndexRequired — OpenStore on the SQLite backend has found a live foreign location.lock; a shared backend (Postgres) or a clean shutdown of the other process is required.

View Source
var ErrSourceUnavailable = errors.New("scrinium: projection source unavailable")

ErrSourceUnavailable — the projection source returned a transient error during backfill or a runtime call. The original error is available via errors.Unwrap.

View Source
var ErrStopWalk = errors.New("scrinium: stop walk")

ErrStopWalk is the early-exit sentinel for any iteration callback in the engine: Store.Walk, Store.WalkSystem, StoreIndex.List*, Driver.ListObjectsWithModTime. Returning this from the callback stops the walk without an error — the function returns nil to its caller.

One sentinel covers every walk because the meaning is identical across layers. Splitting it ("driver-level walk" vs "store-level walk") was tried and only forced callers to choose between two values that mean the same thing.

View Source
var ErrStoreAlreadyExists = newBridgedSentinel(
	"scrinium: store already exists", fs.ErrExist,
)

ErrStoreAlreadyExists — InitStore without WithForceReinit on top of an existing Store. Bridges to fs.ErrExist.

View Source
var ErrStoreCorrupted = errors.New("scrinium: store corrupted")

ErrStoreCorrupted — every descriptor replica is corrupted, or the StoreIndex is corrupted. The Store is in StateCorrupted.

View Source
var ErrStoreNotFound = newBridgedSentinel(
	"scrinium: store not found", fs.ErrNotExist,
)

ErrStoreNotFound — OpenStore: no store.json in the Location. Bridges to fs.ErrNotExist so a host can errors.Is(err, fs.ErrNotExist) when probing for an existing store. Distinct from ErrArtifactNotFound (an artifact inside an open Store).

View Source
var ErrStoreNotReady = errors.New("scrinium: store not ready")

ErrStoreNotReady — the Store is in StateBootstrapping. The API is blocked until initialisation completes.

View Source
var ErrStoreNotRegistered = errors.New("scrinium: store not registered with curator")

ErrStoreNotRegistered — Curator.Store(id) with an unknown id.

View Source
var ErrStoreOffline = errors.New("scrinium: store offline")

ErrStoreOffline — MaintenanceModeOffline.

View Source
var ErrStoreReadOnly = newBridgedSentinel(
	"scrinium: store read-only", fs.ErrPermission,
)

ErrStoreReadOnly — MaintenanceModeReadOnly + a mutating operation. Bridges to fs.ErrPermission so generic "is this a permission problem?" checks at host layer return true.

View Source
var ErrUnknownPackFormat = errors.New("scrinium: unknown pack format")

ErrUnknownPackFormat — the magic bytes of a .pack volume are unrecognised.

View Source
var ErrUnsupportedAlgorithm = errors.New("scrinium: unsupported algorithm")

ErrUnsupportedAlgorithm — the algorithm has not been registered in the corresponding registry.

View Source
var ErrUnsupportedCrypto = errors.New("scrinium: unsupported manifest crypto")

ErrUnsupportedCrypto — the manifest header carries a ManifestCrypto value (Plain, MetadataOnly, Envelope, or a future addition) that this binary does not implement, or StoreConfig.ManifestCrypto names such a value.

View Source
var ErrUnsupportedEncoding = errors.New("scrinium: unsupported manifest encoding")

ErrUnsupportedEncoding — the manifest header carries an encoding magic (\x00SC1\x00 for JSON, \x00SC2\x00 for the binary codec, etc.) that this binary was not built to decode, or StoreConfig.ManifestEncoding names a value not registered in the current build.

View Source
var ErrUnsupportedSchemaVersion = errors.New("scrinium: unsupported schema version")

ErrUnsupportedSchemaVersion — the manifest's schema_version is not supported by the running binary.

View Source
var ErrUnsupportedURIScheme = errors.New("scrinium: unsupported URI scheme")

ErrUnsupportedURIScheme — the driver does not support the URI scheme passed to Open. Used with BlobStorage: ExternalRef for schemes unknown to the driver.

View Source
var ErrViewClosed = errors.New("scrinium: projection view closed")

ErrViewClosed — operation on a closed projection View.

View Source
var ErrWebDAVNotSupported = errors.New("scrinium: WebDAV not supported in this build")

ErrWebDAVNotSupported — MountWebDAV called without the `webdav` build tag.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL