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
126#define D_FOREACH_DAOS_ERR(ACTION) \
127 \
128 ACTION(DER_IO, I / O error) \
129 \
130 ACTION(DER_FREE_MEM, Memory free error) \
131 \
132 ACTION(DER_ENOENT, Entity not found) \
133 \
134 ACTION(DER_NOTYPE, Unknown object type) \
135 \
136 ACTION(DER_NOSCHEMA, Unknown object schema) \
137 \
138 ACTION(DER_NOLOCAL, Object is not local) \
139 \
140 ACTION(DER_STALE, Stale pool map version) \
141 \
142 ACTION(DER_NOTLEADER, Not service leader) \
143 \
144 ACTION(DER_TGT_CREATE, Target create error) \
145 \
146 ACTION(DER_EP_RO, Epoch is read only) \
147 \
148 ACTION(DER_EP_OLD, Epoch is too old. All data have been recycled) \
149 \
150 ACTION(DER_KEY2BIG, Key is too large) \
151 \
152 ACTION(DER_REC2BIG, Record is too large) \
153 \
154 ACTION(DER_IO_INVAL, I / O buffers do not match object extents) \
155 \
156 ACTION(DER_EQ_BUSY, Event queue is busy) \
157 \
158 ACTION(DER_DOMAIN, Domain of cluster component do not match) \
159 \
160 ACTION(DER_SHUTDOWN, Service should shut down) \
161 \
162 ACTION(DER_INPROGRESS, Operation now in progress) \
163 \
164 ACTION(DER_NOTAPPLICABLE, Not applicable) \
165 \
166 ACTION(DER_NOTREPLICA, Not a service replica) \
167 \
168 ACTION(DER_CSUM, Checksum error) \
169 \
170 ACTION(DER_DF_INVAL, Unsupported durable format) \
171 \
172 ACTION(DER_DF_INCOMPT, Incompatible durable format version) \
173 \
174 ACTION(DER_REC_SIZE, Record size error) \
175 \
176 ACTION(DER_TX_RESTART, Transaction should restart) \
177 \
178 ACTION(DER_DATA_LOSS, Data lost or not recoverable) \
179 \
180 ACTION(DER_OP_CANCELED, Operation canceled) \
181 \
182 ACTION(DER_TX_BUSY, TX is not committed) \
183 \
184 ACTION(DER_AGENT_INCOMPAT, Agent is incompatible with libdaos) \
185 \
186 ACTION(DER_NEED_TX, To be handled via distributed transaction) \
187 \
188 ACTION(DER_RF, Failures exceed RF) \
189 \
190 ACTION(DER_FETCH_AGAIN, Fetch again) \
191 \
192 ACTION(DER_TX_UNCERTAIN, TX status is uncertain) \
193 \
194 ACTION(DER_AGENT_COMM, Agent communication error) \
195 \
196 ACTION(DER_ID_MISMATCH, ID mismatch) \
197 \
198 ACTION(DER_TGT_RETRY, Retry with other target) \
199 ACTION(DER_NOTSUPPORTED, Operation not supported) \
200 ACTION(DER_CONTROL_INCOMPAT, One or more control plane components are incompatible) \
201 \
202 ACTION(DER_NO_SERVICE, No service available) \
203 \
204 ACTION(DER_TX_ID_REUSED, TX ID may be reused) \
205 \
206 ACTION(DER_UPDATE_AGAIN, update again) \
207 ACTION(DER_NVME_IO, NVMe I / O error) \
208 ACTION(DER_NO_CERT, Unable to access one or more certificates) \
209 ACTION(DER_BAD_CERT, Invalid x509 certificate) \
210 ACTION(DER_VOS_PARTIAL_UPDATE, Same epoch partial overwrite of VOS array value disallowed) \
211 ACTION(DER_CHKPT_BUSY, Page is temporarily read only due to checkpointing) \
212 ACTION(DER_DIV_BY_ZERO, Division by zero) \
213 \
214 ACTION(DER_OVERLOAD_RETRY, retry later because of overloaded service) \
215 ACTION(DER_NOT_RESUME, Cannot resume former DAOS check instance) \
216 ACTION(DER_CONT_NONEXIST, The specified container does not exist) \
217 ACTION(DER_CONT_DESTROYING, The specified container is being destroyed)
218
219/* clang-format on */
220
222#define D_FOREACH_ERR_RANGE(ACTION) \
223 ACTION(GURT, 1000) \
224 ACTION(DAOS, 2000)
225
227#define D_DEFINE_ERRNO(name, desc) name,
229#define D_DEFINE_ERRSTR(name, desc) #name,
231#define D_DEFINE_ERRDESC(name, desc) #desc,
232
234#define D_DEFINE_RANGE_ERRNO(name, base) \
235 DER_ERR_##name##_BASE = (base), D_FOREACH_##name##_ERR(D_DEFINE_ERRNO)
236
238 enum daos_errno {
240 DER_SUCCESS = 0,
241 D_FOREACH_ERR_RANGE(D_DEFINE_RANGE_ERRNO)
243 DER_LAST_VALID,
245 DER_UNKNOWN = (DER_ERR_GURT_BASE + 500000),
246};
247
254const char *
255d_errstr(int errnum);
256
264const char *
265d_errdesc(int errnum);
266
269
270#define DO_PRAGMA(str) _Pragma(#str)
271#define DEPRECATE_ERROR(olde, newe) \
272({ \
273 DO_PRAGMA(message(#olde " is deprecated, use " #newe)); \
274 newe; \
275})
276#define DER_EVICTED DEPRECATE_ERROR(DER_EVICTED, DER_EXCLUDED)
277
278#ifndef DF_RC
279#define DF_RC "%s(%d): '%s'"
280#define DP_RC(rc) d_errstr(rc), rc, d_errdesc(rc)
281#endif /* DF_RC */
282
283#if defined(__cplusplus)
284}
285#endif
286
287#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:222
daos_errno
daos_errno
Definition daos_errno.h:238
D_DEFINE_RANGE_ERRNO
#define D_DEFINE_RANGE_ERRNO(name, base)
Definition daos_errno.h:234
DER_LAST_VALID
@ DER_LAST_VALID
Definition daos_errno.h:243
DER_SUCCESS
@ DER_SUCCESS
Definition daos_errno.h:240
DER_UNKNOWN
@ DER_UNKNOWN
Definition daos_errno.h:245