errors.go RawHistoryFolder
1package domain
2
3import "errors"
4
5// Domain errors represent business-level errors that can occur in the system.
6// These errors are used across layers to communicate specific failure conditions.
7var (
8 // Container errors
9 ErrContainerNotFound = errors.New("container not found")
10 ErrContainerExists = errors.New("container already exists")
11 ErrContainerNotRunning = errors.New("container is not running")
12 ErrContainerRunning = errors.New("container is already running")
13 ErrContainerExited = errors.New("container exited")
14 // ErrRuntimeUnsupported wraps device-bearing create failures on
15 // engines that cannot serve CDI device requests. It fails closed:
16 // Gordon never retries without devices.
17 ErrRuntimeUnsupported = errors.New("runtime does not support CDI device requests")
18
19 // Image errors
20 ErrImageNotFound = errors.New("image not found")
21 ErrImagePullFailed = errors.New("failed to pull image")
22 ErrInvalidImageFormat = errors.New("invalid image format")
23
24 // Route errors
25 ErrRouteNotFound = errors.New("route not found")
26 ErrRouteExists = errors.New("route already exists")
27 ErrInvalidRoute = errors.New("invalid route configuration")
28 ErrNoRouteForImage = errors.New("no route configured for image")
29 ErrRouteDomainEmpty = errors.New("route domain cannot be empty")
30 ErrRouteImageEmpty = errors.New("route image cannot be empty")
31 ErrRouteDomainInvalid = errors.New("route domain is not a valid public hostname")
32 ErrNoTargetAvailable = errors.New("no target available for route")
33
34 // Registry errors
35 ErrManifestNotFound = errors.New("manifest not found")
36 ErrBlobNotFound = errors.New("blob not found")
37 ErrUploadNotFound = errors.New("upload not found")
38 ErrInvalidDigest = errors.New("invalid digest")
39 ErrDigestMismatch = errors.New("digest mismatch")
40 ErrUnauthorized = errors.New("unauthorized")
41 ErrBlobSizeExceeded = errors.New("blob size exceeds maximum")
42 ErrExecOutputExceeded = errors.New("container exec output exceeds maximum")
43 // ErrManifestBlobUnknown marks a manifest that references config or
44 // layer content the repository never completed an upload for.
45 ErrManifestBlobUnknown = errors.New("manifest references a blob the repository does not own")
46
47 // Network errors
48 ErrNetworkNotFound = errors.New("network not found")
49 ErrNetworkExists = errors.New("network already exists")
50
51 // Volume errors
52 ErrVolumeNotFound = errors.New("volume not found")
53 ErrVolumeExists = errors.New("volume already exists")
54 ErrVolumeBackupUnavailable = errors.New("volume backup service unavailable")
55 ErrVolumeOwnershipUnverified = errors.New("volume ownership cannot be verified")
56
57 // Preview errors
58 ErrPreviewNotFound = errors.New("preview not found")
59
60 // Config errors
61 ErrTrafficGraphRequired = errors.New("traffic graph is required")
62 ErrClientHelloTooLarge = errors.New("client hello exceeds maximum")
63 ErrConfigNotFound = errors.New("configuration not found")
64 ErrInvalidConfig = errors.New("invalid configuration")
65 ErrConfigLoadFailed = errors.New("failed to load configuration")
66 ErrInvalidDomainPattern = errors.New("invalid domain pattern")
67 ErrRouteConflict = errors.New("route conflicts with existing configuration")
68
69 // App manifest errors
70 ErrInvalidAppSpec = errors.New("invalid app manifest")
71 // ErrInvalidNetworkProbe wraps malformed bounded container-network
72 // readiness requests. It is distinct from ErrInvalidAppSpec: the
73 // manifest may be valid while one probe request is not.
74 ErrInvalidNetworkProbe = errors.New("invalid network probe request")
75 // ErrNetworkProbeCleanup marks a helper that could not be force-removed.
76 // Callers must fail immediately rather than create another helper.
77 ErrNetworkProbeCleanup = errors.New("network probe helper cleanup failed")
78 // ErrBindPolicy wraps administrative bind policy violations. It is
79 // distinct from ErrInvalidAppSpec: the manifest may be valid while the
80 // installation policy refuses to serve it.
81 ErrBindPolicy = errors.New("bind policy violation")
82 // ErrDevicePolicy wraps administrative device policy violations. It is
83 // distinct from ErrInvalidAppSpec: the manifest may be valid while the
84 // installation policy refuses to serve it.
85 ErrDevicePolicy = errors.New("device policy violation")
86
87 // App state errors
88 ErrAppStateIO = errors.New("app state storage failure")
89 ErrAppStateCorrupt = errors.New("app state is corrupt")
90 ErrAppStateIncompatible = errors.New("app state format is not supported by this binary")
91 ErrAppStateConflict = errors.New("app state conflict")
92 // ErrAppNotFound marks a lifecycle mutation of a name that has no
93 // live app identity at all. It is distinct from a missing revision
94 // or operation on a known app.
95 ErrAppNotFound = errors.New("app not found")
96 ErrAppRevisionNotFound = errors.New("app revision not found")
97 ErrAppIntentNotFound = errors.New("app apply intent not found")
98 ErrAppOperationNotFound = errors.New("app operation not found")
99 ErrAppReservationConflict = errors.New("listener reservation conflict")
100 ErrAppTrafficProjection = errors.New("app traffic projection failed")
101 ErrAppImageUnresolvable = errors.New("image reference unresolvable")
102 ErrAppImageNotAllowed = errors.New("image reference not allowed by installation policy")
103 ErrAppSecretMissing = errors.New("required app secret missing")
104 ErrAppUnmanagedImageVolume = errors.New("image declares unmanaged volume")
105 // ErrPruneDisabled means prune could not establish a safe scope for
106 // the requested operation at all (for example, its protection or
107 // runtime ports are not wired). It is never returned merely because
108 // app state exists: protected and unknown candidates are reported
109 // per candidate and do not fail the operation.
110 ErrPruneDisabled = errors.New("pruning unavailable: cannot establish a safe prune scope")
111
112 // Environment errors
113 ErrEnvFileNotFound = errors.New("environment file not found")
114 ErrSecretNotFound = errors.New("secret not found")
115 ErrSecretsAlreadyExist = errors.New("secrets already exist")
116 ErrProviderNotFound = errors.New("secret provider not found")
117 ErrInvalidContainerName = errors.New("invalid container name")
118 ErrAttachmentOwnershipMismatch = errors.New("attachment ownership mismatch")
119 ErrReadinessLogSizeExceeded = errors.New("readiness log exceeds maximum")
120
121 // Authentication errors
122 ErrInvalidToken = errors.New("invalid token")
123 ErrExpiredToken = errors.New("token has expired")
124 ErrRevokedToken = errors.New("token has been revoked")
125 ErrInvalidCredentials = errors.New("invalid credentials")
126 ErrTokenNotFound = errors.New("token not found")
127
128 // Security errors
129 ErrPathTraversal = errors.New("path traversal not allowed")
130 ErrInvalidPath = errors.New("invalid path format")
131 ErrInsufficientScope = errors.New("insufficient scope for operation")
132 ErrInvalidScope = errors.New("invalid scope format")
133 ErrSSRFBlocked = errors.New("request to internal/blocked network not allowed")
134 ErrInvalidEnvKey = errors.New("invalid environment variable key")
135 ErrEnvContainsSecretRef = errors.New("environment file contains secret reference")
136 ErrLongLivedToken = errors.New("long-lived tokens must be exchanged via /auth/token")
137
138 // Remote errors
139 ErrEmptyRemoteName = errors.New("remote name must not be empty")
140 ErrInvalidRemoteNameChar = errors.New("remote name contains invalid characters")
141 ErrConsecutiveDots = errors.New("remote name must not contain consecutive dots")
142 ErrPassUnavailable = errors.New("pass is not available")
143 ErrRemoteNotFound = errors.New("remote not found")
144
145 // Attachment errors
146 ErrAttachmentNotFound = errors.New("attachment not found")
147 ErrAttachmentExists = errors.New("attachment already exists")
148 ErrAttachmentImageEmpty = errors.New("attachment image cannot be empty")
149 ErrAttachmentTargetEmpty = errors.New("attachment target (domain or group) cannot be empty")
150 ErrAttachmentNotDeployed = errors.New("configured attachment is not deployed; run gordon deploy to create it")
151
152 // TLS / ACME errors
153 ErrACMEDisabled = errors.New("acme disabled")
154 ErrACMEEmailRequired = errors.New("acme email required")
155 ErrACMEChallengeInvalid = errors.New("acme challenge invalid")
156 ErrDNSConfigInvalid = errors.New("dns configuration invalid")
157 ErrCloudflareTokenMissing = errors.New("cloudflare api token missing")
158 ErrCertificateStoreRequired = errors.New("certificate store required")
159 ErrCertificateIssuerRequired = errors.New("certificate issuer required")
160 ErrRouteSourceRequired = errors.New("route source required")
161 ErrHTTPChallengeSinkRequired = errors.New("http challenge sink required")
162 ErrTLSRouteNotCovered = errors.New("tls route not covered by public certificate")
163
164 // Traffic errors
165 ErrTrafficStatusUnavailable = errors.New("traffic status unavailable")
166)