Skip to content

Commit 8def65e

Browse files
Merge pull request openshift#415 from flavianmissi/IR-492
IR-492: metrics: document error codes
2 parents ececdda + 2026b6d commit 8def65e

File tree

1 file changed

+37
-7
lines changed

1 file changed

+37
-7
lines changed

pkg/dockerregistry/server/metrics/errorcodes.go

Lines changed: 37 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,44 @@ import (
99
)
1010

1111
const (
12+
// errCodeUnsupportedMethod happens when a storage driver does not offer
13+
// support for a determine http method, or when it doesn't support url
14+
// redirects. this error usually bubbles up back to clients, making it
15+
// easy to detect. fixing it might simply involve disabling redirects
16+
// the image registry.
1217
errCodeUnsupportedMethod = "UNSUPPORTED_METHOD"
13-
errCodePathNotFound = "PATH_NOT_FOUND"
14-
errCodeInvalidPath = "INVALID_PATH"
15-
errCodeInvalidOffset = "INVALID_OFFSET"
16-
errCodeReadOnlyFS = "READ_ONLY_FILESYSTEM"
17-
errCodeFileTooLarge = "FILE_TOO_LARGE"
18-
errCodeDeviceOutOfSpace = "DEVICE_OUT_OF_SPACE"
19-
errCodeUnknown = "UNKNOWN"
18+
19+
// errCodePathNotFound indicates that a given path does not exist in
20+
// the underlying storage. it usually indicates a user error and should
21+
// not be considered high severity.
22+
errCodePathNotFound = "PATH_NOT_FOUND"
23+
24+
// errCodeInvalidPath indicates the provided path does not comform to
25+
// the upstream distribution standards.
26+
// see https://github.com/distribution/distribution/blob/bce9fcd135940c4be187f6fc98c2e27dad9ddcea/registry/storage/driver/storagedriver.go?plain=1#L134-L139
27+
// for details.
28+
errCodeInvalidPath = "INVALID_PATH"
29+
30+
// errCodeInvalidOffset indicates an attempt to read/write at an invalid
31+
// offset. A valid offset is contextual. Storage drivers usually specify
32+
// non-zero offsets when reading a stream of bytes from storage, or
33+
// during chunked blob uploads.
34+
errCodeInvalidOffset = "INVALID_OFFSET"
35+
36+
// errCodeReadOnlyFS indicates the filesystem the registry is trying to
37+
// write is read-only. this is a catastrophic error and needs admin
38+
// intervention for recovery. however, clients will only notice if they
39+
// try to push directly into the registry. pull-through will transparently
40+
// fail and failures will only be visible in logs and metrics/alerts.
41+
errCodeReadOnlyFS = "READ_ONLY_FILESYSTEM"
42+
43+
// errCodeFileTooLarge indicates the file being uploaded is too large.
44+
errCodeFileTooLarge = "FILE_TOO_LARGE"
45+
46+
// errCodeDeviceOutOfSpace indicates the storage device is out of space.
47+
errCodeDeviceOutOfSpace = "DEVICE_OUT_OF_SPACE"
48+
49+
errCodeUnknown = "UNKNOWN"
2050

2151
// errnoEFBIG represents a file too large error.
2252
// See `man errno` for more.

0 commit comments

Comments
 (0)