11#ifndef __DAOS_ERRNO_H__
12#define __DAOS_ERRNO_H__
14#if defined(__cplusplus)
31#define D_FOREACH_GURT_ERR(ACTION) \
33 ACTION(DER_NO_PERM, Operation not permitted) \
35 ACTION(DER_NO_HDL, Invalid handle) \
37 ACTION(DER_INVAL, Invalid parameters) \
39 ACTION(DER_EXIST, Entity already exists) \
41 ACTION(DER_NONEXIST, The specified entity does not exist) \
43 ACTION(DER_UNREACH, Unreachable node) \
45 ACTION(DER_NOSPACE, No space on storage target) \
47 ACTION(DER_ALREADY, Operation already performed) \
49 ACTION(DER_NOMEM, Out of memory) \
51 ACTION(DER_NOSYS, Function not implemented) \
53 ACTION(DER_TIMEDOUT, Time out) \
55 ACTION(DER_BUSY, Device or resource busy) \
57 ACTION(DER_AGAIN, Try again) \
59 ACTION(DER_PROTO, Incompatible protocol) \
61 ACTION(DER_UNINIT, Device or resource not initialized) \
63 ACTION(DER_TRUNC, Buffer too short) \
65 ACTION(DER_OVERFLOW, Data too long for defined data type or buffer size) \
67 ACTION(DER_CANCELED, Operation canceled) \
69 ACTION(DER_OOG, Out of group or member list) \
71 ACTION(DER_HG, Transport layer mercury error) \
73 ACTION(DER_UNREG, RPC or protocol version not registered) \
75 ACTION(DER_ADDRSTR_GEN, Failed to generate an address string) \
77 ACTION(DER_PMIX, PMIx layer error) \
79 ACTION(DER_IVCB_FORWARD, Incast variable unavailable locally. Must forward) \
81 ACTION(DER_MISC, Miscellaneous error) \
83 ACTION(DER_BADPATH, Bad path name) \
85 ACTION(DER_NOTDIR, Not a directory) \
87 ACTION(DER_CORPC_INCOMPLETE, Collective RPC failed) \
89 ACTION(DER_NO_RAS_RANK, No rank is subscribed to RAS) \
91 ACTION(DER_NOTATTACH, Service group not attached) \
93 ACTION(DER_MISMATCH, Version mismatch) \
95 ACTION(DER_EXCLUDED, Rank has been excluded) \
97 ACTION(DER_NOREPLY, User provided RPC handler did not send reply back) \
99 ACTION(DER_DOS, Denial of service) \
101 ACTION(DER_BAD_TARGET, Incorrect target for the RPC) \
103 ACTION(DER_GRPVER, Group versioning mismatch) \
105 ACTION(DER_HLC_SYNC, HLC synchronization error) \
107 ACTION(DER_NO_SHMEM, Not enough shared memory free) \
109 ACTION(DER_ADD_METRIC_FAILED, Failed to add the specified metric) \
111 ACTION(DER_DURATION_MISMATCH, Duration end not paired with duration start) \
113 ACTION(DER_OP_NOT_PERMITTED, Operation not permitted for metric type provided) \
115 ACTION(DER_EXCEEDS_PATH_LEN, Path name exceeds permitted length) \
117 ACTION(DER_METRIC_NOT_FOUND, Read failed because metric not found) \
119 ACTION(DER_SHMEM_PERMS, Unable to access shared memory segment due to incompatible user or group permissions) \
121 ACTION(DER_HG_FATAL, Fatal transport layer mercury error) \
123 ACTION(DER_QUOTA_LIMIT, Quota limit reached)
127#define D_FOREACH_DAOS_ERR(ACTION) \
129 ACTION(DER_IO, I / O error) \
131 ACTION(DER_FREE_MEM, Memory free error) \
133 ACTION(DER_ENOENT, Entity not found) \
135 ACTION(DER_NOTYPE, Unknown object type) \
137 ACTION(DER_NOSCHEMA, Unknown object schema) \
139 ACTION(DER_NOLOCAL, Object is not local) \
141 ACTION(DER_STALE, Stale pool map version) \
143 ACTION(DER_NOTLEADER, Not service leader) \
145 ACTION(DER_TGT_CREATE, Target create error) \
147 ACTION(DER_EP_RO, Epoch is read only) \
149 ACTION(DER_EP_OLD, Epoch is too old. All data have been recycled) \
151 ACTION(DER_KEY2BIG, Key is too large) \
153 ACTION(DER_REC2BIG, Record is too large) \
155 ACTION(DER_IO_INVAL, I / O buffers do not match object extents) \
157 ACTION(DER_EQ_BUSY, Event queue is busy) \
159 ACTION(DER_DOMAIN, Domain of cluster component do not match) \
161 ACTION(DER_SHUTDOWN, Service should shut down) \
163 ACTION(DER_INPROGRESS, Operation now in progress) \
165 ACTION(DER_NOTAPPLICABLE, Not applicable) \
167 ACTION(DER_NOTREPLICA, Not a service replica) \
169 ACTION(DER_CSUM, Checksum error) \
171 ACTION(DER_DF_INVAL, Unsupported durable format) \
173 ACTION(DER_DF_INCOMPT, Incompatible durable format version) \
175 ACTION(DER_REC_SIZE, Record size error) \
177 ACTION(DER_TX_RESTART, Transaction should restart) \
179 ACTION(DER_DATA_LOSS, Data lost or not recoverable) \
181 ACTION(DER_OP_CANCELED, Operation canceled) \
183 ACTION(DER_TX_BUSY, TX is not committed) \
185 ACTION(DER_AGENT_INCOMPAT, Agent is incompatible with libdaos) \
187 ACTION(DER_NEED_TX, To be handled via distributed transaction) \
189 ACTION(DER_RF, Failures exceed RF) \
191 ACTION(DER_FETCH_AGAIN, Fetch again) \
193 ACTION(DER_TX_UNCERTAIN, TX status is uncertain) \
195 ACTION(DER_AGENT_COMM, Agent communication error) \
197 ACTION(DER_ID_MISMATCH, ID mismatch) \
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) \
203 ACTION(DER_NO_SERVICE, No service available) \
205 ACTION(DER_TX_ID_REUSED, TX ID may be reused) \
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) \
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)
220#define D_FOREACH_ERR_RANGE(ACTION) \
225#define D_DEFINE_ERRNO(name, desc) name,
227#define D_DEFINE_ERRSTR(name, desc) #name,
229#define D_DEFINE_ERRDESC(name, desc) #desc,
232#define D_DEFINE_RANGE_ERRNO(name, base) \
233 DER_ERR_##name##_BASE = (base), D_FOREACH_##name##_ERR(D_DEFINE_ERRNO)
266#define DO_PRAGMA(str) _Pragma(#str)
267#define DEPRECATE_ERROR(olde, newe) \
269 DO_PRAGMA(message(#olde " is deprecated, use " #newe)); \
272#define DER_EVICTED DEPRECATE_ERROR(DER_EVICTED, DER_EXCLUDED)
275#define DF_RC "%s(%d): '%s'"
276#define DP_RC(rc) d_errstr(rc), rc, d_errdesc(rc)
279#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)