SebastianObi / LXMF-Tools

Various small programs and tools which use the message protocol LXMF from https://github.com/markqvist/LXMF
MIT License
24 stars 6 forks source link

lxmf_distribution_group_extended gives UTF-8 error #4

Closed kristjan-kuusk closed 3 weeks ago

kristjan-kuusk commented 4 weeks ago

Trying to get lxmf_distribution_group_extended going. It starts with some warnings and announce is seen by clients, but if message is received it gives UTF-8 error and message is not sent to group members. Tried on 32bit x86 Alpine linux and 64bit x86-64 Linux Mint Debian edition based on Debian 12 Bookworm, both gave exactly the same results. All other rns and lxmf stuff seems to work ok.

Log of starting and receiving 2 messages:

rns@rns:~/LXMF-Tools/lxmf_distribution_group_extended$ ./lxmf_distribution_group_extended.py /home/rns/LXMF-Tools/lxmf_distribution_group_extended/./lxmf_distribution_group_extended.py:3432: SyntaxWarning: invalid escape sequence '\w' data = re.sub(r'^#?'+key+'( +)?=( +)?(\w+)?', key+" = "+value, data, count=1, flags=re.MULTILINE) /home/rns/LXMF-Tools/lxmf_distribution_group_extended/./lxmf_distribution_group_extended.py:3442: SyntaxWarning: invalid escape sequence '\w' data = re.sub(r'^#?'+key+'( +)?=( +)?(\w+)?', key+" = "+value, data, count=1, flags=re.MULTILINE) [2024-11-02 18:51:19] [Notice] LXMF - Loaded Primary Identity <83c6c42c0e823c6918046949b1f97875> from /home/rns/.config/lxmf_distribution_group_extended/identity [2024-11-02 18:51:19] [] ............................................................................... [2024-11-02 18:51:19] [] LXMF - Address: <9ff4d79771c74bd4821d4a6bc16c1f82> [2024-11-02 18:51:19] [] ............................................................................... [2024-11-02 18:51:19] [Notice] RNS - Using existing Primary Identity <83c6c42c0e823c6918046949b1f97875> [2024-11-02 18:51:32] [Error] An error occurred in the external delivery callback for <LXMessage 1d18153987c6655b68d714418eb20140418ade4cc6a0c07c302d0ca3e1aac36f> [2024-11-02 18:51:32] [Error] An unhandled <class 'UnicodeDecodeError'> exception occurred: 'utf-8' codec can't decode byte 0x92 in position 0: invalid start byte [2024-11-02 18:51:32] [Error] Traceback (most recent call last): File "/home/rns/.local/lib/python3.12/site-packages/LXMF/LXMRouter.py", line 1361, in lxmf_delivery self.__delivery_callback(message) File "/home/rns/LXMF-Tools/lxmf_distribution_group_extended/./lxmf_distribution_group_extended.py", line 616, in process_lxmf_message_propagated self.message_received_callback(message) File "/home/rns/LXMF-Tools/lxmf_distribution_group_extended/./lxmf_distribution_group_extended.py", line 1168, in lxmf_message_received_callback source_name = app_data.decode('utf-8') ^^^^^^^^^^^^^^^^^^^^^^^^ UnicodeDecodeError: 'utf-8' codec can't decode byte 0x92 in position 0: invalid start byte

[2024-11-02 18:52:12] [Error] An error occurred in the external delivery callback for [2024-11-02 18:52:12] [Error] An unhandled <class 'UnicodeDecodeError'> exception occurred: 'utf-8' codec can't decode byte 0x92 in position 0: invalid start byte [2024-11-02 18:52:12] [Error] Traceback (most recent call last): File "/home/rns/.local/lib/python3.12/site-packages/LXMF/LXMRouter.py", line 1361, in lxmf_delivery self.__delivery_callback(message) File "/home/rns/LXMF-Tools/lxmf_distribution_group_extended/./lxmf_distribution_group_extended.py", line 616, in process_lxmf_message_propagated self.message_received_callback(message) File "/home/rns/LXMF-Tools/lxmf_distribution_group_extended/./lxmf_distribution_group_extended.py", line 1168, in lxmf_message_received_callback source_name = app_data.decode('utf-8') ^^^^^^^^^^^^^^^^^^^^^^^^ UnicodeDecodeError: 'utf-8' codec can't decode byte 0x92 in position 0: invalid start byte

SebastianObi commented 4 weeks ago

There is an issue with the recalled app data (announce data) of the peer. I think this happens because the new reticulum rachet announce structure. I didn't tested the distribution group for a long time. Next week I will take a look at it and make it compatible with the current reticulum/lxmf.

SebastianObi commented 3 weeks ago

The bug should now be fixed. I have tested it with the current Nomadnet and Sideband version.

kristjan-kuusk commented 3 weeks ago

I can confirm that it works now. Thank You!