There can be some errors that occur if the data received from the ShineMaster is corrupted or zero-ed out:
2023-12-30T02:09:30.671647Z ERROR inverter_data_handler: tracing_panic: A panic occurred panic.payload="called `Option::unwrap()` on a `None` value" panic.location="src/data_message.rs:102:26"
2024-02-03T18:48:32.791991Z ERROR inverter_data_handler: tracing_panic: A panic occurred panic.payload="called `Result::unwrap()` on an `Err` value: Database(PgDatabaseError { severity: Error, code: \"22021\", message: \"invalid byte sequence for encoding \\\"UTF8\\\": 0x00\", detail: None, hint: None, position: None, where: Some(\"unnamed portal parameter $3\"), schema: None, table: None, column: None, data_type: None, constraint: None, file: Some(\"mbutils.c\"), line: Some(1665), routine: Some(\"report_invalid_encoding\") })" panic.location="src/server.rs:104:14"
2024-02-13T12:23:52.227792Z ERROR inverter_data_handler: tracing_panic: A panic occurred panic.payload="called `Option::unwrap()` on a `None` value" panic.location="src/data_message.rs:102:26"
2024-02-13T12:34:17.505298Z ERROR inverter_data_handler: tracing_panic: A panic occurred panic.payload="called `Result::unwrap()` on an `Err` value: Database(PgDatabaseError { severity: Error, code: \"22021\", message: \"invalid byte sequence for encoding \\\"UTF8\\\": 0x00\", detail: None, hint: None, position: None, where: Some(\"unnamed portal parameter $3\"), schema: None, table: None, column: None, data_type: None, constraint: None, file: Some(\"mbutils.c\"), line: Some(1665), routine: Some(\"report_invalid_encoding\") })" panic.location="src/server.rs:104:14"
2024-02-26T14:07:15.191806Z ERROR inverter_data_handler: tracing_panic: A panic occurred panic.payload="called `Option::unwrap()` on a `None` value" panic.location="src/data_message.rs:102:26"
2024-02-26T14:17:45.372266Z ERROR inverter_data_handler: tracing_panic: A panic occurred panic.payload="called `Result::unwrap()` on an `Err` value: Database(PgDatabaseError { severity: Error, code: \"22021\", message: \"invalid byte sequence for encoding \\\"UTF8\\\": 0x00\", detail: None, hint: None, position: None, where: Some(\"unnamed portal parameter $3\"), schema: None, table: None, column: None, data_type: None, constraint: None, file: Some(\"mbutils.c\"), line: Some(1665), routine: Some(\"report_invalid_encoding\") })" panic.location="src/server.rs:104:14"
2024-03-19T10:56:17.489255Z ERROR inverter_data_handler: tracing_panic: A panic occurred panic.payload="called `Option::unwrap()` on a `None` value" panic.location="src/data_message.rs:102:26"
2024-03-19T11:16:48.668612Z ERROR inverter_data_handler: tracing_panic: A panic occurred panic.payload="called `Result::unwrap()` on an `Err` value: Database(PgDatabaseError { severity: Error, code: \"22021\", message: \"invalid byte sequence for encoding \\\"UTF8\\\": 0x00\", detail: None, hint: None, position: None, where: Some(\"unnamed portal parameter $3\"), schema: None, table: None, column: None, data_type: None, constraint: None, file: Some(\"mbutils.c\"), line: Some(1665), routine: Some(\"report_invalid_encoding\") })" panic.location="src/server.rs:104:14"
2024-03-27T16:12:08.781363Z ERROR inverter_data_handler: tracing_panic: A panic occurred panic.payload="called `Option::unwrap()` on a `None` value" panic.location="src/data_message.rs:102:26"
2024-03-27T16:17:39.376501Z ERROR inverter_data_handler: tracing_panic: A panic occurred panic.payload="called `Result::unwrap()` on an `Err` value: Database(PgDatabaseError { severity: Error, code: \"22021\", message: \"invalid byte sequence for encoding \\\"UTF8\\\": 0x00\", detail: None, hint: None, position: None, where: Some(\"unnamed portal parameter $3\"), schema: None, table: None, column: None, data_type: None, constraint: None, file: Some(\"mbutils.c\"), line: Some(1665), routine: Some(\"report_invalid_encoding\") })" panic.location="src/server.rs:104:14"
2024-04-12T16:37:52.569265Z ERROR inverter_data_handler: tracing_panic: A panic occurred panic.payload="called `Option::unwrap()` on a `None` value" panic.location="src/data_message.rs:102:26"
2024-04-12T16:48:22.316562Z ERROR inverter_data_handler: tracing_panic: A panic occurred panic.payload="called `Result::unwrap()` on an `Err` value: Database(PgDatabaseError { severity: Error, code: \"22021\", message: \"invalid byte sequence for encoding \\\"UTF8\\\": 0x00\", detail: None, hint: None, position: None, where: Some(\"unnamed portal parameter $3\"), schema: None, table: None, column: None, data_type: None, constraint: None, file: Some(\"mbutils.c\"), line: Some(1665), routine: Some(\"report_invalid_encoding\") })" panic.location="src/server.rs:104:14"
2024-04-27T17:23:31.931945Z ERROR inverter_data_handler: tracing_panic: A panic occurred panic.payload="called `Option::unwrap()` on a `None` value" panic.location="src/data_message.rs:102:26"
2024-04-27T17:34:00.583355Z ERROR inverter_data_handler: tracing_panic: A panic occurred panic.payload="called `Result::unwrap()` on an `Err` value: Database(PgDatabaseError { severity: Error, code: \"22021\", message: \"invalid byte sequence for encoding \\\"UTF8\\\": 0x00\", detail: None, hint: None, position: None, where: Some(\"unnamed portal parameter $3\"), schema: None, table: None, column: None, data_type: None, constraint: None, file: Some(\"mbutils.c\"), line: Some(1665), routine: Some(\"report_invalid_encoding\") })" panic.location="src/server.rs:104:14"
2024-05-14T09:57:09.743367Z ERROR inverter_data_handler: tracing_panic: A panic occurred panic.payload="called `Option::unwrap()` on a `None` value" panic.location="src/data_message.rs:102:26"
2024-05-14T10:47:17.451114Z ERROR inverter_data_handler: tracing_panic: A panic occurred panic.payload="called `Result::unwrap()` on an `Err` value: Database(PgDatabaseError { severity: Error, code: \"22021\", message: \"invalid byte sequence for encoding \\\"UTF8\\\": 0x00\", detail: None, hint: None, position: None, where: Some(\"unnamed portal parameter $3\"), schema: None, table: None, column: None, data_type: None, constraint: None, file: Some(\"mbutils.c\"), line: Some(1665), routine: Some(\"report_invalid_encoding\") })" panic.location="src/server.rs:104:14"
2024-05-17T09:37:57.029357Z ERROR inverter_data_handler: tracing_panic: A panic occurred panic.payload="called `Option::unwrap()` on a `None` value" panic.location="src/data_message.rs:102:26"
2024-05-17T10:03:21.385783Z ERROR inverter_data_handler: tracing_panic: A panic occurred panic.payload="called `Result::unwrap()` on an `Err` value: Database(PgDatabaseError { severity: Error, code: \"22021\", message: \"invalid byte sequence for encoding \\\"UTF8\\\": 0x00\", detail: None, hint: None, position: None, where: Some(\"unnamed portal parameter $3\"), schema: None, table: None, column: None, data_type: None, constraint: None, file: Some(\"mbutils.c\"), line: Some(1665), routine: Some(\"report_invalid_encoding\") })" panic.location="src/server.rs:104:14"
2024-05-18T12:39:18.085693Z ERROR inverter_data_handler: tracing_panic: A panic occurred panic.payload="called `Option::unwrap()` on a `None` value" panic.location="src/data_message.rs:102:26"
2024-05-18T14:09:48.983682Z ERROR inverter_data_handler: tracing_panic: A panic occurred panic.payload="called `Result::unwrap()` on an `Err` value: Database(PgDatabaseError { severity: Error, code: \"22021\", message: \"invalid byte sequence for encoding \\\"UTF8\\\": 0x00\", detail: None, hint: None, position: None, where: Some(\"unnamed portal parameter $3\"), schema: None, table: None, column: None, data_type: None, constraint: None, file: Some(\"mbutils.c\"), line: Some(1665), routine: Some(\"report_invalid_encoding\") })" panic.location="src/server.rs:104:14"
2024-06-01T09:09:14.574144Z ERROR inverter_data_handler: tracing_panic: A panic occurred panic.payload="called `Option::unwrap()` on a `None` value" panic.location="src/data_message.rs:102:26"
2024-06-01T09:29:38.259073Z ERROR inverter_data_handler: tracing_panic: A panic occurred panic.payload="called `Result::unwrap()` on an `Err` value: Database(PgDatabaseError { severity: Error, code: \"22021\", message: \"invalid byte sequence for encoding \\\"UTF8\\\": 0x00\", detail: None, hint: None, position: None, where: Some(\"unnamed portal parameter $3\"), schema: None, table: None, column: None, data_type: None, constraint: None, file: Some(\"mbutils.c\"), line: Some(1665), routine: Some(\"report_invalid_encoding\") })" panic.location="src/server.rs:104:14"
2024-06-08T12:36:34.433127Z ERROR inverter_data_handler: tracing_panic: A panic occurred panic.payload="called `Option::unwrap()` on a `None` value" panic.location="src/data_message.rs:102:26"
2024-06-08T13:11:49.988882Z ERROR inverter_data_handler: tracing_panic: A panic occurred panic.payload="called `Result::unwrap()` on an `Err` value: Database(PgDatabaseError { severity: Error, code: \"22021\", message: \"invalid byte sequence for encoding \\\"UTF8\\\": 0x00\", detail: None, hint: None, position: None, where: Some(\"unnamed portal parameter $3\"), schema: None, table: None, column: None, data_type: None, constraint: None, file: Some(\"mbutils.c\"), line: Some(1665), routine: Some(\"report_invalid_encoding\") })" panic.location="src/server.rs:104:14"
A couple of checks should improve the stability. I think I will also add a new field for the entries in the database that made the server error out.
There can be some errors that occur if the data received from the ShineMaster is corrupted or zero-ed out:
They seem to be related to
A couple of checks should improve the stability. I think I will also add a new field for the entries in the database that made the server error out.