DAOS API: src/include/daos_errno.h Source File

| DAOS API (v2.1 - dev)

Loading...
Searching...
No Matches
daos_errno.h
1
10
11#ifndef __DAOS_ERRNO_H__
12#define __DAOS_ERRNO_H__
13
14#if defined(__cplusplus)
15extern "C" {
16#endif
17
21
22/*
23 * This preprocessor machinery defines the errno values but also
24 * enables the internal definition of d_errstr. A new macro should
25 * be defined for each non-contiguous range
26 */
27
28/* clang-format off */
29
31#define D_FOREACH_GURT_ERR(ACTION) \
32 \
33 ACTION(DER_NO_PERM, Operation not permitted) \
34 \
35 ACTION(DER_NO_HDL, Invalid handle) \
36 \
37 ACTION(DER_INVAL, Invalid parameters) \
38 \
39 ACTION(DER_EXIST, Entity already exists) \
40 \
41 ACTION(DER_NONEXIST, The specified entity does not exist) \
42 \
43 ACTION(DER_UNREACH, Unreachable node) \
44 \
45 ACTION(DER_NOSPACE, No space on storage target) \
46 \
47 ACTION(DER_ALREADY, Operation already performed) \
48 \
49 ACTION(DER_NOMEM, Out of memory) \
50 \
51 ACTION(DER_NOSYS, Function not implemented) \
52 \
53 ACTION(DER_TIMEDOUT, Time out) \
54 \
55 ACTION(DER_BUSY, Device or resource busy) \
56 \
57 ACTION(DER_AGAIN, Try again) \
58 \
59 ACTION(DER_PROTO, Incompatible protocol) \
60 \
61 ACTION(DER_UNINIT, Device or resource not initialized) \
62 \
63 ACTION(DER_TRUNC, Buffer too short) \
64 \
65 ACTION(DER_OVERFLOW, Data too long for defined data type or buffer size) \
66 \
67 ACTION(DER_CANCELED, Operation canceled) \
68 \
69 ACTION(DER_OOG, Out of group or member list) \
70 \
71 ACTION(DER_HG, Transport layer mercury error) \
72 \
73 ACTION(DER_UNREG, RPC or protocol version not registered) \
74 \
75 ACTION(DER_ADDRSTR_GEN, Failed to generate an address string) \
76 \
77 ACTION(DER_PMIX, PMIx layer error) \
78 \
79 ACTION(DER_IVCB_FORWARD, Incast variable unavailable locally. Must forward) \
80 \
81 ACTION(DER_MISC, Miscellaneous error) \
82 \
83 ACTION(DER_BADPATH, Bad path name) \
84 \
85 ACTION(DER_NOTDIR, Not a directory) \
86 \
87 ACTION(DER_CORPC_INCOMPLETE, Collective RPC failed) \
88 \
89 ACTION(DER_NO_RAS_RANK, No rank is subscribed to RAS) \
90 \
91 ACTION(DER_NOTATTACH, Service group not attached) \
92 \
93 ACTION(DER_MISMATCH, Version mismatch) \
94 \
95 ACTION(DER_EXCLUDED, Rank has been excluded) \
96 \
97 ACTION(DER_NOREPLY, User provided RPC handler did not send reply back) \
98 \
99 ACTION(DER_DOS, Denial of service) \
100 \
101 ACTION(DER_BAD_TARGET, Incorrect target for the RPC) \
102 \
103 ACTION(DER_GRPVER, Group versioning mismatch) \
104 \
105 ACTION(DER_HLC_SYNC, HLC synchronization error) \
106 \
107 ACTION(DER_NO_SHMEM, Not enough shared memory free) \
108 \
109 ACTION(DER_ADD_METRIC_FAILED, Failed to add the specified metric) \
110 \
111 ACTION(DER_DURATION_MISMATCH, Duration end not paired with duration start) \
112 \
113 ACTION(DER_OP_NOT_PERMITTED, Operation not permitted for metric type provided) \
114 \
115 ACTION(DER_EXCEEDS_PATH_LEN, Path name exceeds permitted length) \
116 \
117 ACTION(DER_METRIC_NOT_FOUND, Read failed because metric not found) \
118 \
119 ACTION(DER_SHMEM_PERMS, Unable to access shared memory segment due to incompatible user or group permissions) \
120 \
121 ACTION(DER_HG_FATAL, Fatal transport layer mercury error) \
122 \
123 ACTION(DER_QUOTA_LIMIT, Quota limit reached)
124
125
127#define D_FOREACH_DAOS_ERR(ACTION) \
128 \
129 ACTION(DER_IO, I / O error) \
130 \
131 ACTION(DER_FREE_MEM, Memory free error) \
132 \
133 ACTION(DER_ENOENT, Entity not found) \
134 \
135 ACTION(DER_NOTYPE, Unknown object type) \
136 \
137 ACTION(DER_NOSCHEMA, Unknown object schema) \
138 \
139 ACTION(DER_NOLOCAL, Object is not local) \
140 \
141 ACTION(DER_STALE, Stale pool map version) \
142 \
143 ACTION(DER_NOTLEADER, Not service leader) \
144 \
145 ACTION(DER_TGT_CREATE, Target create error) \
146 \
147 ACTION(DER_EP_RO, Epoch is read only) \
148 \
149 ACTION(DER_EP_OLD, Epoch is too old. All data have been recycled) \
150 \
151 ACTION(DER_KEY2BIG, Key is too large) \
152 \
153 ACTION(DER_REC2BIG, Record is too large) \
154 \
155 ACTION(DER_IO_INVAL, I / O buffers do not match object extents) \
156 \
157 ACTION(DER_EQ_BUSY, Event queue is busy) \
158 \
159 ACTION(DER_DOMAIN, Domain of cluster component do not match) \
160 \
161 ACTION(DER_SHUTDOWN, Service should shut down) \
162 \
163 ACTION(DER_INPROGRESS, Operation now in progress) \
164 \
165 ACTION(DER_NOTAPPLICABLE, Not applicable) \
166 \
167 ACTION(DER_NOTREPLICA, Not a service replica) \
168 \
169 ACTION(DER_CSUM, Checksum error) \
170 \
171 ACTION(DER_DF_INVAL, Unsupported durable format) \
172 \
173 ACTION(DER_DF_INCOMPT, Incompatible durable format version) \
174 \
175 ACTION(DER_REC_SIZE, Record size error) \
176 \
177 ACTION(DER_TX_RESTART, Transaction should restart) \
178 \
179 ACTION(DER_DATA_LOSS, Data lost or not recoverable) \
180 \
181 ACTION(DER_OP_CANCELED, Operation canceled) \
182 \
183 ACTION(DER_TX_BUSY, TX is not committed) \
184 \
185 ACTION(DER_AGENT_INCOMPAT, Agent is incompatible with libdaos) \
186 \
187 ACTION(DER_NEED_TX, To be handled via distributed transaction) \
188 \
189 ACTION(DER_RF, Failures exceed RF) \
190 \
191 ACTION(DER_FETCH_AGAIN, Fetch again) \
192 \
193 ACTION(DER_TX_UNCERTAIN, TX status is uncertain) \
194 \
195 ACTION(DER_AGENT_COMM, Agent communication error) \
196 \
197 ACTION(DER_ID_MISMATCH, ID mismatch) \
198 \
199 ACTION(DER_TGT_RETRY, Retry with other target) \
200 ACTION(DER_NOTSUPPORTED, Operation not supported) \
201 ACTION(DER_CONTROL_INCOMPAT, One or more control plane components are incompatible) \
202 \
203 ACTION(DER_NO_SERVICE, No service available) \
204 \
205 ACTION(DER_TX_ID_REUSED, TX ID may be reused) \
206 \
207 ACTION(DER_UPDATE_AGAIN, update again) \
208 ACTION(DER_NVME_IO, NVMe I / O error) \
209 ACTION(DER_NO_CERT, Unable to access one or more certificates) \
210 ACTION(DER_BAD_CERT, Invalid x509 certificate) \
211 ACTION(DER_VOS_PARTIAL_UPDATE, Same epoch partial overwrite of VOS array value disallowed) \
212 ACTION(DER_CHKPT_BUSY, Page is temporarily read only due to checkpointing) \
213 ACTION(DER_DIV_BY_ZERO, Division by zero) \
214 \
215 ACTION(DER_OVERLOAD_RETRY, "retry later because of overloaded service") \
216 ACTION(DER_NOT_RESUME, Cannot resume former DAOS check instance) \
217 ACTION(DER_CONT_NONEXIST, The specified container does not exist)
218
220#define D_FOREACH_ERR_RANGE(ACTION) \
221 ACTION(GURT, 1000) \
222 ACTION(DAOS, 2000)
223
225#define D_DEFINE_ERRNO(name, desc) name,
227#define D_DEFINE_ERRSTR(name, desc) #name,
229#define D_DEFINE_ERRDESC(name, desc) #desc,
230
232#define D_DEFINE_RANGE_ERRNO(name, base) \
233 DER_ERR_##name##_BASE = (base), D_FOREACH_##name##_ERR(D_DEFINE_ERRNO)
234
236 enum daos_errno {
238 DER_SUCCESS = 0,
239 D_FOREACH_ERR_RANGE(D_DEFINE_RANGE_ERRNO)
241 DER_UNKNOWN = (DER_ERR_GURT_BASE + 500000),
242};
243
250const char *
251d_errstr(int errnum);
252
260const char *
261d_errdesc(int errnum);
262
265
266#define DO_PRAGMA(str) _Pragma(#str)
267#define DEPRECATE_ERROR(olde, newe) \
268({ \
269 DO_PRAGMA(message(#olde " is deprecated, use " #newe)); \
270 newe; \
271})
272#define DER_EVICTED DEPRECATE_ERROR(DER_EVICTED, DER_EXCLUDED)
273
274#ifndef DF_RC
275#define DF_RC "%s(%d): '%s'"
276#define DP_RC(rc) d_errstr(rc), rc, d_errdesc(rc)
277#endif /* DF_RC */
278
279#if defined(__cplusplus)
280}
281#endif
282
283#endif /* __DAOS_ERRNO_H__ */
d_errdesc
const char * d_errdesc(int errnum)
d_errstr
const char * d_errstr(int errnum)
D_FOREACH_ERR_RANGE
#define D_FOREACH_ERR_RANGE(ACTION)
Definition daos_errno.h:220
daos_errno
daos_errno
Definition daos_errno.h:236
D_DEFINE_RANGE_ERRNO
#define D_DEFINE_RANGE_ERRNO(name, base)
Definition daos_errno.h:232
DER_SUCCESS
@ DER_SUCCESS
Definition daos_errno.h:238
DER_UNKNOWN
@ DER_UNKNOWN
Definition daos_errno.h:241