DAOS API (v2.1 - dev)
Loading...
Searching...
No Matches
daos_errno.h
1
10#ifndef __DAOS_ERRNO_H__
11#define __DAOS_ERRNO_H__
12
13#if defined(__cplusplus)
14extern "C" {
15#endif
16
21/*
22 * This preprocessor machinery defines the errno values but also
23 * enables the internal definition of d_errstr. A new macro should
24 * be defined for each non-contiguous range
25 */
26
27/* clang-format off */
28
30#define D_FOREACH_GURT_ERR(ACTION) \
31 \
32 ACTION(DER_NO_PERM, Operation not permitted) \
33 \
34 ACTION(DER_NO_HDL, Invalid handle) \
35 \
36 ACTION(DER_INVAL, Invalid parameters) \
37 \
38 ACTION(DER_EXIST, Entity already exists) \
39 \
40 ACTION(DER_NONEXIST, The specified entity does not exist) \
41 \
42 ACTION(DER_UNREACH, Unreachable node) \
43 \
44 ACTION(DER_NOSPACE, No space on storage target) \
45 \
46 ACTION(DER_ALREADY, Operation already performed) \
47 \
48 ACTION(DER_NOMEM, Out of memory) \
49 \
50 ACTION(DER_NOSYS, Function not implemented) \
51 \
52 ACTION(DER_TIMEDOUT, Time out) \
53 \
54 ACTION(DER_BUSY, Device or resource busy) \
55 \
56 ACTION(DER_AGAIN, Try again) \
57 \
58 ACTION(DER_PROTO, Incompatible protocol) \
59 \
60 ACTION(DER_UNINIT, Device or resource not initialized) \
61 \
62 ACTION(DER_TRUNC, Buffer too short) \
63 \
64 ACTION(DER_OVERFLOW, Data too long for defined data type or buffer size) \
65 \
66 ACTION(DER_CANCELED, Operation canceled) \
67 \
68 ACTION(DER_OOG, Out of group or member list) \
69 \
70 ACTION(DER_HG, Transport layer mercury error) \
71 \
72 ACTION(DER_UNREG, RPC or protocol version not registered) \
73 \
74 ACTION(DER_ADDRSTR_GEN, Failed to generate an address string) \
75 \
76 ACTION(DER_PMIX, PMIx layer error) \
77 \
78 ACTION(DER_IVCB_FORWARD, Incast variable unavailable locally. Must forward) \
79 \
80 ACTION(DER_MISC, Miscellaneous error) \
81 \
82 ACTION(DER_BADPATH, Bad path name) \
83 \
84 ACTION(DER_NOTDIR, Not a directory) \
85 \
86 ACTION(DER_CORPC_INCOMPLETE, Collective RPC failed) \
87 \
88 ACTION(DER_NO_RAS_RANK, No rank is subscribed to RAS) \
89 \
90 ACTION(DER_NOTATTACH, Service group not attached) \
91 \
92 ACTION(DER_MISMATCH, Version mismatch) \
93 \
94 ACTION(DER_EXCLUDED, Rank has been excluded) \
95 \
96 ACTION(DER_NOREPLY, User provided RPC handler did not send reply back) \
97 \
98 ACTION(DER_DOS, Denial of service) \
99 \
100 ACTION(DER_BAD_TARGET, Incorrect target for the RPC) \
101 \
102 ACTION(DER_GRPVER, Group versioning mismatch) \
103 \
104 ACTION(DER_HLC_SYNC, HLC synchronization error) \
105 \
106 ACTION(DER_NO_SHMEM, Not enough shared memory free) \
107 \
108 ACTION(DER_ADD_METRIC_FAILED, Failed to add the specified metric) \
109 \
110 ACTION(DER_DURATION_MISMATCH, Duration end not paired with duration start) \
111 \
112 ACTION(DER_OP_NOT_PERMITTED, Operation not permitted for metric type provided) \
113 \
114 ACTION(DER_EXCEEDS_PATH_LEN, Path name exceeds permitted length) \
115 \
116 ACTION(DER_METRIC_NOT_FOUND, Read failed because metric not found) \
117 \
118 ACTION(DER_SHMEM_PERMS, Unable to access shared memory segment due to incompatible user or group permissions) \
119 \
120 ACTION(DER_HG_FATAL, Fatal transport layer mercury error) \
121 \
122 ACTION(DER_QUOTA_LIMIT, Quota limit reached)
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
218#define D_FOREACH_ERR_RANGE(ACTION) \
219 ACTION(GURT, 1000) \
220 ACTION(DAOS, 2000)
221
223#define D_DEFINE_ERRNO(name, desc) name,
225#define D_DEFINE_ERRSTR(name, desc) #name,
227#define D_DEFINE_ERRDESC(name, desc) #desc,
228
230#define D_DEFINE_RANGE_ERRNO(name, base) \
231 DER_ERR_##name##_BASE = (base), D_FOREACH_##name##_ERR(D_DEFINE_ERRNO)
232
239 DER_UNKNOWN = (DER_ERR_GURT_BASE + 500000),
240};
241
248const char *
249d_errstr(int errnum);
250
258const char *
259d_errdesc(int errnum);
260
264#define DO_PRAGMA(str) _Pragma(#str)
265#define DEPRECATE_ERROR(olde, newe) \
266({ \
267 DO_PRAGMA(message(#olde " is deprecated, use " #newe)); \
268 newe; \
269})
270#define DER_EVICTED DEPRECATE_ERROR(DER_EVICTED, DER_EXCLUDED)
271
272#ifndef DF_RC
273#define DF_RC "%s(%d): '%s'"
274#define DP_RC(rc) d_errstr(rc), rc, d_errdesc(rc)
275#endif /* DF_RC */
276
277#if defined(__cplusplus)
278}
279#endif
280
281#endif /* __DAOS_ERRNO_H__ */
const char * d_errdesc(int errnum)
const char * d_errstr(int errnum)
#define D_FOREACH_ERR_RANGE(ACTION)
Definition daos_errno.h:218
daos_errno
Definition daos_errno.h:234
#define D_DEFINE_RANGE_ERRNO(name, base)
Definition daos_errno.h:230
@ DER_SUCCESS
Definition daos_errno.h:236
@ DER_UNKNOWN
Definition daos_errno.h:239