10#ifndef __DAOS_ERRNO_H__
11#define __DAOS_ERRNO_H__
13#if defined(__cplusplus)
30#define D_FOREACH_GURT_ERR(ACTION) \
32 ACTION(DER_NO_PERM, Operation not permitted) \
34 ACTION(DER_NO_HDL, Invalid handle) \
36 ACTION(DER_INVAL, Invalid parameters) \
38 ACTION(DER_EXIST, Entity already exists) \
40 ACTION(DER_NONEXIST, The specified entity does not exist) \
42 ACTION(DER_UNREACH, Unreachable node) \
44 ACTION(DER_NOSPACE, No space on storage target) \
46 ACTION(DER_ALREADY, Operation already performed) \
48 ACTION(DER_NOMEM, Out of memory) \
50 ACTION(DER_NOSYS, Function not implemented) \
52 ACTION(DER_TIMEDOUT, Time out) \
54 ACTION(DER_BUSY, Device or resource busy) \
56 ACTION(DER_AGAIN, Try again) \
58 ACTION(DER_PROTO, Incompatible protocol) \
60 ACTION(DER_UNINIT, Device or resource not initialized) \
62 ACTION(DER_TRUNC, Buffer too short) \
64 ACTION(DER_OVERFLOW, Data too long for defined data type or buffer size) \
66 ACTION(DER_CANCELED, Operation canceled) \
68 ACTION(DER_OOG, Out of group or member list) \
70 ACTION(DER_HG, Transport layer mercury error) \
72 ACTION(DER_UNREG, RPC or protocol version not registered) \
74 ACTION(DER_ADDRSTR_GEN, Failed to generate an address string) \
76 ACTION(DER_PMIX, PMIx layer error) \
78 ACTION(DER_IVCB_FORWARD, Incast variable unavailable locally. Must forward) \
80 ACTION(DER_MISC, Miscellaneous error) \
82 ACTION(DER_BADPATH, Bad path name) \
84 ACTION(DER_NOTDIR, Not a directory) \
86 ACTION(DER_CORPC_INCOMPLETE, Collective RPC failed) \
88 ACTION(DER_NO_RAS_RANK, No rank is subscribed to RAS) \
90 ACTION(DER_NOTATTACH, Service group not attached) \
92 ACTION(DER_MISMATCH, Version mismatch) \
94 ACTION(DER_EXCLUDED, Rank has been excluded) \
96 ACTION(DER_NOREPLY, User provided RPC handler did not send reply back) \
98 ACTION(DER_DOS, Denial of service) \
100 ACTION(DER_BAD_TARGET, Incorrect target for the RPC) \
102 ACTION(DER_GRPVER, Group versioning mismatch) \
104 ACTION(DER_HLC_SYNC, HLC synchronization error) \
106 ACTION(DER_NO_SHMEM, Not enough shared memory free) \
108 ACTION(DER_ADD_METRIC_FAILED, Failed to add the specified metric) \
110 ACTION(DER_DURATION_MISMATCH, Duration end not paired with duration start) \
112 ACTION(DER_OP_NOT_PERMITTED, Operation not permitted for metric type provided) \
114 ACTION(DER_EXCEEDS_PATH_LEN, Path name exceeds permitted length) \
116 ACTION(DER_METRIC_NOT_FOUND, Read failed because metric not found) \
118 ACTION(DER_SHMEM_PERMS, Unable to access shared memory segment due to incompatible user or group permissions) \
120 ACTION(DER_HG_FATAL, Fatal transport layer mercury error) \
122 ACTION(DER_QUOTA_LIMIT, Quota limit reached)
126#define D_FOREACH_DAOS_ERR(ACTION) \
128 ACTION(DER_IO, I / O error) \
130 ACTION(DER_FREE_MEM, Memory free error) \
132 ACTION(DER_ENOENT, Entity not found) \
134 ACTION(DER_NOTYPE, Unknown object type) \
136 ACTION(DER_NOSCHEMA, Unknown object schema) \
138 ACTION(DER_NOLOCAL, Object is not local) \
140 ACTION(DER_STALE, Stale pool map version) \
142 ACTION(DER_NOTLEADER, Not service leader) \
144 ACTION(DER_TGT_CREATE, Target create error) \
146 ACTION(DER_EP_RO, Epoch is read only) \
148 ACTION(DER_EP_OLD, Epoch is too old. All data have been recycled) \
150 ACTION(DER_KEY2BIG, Key is too large) \
152 ACTION(DER_REC2BIG, Record is too large) \
154 ACTION(DER_IO_INVAL, I / O buffers do not match object extents) \
156 ACTION(DER_EQ_BUSY, Event queue is busy) \
158 ACTION(DER_DOMAIN, Domain of cluster component do not match) \
160 ACTION(DER_SHUTDOWN, Service should shut down) \
162 ACTION(DER_INPROGRESS, Operation now in progress) \
164 ACTION(DER_NOTAPPLICABLE, Not applicable) \
166 ACTION(DER_NOTREPLICA, Not a service replica) \
168 ACTION(DER_CSUM, Checksum error) \
170 ACTION(DER_DF_INVAL, Unsupported durable format) \
172 ACTION(DER_DF_INCOMPT, Incompatible durable format version) \
174 ACTION(DER_REC_SIZE, Record size error) \
176 ACTION(DER_TX_RESTART, Transaction should restart) \
178 ACTION(DER_DATA_LOSS, Data lost or not recoverable) \
180 ACTION(DER_OP_CANCELED, Operation canceled) \
182 ACTION(DER_TX_BUSY, TX is not committed) \
184 ACTION(DER_AGENT_INCOMPAT, Agent is incompatible with libdaos) \
186 ACTION(DER_NEED_TX, To be handled via distributed transaction) \
188 ACTION(DER_RF, Failures exceed RF) \
190 ACTION(DER_FETCH_AGAIN, Fetch again) \
192 ACTION(DER_TX_UNCERTAIN, TX status is uncertain) \
194 ACTION(DER_AGENT_COMM, Agent communication error) \
196 ACTION(DER_ID_MISMATCH, ID mismatch) \
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) \
202 ACTION(DER_NO_SERVICE, No service available) \
204 ACTION(DER_TX_ID_REUSED, TX ID may be reused) \
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) \
214 ACTION(DER_OVERLOAD_RETRY, "retry later because of overloaded service") \
215 ACTION(DER_NOT_RESUME, Cannot resume former DAOS check instance)
218#define D_FOREACH_ERR_RANGE(ACTION) \
223#define D_DEFINE_ERRNO(name, desc) name,
225#define D_DEFINE_ERRSTR(name, desc) #name,
227#define D_DEFINE_ERRDESC(name, desc) #desc,
230#define D_DEFINE_RANGE_ERRNO(name, base) \
231 DER_ERR_##name##_BASE = (base), D_FOREACH_##name##_ERR(D_DEFINE_ERRNO)
264#define DO_PRAGMA(str) _Pragma(#str)
265#define DEPRECATE_ERROR(olde, newe) \
267 DO_PRAGMA(message(#olde " is deprecated, use " #newe)); \
270#define DER_EVICTED DEPRECATE_ERROR(DER_EVICTED, DER_EXCLUDED)
273#define DF_RC "%s(%d): '%s'"
274#define DP_RC(rc) d_errstr(rc), rc, d_errdesc(rc)
277#if defined(__cplusplus)
const char * d_errdesc(int errnum)
const char * d_errstr(int errnum)
#define D_FOREACH_ERR_RANGE(ACTION)
#define D_DEFINE_RANGE_ERRNO(name, base)