As a web developer, I'm developing a project, which use cnosdb by http-request. For some security reasons, I have to hide the full error message. So I need to classify the error content. My problem is, Where can I find the error list of CnosDB?
There doesn't seem to be a list of all the error codes. You can find some of the codes by looking at the source code, for example https://github.com/cnosdb/cnosdb/blob/05573409a8887e071d66601bc793b32a6b9829f7/coordinator/src/errors.rs lists all of the 0500xx
codes. For some the message is directly included in the file, for others the message is included in another file that includes errors.rs
(for example 050014 is defined at https://github.com/cnosdb/cnosdb/blob/19db70776de9f10f7612f5bef44f81d5ffb148f4/coordinator/src/writer.rs#L223). For the errors of category 01, 02, 03 the code does not contain the numbers explicitly, instead the number is defined by the position in an Enum
. To get a complete overview it would therefore be required to patch all these pieces of code together, which would be rather time-consuming.
However, a quick but incomplete list can be found by searching in the test cases. This produces the following list (cleaned/deduplicated manually by me):
{"error_code":"010001","error_message":"Datafusion: Error during planning: Coercion from [Int64, Int64] to the signature Uniform(1, [Utf8, LargeUtf8, Binary, LargeBinary]) failed."}
{"error_code":"010001","error_message":"Datafusion: Error during planning: failed to resolve tenant:cnosdb db: createtable, table: test0"}
{"error_code":"010001","error_message":"Datafusion: Error during planning: Inconsistent data type across values list at row 1 column 1"}
{"error_code":"010001","error_message":"Datafusion: Error during planning: 'Int64 + Boolean' can't be evaluated because there isn't a common type to coerce the types to"}
{"error_code":"010001","error_message":"Datafusion: Error during planning: Invalid function 'bit_and'"}
{"error_code":"010001","error_message":"Datafusion: Error during planning: Projection references non-aggregate values: Expression m0.f0 could not be resolved from available columns: nullif(totimestamp(Int64(6636546679321595330)),totimestamp(Int64(8689896046418229165))), (- totimestamp(Int64(3346426503103871098)) IN (Map { iter: Iter([totimestamp(Int64(8796381831174491673)), totimestamp(Int64(7388672143893169360))]) })), SUM(ceil((- substr(m0.t0,Int64(5506560410096687103),Int64(-874633900)))))"}
{"error_code":"010001","error_message":"Datafusion: Error during planning: Projections require unique expression names but the expression \"public.test.time\" at position 0 and \"public.test.time\" at position 3 have the same name. Consider aliasing (\"AS\") one of them."}
{"error_code":"010001","error_message":"Datafusion: Error during planning: SELECT * with no tables specified is not valid"}
{"error_code":"010001","error_message":"Datafusion: Error during planning: The function Sum does not support inputs of type Null."}
{"error_code":"010001","error_message":"Datafusion: Internal error: Min/Max accumulator not implemented for type Boolean. This was likely caused by a bug in DataFusion's code and we would welcome that you file an bug report in our issue tracker"}
{"error_code":"010001","error_message":"Datafusion: Internal error: Unsupported data type Ok(UInt64) for function to_timestamp_seconds. This was likely caused by a bug in DataFusion's code and we would welcome that you file an bug report in our issue tracker"}
{"error_code":"010001","error_message":"Datafusion: Schema error: No field named 'f0'. Valid fields are 'key', 'value'."}
{"error_code":"010001","error_message":"Datafusion: Schema error: No field named 'm0'.'t0'. Valid fields are 'SUM((- round(m0.f0)))'."}
{"error_code":"010001","error_message":"Datafusion: simplify_expressions\ncaused by\nInternal error: Optimizer rule 'simplify_expressions' failed due to unexpected error: Arrow error: Cast error: Cannot cast string '0.405601854465989730.5010374883053191' to value of Int64 type. This was likely caused by a bug in DataFusion's code and we would welcome that you file an bug report in our issue tracker"}
{"error_code":"010001","error_message":"Datafusion: This feature is not implemented: sql numeric literals in scientific notation are not supported"}
{"error_code":"010001","error_message":"Datafusion: This feature is not implemented: Unsupported CAST from Boolean to Timestamp(Nanosecond, None)"}
{"error_code":"010001","error_message":"Datafusion: This feature is not implemented: Unsupported value InList { expr: Nested(Nested(BinaryOp { left: Nested(Cast { expr: Value(Number(\"0.7382978061623816\", false)), data_type: String }), op: StringConcat, right: Nested(Cast { expr: Value(Boolean(false)), data_type: String }) })), list: [Value(SingleQuotedString(\"9sP䋛zqeoM\")), Value(SingleQuotedString(\"k*G\"))], negated: true } in a values list expression"}
{"error_code":"010001","error_message":"Datafusion: transform_bottom_func_to_topk_node\ncaused by\nInternal error: Optimizer rule 'transform_bottom_func_to_topk_node' failed due to unexpected error: Error during planning: 1. There cannot be nested selection functions. 2. There cannot be multiple selection functions., found: [\n BOTTOM(m2.time, Int64(2)),\n TOPK(m2.t0, Int64(3)),\n]. This was likely caused by a bug in DataFusion's code and we would welcome that you file an bug report in our issue tracker"}
{"error_code":"010001","error_message":"Datafusion: type_coercion\ncaused by\nInternal error: Optimizer rule 'type_coercion' failed due to unexpected error: Error during planning: 'Binary IS NOT DISTINCT FROM Utf8' can't be evaluated because there isn't a common type to coerce the types to. This was likely caused by a bug in DataFusion's code and we would welcome that you file an bug report in our issue tracker"}
{"error_code":"010002","error_message":"Arrow: Cast error: Cannot cast string '10a' to value of Float64 type"}
{"error_code":"010002","error_message":"Arrow: Divide by zero error"}
{"error_code":"010003","error_message":"Semantic error: Can not alter database precision"}
{"error_code":"010009","error_message":"sql parser error: already have timestamp column"}
{"error_code":"010009","error_message":"sql parser error: BOOLE is not a supported type"}
{"error_code":"010009","error_message":"sql parser error: DEL is not valid encoding"}
{"error_code":"010009","error_message":"sql parser error: expect codec encoding type in ()"}
{"error_code":"010009","error_message":"sql parser error: Expected an SQL statement, found: c"}
{"error_code":"010009","error_message":"sql parser error: Expected AS, found: NOTNULL"}
{"error_code":"010009","error_message":"sql parser error: Expected end of statement, found: NOTNULL"}
{"error_code":"010009","error_message":"sql parser error: Expected field columns when create table"}
{"error_code":"010009","error_message":"sql parser error: Unterminated string literal at Line: 1, Column 36"}
{"error_code":"010027","error_message":"Semantic error: Field or Tag have the same name column1"}
{"error_code":"010028","error_message":"Semantic error: column column7 already exists in table test0"}
{"error_code":"010029","error_message":"Semantic error: Column c not exists in table test_dps_table"}
{"error_code":"010030","error_message":"Semantic error: Can't drop tag column column7."}
{"error_code":"010032","error_message":"Semantic error: There must be at least one field column."}
{"error_code":"010033","error_message":"Semantic error: There must be at least one tag column. "}
{"error_code":"010034","error_message":"Semantic error: Tag does not support compression"}
{"error_code":"010035","error_message":"Semantic error: Column time does not support modification"}
{"error_code":"010036","error_message":"Semantic error: DB public conflict with table show_series.test"}
{"error_code":"010045","error_message":"Semantic error: Insert columns and Source columns not match"}
{"error_code":"010046","error_message":"Semantic error: SHOW SERIES does not support where clause contains field f1"}
{"error_code":"010061","error_message":"Tenant \"cnosdb\" forbid drop"}
{"error_code":"010062","error_message":"Database \"public\" forbid drop"}
{"error_code":"020002","error_message":"Fields can't be empty"}
{"error_code":"030017","error_message":"Database not found: \"cluster_schema\""}
{"error_code":"030019","error_message":"Table not found: \"cnosdb.createtable.test2\""}
{"error_code":"030020","error_message":"Table cnosdb.createtable.test0 already exists."}
{"error_code":"050014","error_message":"write expired time data not permit"}