forked from childe/healer
/
errorcode.go
559 lines (492 loc) · 14.7 KB
/
errorcode.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
package healer
import "fmt"
type Error struct {
Errorcode int
ErrorMsg string
ErrorDesc string
Retriable bool
}
func (healerError *Error) Error() string {
return healerError.ErrorDesc
}
var AllError []*Error = make([]*Error, 100)
func getErrorFromErrorCode(errorcode int16) error {
if errorcode == 0 {
return nil
}
if errorcode == -1 {
return AllError[0]
}
return AllError[errorcode]
}
func init() {
for i, _ := range AllError {
AllError[i] = &Error{
Errorcode: i,
ErrorMsg: fmt.Sprintf("NOTDefinedYet%d", i),
ErrorDesc: fmt.Sprintf("%d not defined yet...", i),
}
}
AllError[0] = &Error{
Errorcode: -1,
ErrorMsg: "UNKNOWN_SERVER_ERROR",
ErrorDesc: "The server experienced an unexpected error when processing the request",
Retriable: false,
}
AllError[1] = &Error{
Errorcode: 1,
ErrorMsg: "OFFSET_OUT_OF_RANGE",
ErrorDesc: "The requested offset is not within the range of offsets maintained by the server.",
Retriable: false,
}
AllError[2] = &Error{
Errorcode: 2,
ErrorMsg: "CORRUPT_MESSAGE",
ErrorDesc: "This message has failed its CRC checksum, exceeds the valid size, or is otherwise corrupt.",
Retriable: true,
}
AllError[3] = &Error{
Errorcode: 3,
ErrorMsg: "UNKNOWN_TOPIC_OR_PARTITION",
ErrorDesc: "This server does not host this topic-partition.",
Retriable: true,
}
AllError[4] = &Error{
Errorcode: 4,
ErrorMsg: "INVALID_FETCH_SIZE",
ErrorDesc: "The requested fetch size is invalid.",
Retriable: false,
}
AllError[5] = &Error{
Errorcode: 5,
ErrorMsg: "LEADER_NOT_AVAILABLE",
ErrorDesc: "There is no leader for this topic-partition as we are in the middle of a leadership election.",
Retriable: true,
}
AllError[6] = &Error{
Errorcode: 6,
ErrorMsg: "NOT_LEADER_FOR_PARTITION",
ErrorDesc: "This server is not the leader for that topic-partition.",
Retriable: true,
}
AllError[7] = &Error{
Errorcode: 7,
ErrorMsg: "REQUEST_TIMED_OUT",
ErrorDesc: "The request timed out.",
Retriable: true,
}
AllError[8] = &Error{
Errorcode: 8,
ErrorMsg: "BROKER_NOT_AVAILABLE",
ErrorDesc: "The broker is not available.",
Retriable: false,
}
AllError[9] = &Error{
Errorcode: 9,
ErrorMsg: "REPLICA_NOT_AVAILABLE",
ErrorDesc: "The replica is not available for the requested topic-partition",
Retriable: false,
}
AllError[10] = &Error{
Errorcode: 10,
ErrorMsg: "MESSAGE_TOO_LARGE",
ErrorDesc: "The request included a message larger than the max message size the server will accept.",
Retriable: false,
}
AllError[11] = &Error{
Errorcode: 11,
ErrorMsg: "STALE_CONTROLLER_EPOCH",
ErrorDesc: "The controller moved to another broker.",
Retriable: false,
}
AllError[12] = &Error{
Errorcode: 12,
ErrorMsg: "OFFSET_METADATA_TOO_LARGE",
ErrorDesc: "The metadata field of the offset request was too large.",
Retriable: false,
}
AllError[13] = &Error{
Errorcode: 13,
ErrorMsg: "NETWORK_EXCEPTION",
ErrorDesc: "The server disconnected before a response was received.",
Retriable: true,
}
AllError[14] = &Error{
Errorcode: 14,
ErrorMsg: "COORDINATOR_LOAD_IN_PROGRESS",
ErrorDesc: "The coordinator is loading and hence can't process requests.",
Retriable: true,
}
AllError[15] = &Error{
Errorcode: 15,
ErrorMsg: "COORDINATOR_NOT_AVAILABLE",
ErrorDesc: "The coordinator is not available.",
Retriable: true,
}
AllError[16] = &Error{
Errorcode: 16,
ErrorMsg: "NOT_COORDINATOR",
ErrorDesc: "This is not the correct coordinator.",
Retriable: true,
}
AllError[17] = &Error{
Errorcode: 17,
ErrorMsg: "INVALID_TOPIC_EXCEPTION",
ErrorDesc: "The request attempted to perform an operation on an invalid topic.",
Retriable: false,
}
AllError[18] = &Error{
Errorcode: 18,
ErrorMsg: "RECORD_LIST_TOO_LARGE",
ErrorDesc: "The request included message batch larger than the configured segment size on the server.",
Retriable: false,
}
AllError[19] = &Error{
Errorcode: 19,
ErrorMsg: "NOT_ENOUGH_REPLICAS",
ErrorDesc: "Messages are rejected since there are fewer in-sync replicas than required.",
Retriable: true,
}
AllError[20] = &Error{
Errorcode: 20,
ErrorMsg: "NOT_ENOUGH_REPLICAS_AFTER_APPEND",
ErrorDesc: "Messages are written to the log, but to fewer in-sync replicas than required.",
Retriable: true,
}
AllError[21] = &Error{
Errorcode: 21,
ErrorMsg: "INVALID_REQUIRED_ACKS",
ErrorDesc: "Produce request specified an invalid value for required acks.",
Retriable: false,
}
AllError[22] = &Error{
Errorcode: 22,
ErrorMsg: "ILLEGAL_GENERATION",
ErrorDesc: "Specified group generation id is not valid.",
Retriable: false,
}
AllError[23] = &Error{
Errorcode: 23,
ErrorMsg: "INCONSISTENT_GROUP_PROTOCOL",
ErrorDesc: "The group member's supported protocols are incompatible with those of existing members or first group member tried to join with empty protocol type or empty protocol list.",
Retriable: false,
}
AllError[24] = &Error{
Errorcode: 24,
ErrorMsg: "INVALID_GROUP_ID",
ErrorDesc: "The configured groupId is invalid",
Retriable: false,
}
AllError[25] = &Error{
Errorcode: 25,
ErrorMsg: "UNKNOWN_MEMBER_ID",
ErrorDesc: "The coordinator is not aware of this member.",
Retriable: false,
}
AllError[26] = &Error{
Errorcode: 26,
ErrorMsg: "INVALID_SESSION_TIMEOUT",
ErrorDesc: "The session timeout is not within the range allowed by the broker (as configured by group.min.session.timeout.ms and group.max.session.timeout.ms).",
Retriable: false,
}
AllError[27] = &Error{
Errorcode: 27,
ErrorMsg: "REBALANCE_IN_PROGRESS",
ErrorDesc: "The group is rebalancing, so a rejoin is needed.",
Retriable: false,
}
AllError[28] = &Error{
Errorcode: 28,
ErrorMsg: "INVALID_COMMIT_OFFSET_SIZE",
ErrorDesc: "The committing offset data size is not valid",
Retriable: false,
}
AllError[29] = &Error{
Errorcode: 29,
ErrorMsg: "TOPIC_AUTHORIZATION_FAILED",
ErrorDesc: "Not authorized to access topics: [Topic authorization failed.]",
Retriable: false,
}
AllError[30] = &Error{
Errorcode: 30,
ErrorMsg: "GROUP_AUTHORIZATION_FAILED",
ErrorDesc: "Not authorized to access group: Group authorization failed.",
Retriable: false,
}
AllError[31] = &Error{
Errorcode: 31,
ErrorMsg: "CLUSTER_AUTHORIZATION_FAILED",
ErrorDesc: "Cluster authorization failed.",
Retriable: false,
}
AllError[32] = &Error{
Errorcode: 32,
ErrorMsg: "INVALID_TIMESTAMP",
ErrorDesc: "The timestamp of the message is out of acceptable range.",
Retriable: false,
}
AllError[33] = &Error{
Errorcode: 33,
ErrorMsg: "UNSUPPORTED_SASL_MECHANISM",
ErrorDesc: "The broker does not support the requested SASL mechanism.",
Retriable: false,
}
AllError[34] = &Error{
Errorcode: 34,
ErrorMsg: "ILLEGAL_SASL_STATE",
ErrorDesc: "Request is not valid given the current SASL state.",
Retriable: false,
}
AllError[35] = &Error{
Errorcode: 35,
ErrorMsg: "UNSUPPORTED_VERSION",
ErrorDesc: "The version of API is not supported.",
Retriable: false,
}
AllError[36] = &Error{
Errorcode: 36,
ErrorMsg: "TOPIC_ALREADY_EXISTS",
ErrorDesc: "Topic with this name already exists.",
Retriable: false,
}
AllError[37] = &Error{
Errorcode: 37,
ErrorMsg: "INVALID_PARTITIONS",
ErrorDesc: "Number of partitions is invalid.",
Retriable: false,
}
AllError[38] = &Error{
Errorcode: 38,
ErrorMsg: "INVALID_REPLICATION_FACTOR",
ErrorDesc: "Replication-factor is invalid.",
Retriable: false,
}
AllError[39] = &Error{
Errorcode: 39,
ErrorMsg: "INVALID_REPLICA_ASSIGNMENT",
ErrorDesc: "Replica assignment is invalid.",
Retriable: false,
}
AllError[40] = &Error{
Errorcode: 40,
ErrorMsg: "INVALID_CONFIG",
ErrorDesc: "Configuration is invalid.",
Retriable: false,
}
AllError[41] = &Error{
Errorcode: 41,
ErrorMsg: "NOT_CONTROLLER",
ErrorDesc: "This is not the correct controller for this cluster.",
Retriable: true,
}
AllError[42] = &Error{
Errorcode: 42,
ErrorMsg: "INVALID_REQUEST",
ErrorDesc: "This most likely occurs because of a request being malformed by the client library or the message was sent to an incompatible broker. See the broker logs for more details.",
Retriable: false,
}
AllError[43] = &Error{
Errorcode: 43,
ErrorMsg: "UNSUPPORTED_FOR_MESSAGE_FORMAT",
ErrorDesc: "The message format version on the broker does not support the request.",
Retriable: false,
}
AllError[44] = &Error{
Errorcode: 44,
ErrorMsg: "POLICY_VIOLATION",
ErrorDesc: "Request parameters do not satisfy the configured policy.",
Retriable: false,
}
AllError[45] = &Error{
Errorcode: 45,
ErrorMsg: "OUT_OF_ORDER_SEQUENCE_NUMBER",
ErrorDesc: "The broker received an out of order sequence number",
Retriable: false,
}
AllError[46] = &Error{
Errorcode: 46,
ErrorMsg: "DUPLICATE_SEQUENCE_NUMBER",
ErrorDesc: "The broker received a duplicate sequence number",
Retriable: false,
}
AllError[47] = &Error{
Errorcode: 47,
ErrorMsg: "INVALID_PRODUCER_EPOCH",
ErrorDesc: "Producer attempted an operation with an old epoch. Either there is a newer producer with the same transactionalId, or the producer's transaction has been expired by the broker.",
Retriable: false,
}
AllError[48] = &Error{
Errorcode: 48,
ErrorMsg: "INVALID_TXN_STATE",
ErrorDesc: "The producer attempted a transactional operation in an invalid state",
Retriable: false,
}
AllError[49] = &Error{
Errorcode: 49,
ErrorMsg: "INVALID_PRODUCER_ID_MAPPING",
ErrorDesc: "The producer attempted to use a producer id which is not currently assigned to its transactional id",
Retriable: false,
}
AllError[50] = &Error{
Errorcode: 50,
ErrorMsg: "INVALID_TRANSACTION_TIMEOUT",
ErrorDesc: "The transaction timeout is larger than the maximum value allowed by the broker (as configured by max.transaction.timeout.ms).",
Retriable: false,
}
AllError[51] = &Error{
Errorcode: 51,
ErrorMsg: "CONCURRENT_TRANSACTIONS",
ErrorDesc: "The producer attempted to update a transaction while another concurrent operation on the same transaction was ongoing",
Retriable: false,
}
AllError[52] = &Error{
Errorcode: 52,
ErrorMsg: "TRANSACTION_COORDINATOR_FENCED",
ErrorDesc: "Indicates that the transaction coordinator sending a WriteTxnMarker is no longer the current coordinator for a given producer",
Retriable: false,
}
AllError[53] = &Error{
Errorcode: 53,
ErrorMsg: "TRANSACTIONAL_ID_AUTHORIZATION_FAILED",
ErrorDesc: "Transactional Id authorization failed",
Retriable: false,
}
AllError[54] = &Error{
Errorcode: 54,
ErrorMsg: "SECURITY_DISABLED",
ErrorDesc: "Security features are disabled.",
Retriable: false,
}
AllError[55] = &Error{
Errorcode: 55,
ErrorMsg: "OPERATION_NOT_ATTEMPTED",
ErrorDesc: "The broker did not attempt to execute this operation. This may happen for batched RPCs where some operations in the batch failed, causing the broker to respond without trying the rest.",
Retriable: false,
}
AllError[56] = &Error{
Errorcode: 56,
ErrorMsg: "KAFKA_STORAGE_ERROR",
ErrorDesc: "Disk error when trying to access log file on the disk.",
Retriable: true,
}
AllError[57] = &Error{
Errorcode: 57,
ErrorMsg: "LOG_DIR_NOT_FOUND",
ErrorDesc: "The user-specified log directory is not found in the broker config.",
Retriable: false,
}
AllError[58] = &Error{
Errorcode: 58,
ErrorMsg: "SASL_AUTHENTICATION_FAILED",
ErrorDesc: "SASL Authentication failed.",
Retriable: false,
}
AllError[59] = &Error{
Errorcode: 59,
ErrorMsg: "UNKNOWN_PRODUCER_ID",
ErrorDesc: "This exception is raised by the broker if it could not locate the producer metadata associated with the producerId in question. This could happen if, for instance, the producer's records were deleted because their retention time had elapsed. Once the last records of the producerId are removed, the producer's metadata is removed from the broker, and future appends by the producer will return this exception.",
Retriable: false,
}
AllError[60] = &Error{
Errorcode: 60,
ErrorMsg: "REASSIGNMENT_IN_PROGRESS",
ErrorDesc: "A partition reassignment is in progress",
Retriable: false,
}
AllError[61] = &Error{
ErrorMsg: "DELEGATION_TOKEN_AUTH_DISABLED",
Errorcode: 61,
ErrorDesc: "Delegation Token feature is not enabled.",
Retriable: false,
}
AllError[62] = &Error{
ErrorMsg: "DELEGATION_TOKEN_NOT_FOUND",
Errorcode: 62,
ErrorDesc: "Delegation Token is not found on server.",
Retriable: false,
}
AllError[63] = &Error{
ErrorMsg: "DELEGATION_TOKEN_OWNER_MISMATCH",
Errorcode: 63,
ErrorDesc: "Specified Principal is not valid Owner/Renewer.",
Retriable: false,
}
AllError[64] = &Error{
ErrorMsg: "DELEGATION_TOKEN_REQUEST_NOT_ALLOWED",
Errorcode: 64,
ErrorDesc: "Delegation Token requests are not allowed on PLAINTEXT/1-way SSL channels and on delegation token authenticated channels.",
Retriable: false,
}
AllError[65] = &Error{
ErrorMsg: "DELEGATION_TOKEN_AUTHORIZATION_FAILED",
Errorcode: 65,
ErrorDesc: "Delegation Token authorization failed",
Retriable: false,
}
AllError[66] = &Error{
ErrorMsg: "DELEGATION_TOKEN_EXPIRED",
Errorcode: 66,
ErrorDesc: "Delegation Token is expired.",
Retriable: false,
}
AllError[67] = &Error{
ErrorMsg: "INVALID_PRINCIPAL_TYPE",
Errorcode: 67,
ErrorDesc: "Supplied principalType is not supported.",
Retriable: false,
}
AllError[68] = &Error{
ErrorMsg: "NON_EMPTY_GROUP",
Errorcode: 68,
ErrorDesc: "The group is not empty.",
Retriable: false,
}
AllError[69] = &Error{
ErrorMsg: "GROUP_ID_NOT_FOUND",
Errorcode: 69,
ErrorDesc: "The group id does not exist.",
Retriable: false,
}
AllError[70] = &Error{
ErrorMsg: "FETCH_SESSION_ID_NOT_FOUND",
Errorcode: 70,
ErrorDesc: "The fetch session ID was not found.",
Retriable: true,
}
AllError[71] = &Error{
ErrorMsg: "INVALID_FETCH_SESSION_EPOCH",
Errorcode: 71,
ErrorDesc: "The fetch session epoch is invalid.",
Retriable: true,
}
AllError[72] = &Error{
ErrorMsg: "LISTENER_NOT_FOUND",
Errorcode: 72,
ErrorDesc: "There is no listener on the leader broker that matches the listener on which metadata request was processed.",
Retriable: true,
}
AllError[73] = &Error{
ErrorMsg: "TOPIC_DELETION_DISABLED",
Errorcode: 73,
ErrorDesc: "Topic deletion is disabled.",
Retriable: false,
}
AllError[74] = &Error{
ErrorMsg: "FENCED_LEADER_EPOCH",
Errorcode: 74,
ErrorDesc: "The leader epoch in the request is older than the epoch on the broker",
Retriable: true,
}
AllError[75] = &Error{
ErrorMsg: "UNKNOWN_LEADER_EPOCH",
Errorcode: 75,
ErrorDesc: "The leader epoch in the request is newer than the epoch on the broker",
Retriable: true,
}
AllError[76] = &Error{
ErrorMsg: "UNSUPPORTED_COMPRESSION_TYPE",
Errorcode: 76,
ErrorDesc: "The requesting client does not support the compression type of given partition.",
Retriable: false,
}
}