ham-radio-software / D-Rats

D-Rats program for D-Star Ham Radios
https://iz2lxi.jimdofree.com/
Other
42 stars 13 forks source link

Invalid XML file in inbox folder causes D-Rats exception pop-up. #175

Open maurizioandreotti opened 1 year ago

maurizioandreotti commented 1 year ago

Having done a fresh install of d-rats option 2 on a Win-10 pc where it was installed 0.3.9 I get this error: , which can be bypased by pressing "ignore all" and after all seems working

from Info window/ Debug: Traceback (most recent call last):

 File "C:/msys64/home/mauri/d-rats_venv/lib/python3.10/site-packages/d_rats/formgui.py", line 1076, in __init__
    self.doc = etree.parse(self._filename)

  File "src/lxml/etree.pyx", line 3541, in lxml.etree.parse

  File "src/lxml/parser.pxi", line 1879, in lxml.etree._parseDocument

  File "src/lxml/parser.pxi", line 1905, in lxml.etree._parseDocumentFromURL

  File "src/lxml/parser.pxi", line 1808, in lxml.etree._parseDocFromFile

  File "src/lxml/parser.pxi", line 1180, in lxml.etree._BaseParser._parseDocFromFile

  File "src/lxml/parser.pxi", line 618, in lxml.etree._ParserContext._handleParseResultDoc

  File "src/lxml/parser.pxi", line 728, in lxml.etree._handleParseResult

  File "src/lxml/parser.pxi", line 657, in lxml.etree._raiseParseError

  File "C:/Users/mauri/AppData/Roaming/D-RATS-EV/messages/Inbox/form_06252022_090631.xml", line 1

lxml.etree.XMLSyntaxError: Start tag expected, '<' not found, line 1, column 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

  File "C:/msys64/home/mauri/d-rats_venv/lib/python3.10/site-packages/d_rats/ui/main_messages.py", line 102, in <lambda>
    lambda x, y: self._messages.open_folder(y))

  File "C:/msys64/home/mauri/d-rats_venv/lib/python3.10/site-p

from console:

$ d-rats.py 04/06/2023 03:28:38:INFO:D-Rats:main: re-config option found -- Reconfigure D-rats 04/06/2023 03:28:38:INFO:D-Rats:main: args.config = C:/Users/mauri/AppData/Roaming/D-RATS-EV 04/06/2023 03:28:38:INFO:Mainapp:Enabled debug log for Win32 systems 04/06/2023 03:28:39:INFO:DratsConfig:File C:/Users/mauri/AppData/Roaming/D-RATS-EV/d-rats.config 04/06/2023 03:28:39:INFO:MainApp:_refresh_lang: Loading localeit' 04/06/2023 03:28:39:INFO:MainApp:_refresh_lang: Locale dir is: C:/msys64/home/mauri/d-rats_venv/shar e/d-rats/locale 04/06/2023 03:28:39:ERROR:MainApp:_refresh_lang: Messages catalog file missing for it. Need to use 'msgfmt tool to generate. 04/06/2023 03:28:39:INFO:MainApp:D-RATS v0.4.0 starting at Thu Apr 6 03:28:39 2023 on Platform Win3 2Platform: configuration: C:/Users/mauri/AppData/Roaming/D-RATS-EV system_data: C:/msys64/home/mauri/d-rats_venv/share/d-rats OS version: Windows 10 (10, 0, 19044, 2, '') 04/06/2023 03:28:39:INFO:MainApp:load position from config file 04/06/2023 03:28:39:INFO:MainApp:_static_gps: Configuring the Static position: 45.800456,9.428377 04/06/2023 03:28:39:INFO:MainApp:_static_gps: Mapserver active: True ca;; IZ2LXI-W 04/06/2023 03:28:39:INFO:MainApp:preparing our gps fix in JSON :b'{ "lat": "45.800456", "lng": "9.42 8377", "station": "IZ2LXI-W", "comments": "altitude: 0","timestamp": "2023-04-06 01:28:39" }' 04/06/2023 03:28:39:INFO:MainApp:Socket Created 04/06/2023 03:28:39:INFO:MainApp:Connecting to: localhost:9500 04/06/2023 03:28:41:INFO:MainApp:Failed to create socket. Traceback (most recent call last): File "C:/msys64/home/mauri/d-rats_venv/lib/python3.10/site-packages/d_rats/mainapp.py", line 433, in callback_gps sock.connect((mapserver_ip, mapserver_port)) ConnectionRefusedError: [WinError 10061] No connection could be made because the target machine acti vely refused it 04/06/2023 03:28:41:INFO:StaticGPSSource:StaticGPSPosition: UNKNOWN reporting 45.8005,9.4284@0 ft at 03:28:41 04/06/2023 03:28:41:INFO:D-Rats:main: reloading app

04/06/2023 03:28:41:INFO:MainApp:Installing dist form default.xsl -> C:/Users/mauri/AppData/Roaming/ D-RATS-EV/Form_Templates/default.xsl %s ---- End ---- Stack (most recent call last): File "C:\msys64\home\mauri\d-rats_venv\bin\d-rats.py", line 240, in main() File "C:\msys64\home\mauri\d-rats_venv\bin\d-rats.py", line 234, in main app.main() File "C:/msys64/home/mauri/d-rats_venv/lib/python3.10/site-packages/d_rats/mainapp.py", line 2124, in main self.run(None) File "C:/msys64/mingw64/lib/python3.10/site-packages/gi/overrides/Gio.py", line 42, in run return Gio.Application.run(self, *args, **kwargs) File "C:/msys64/home/mauri/d-rats_venv/lib/python3.10/site-packages/d_rats/mainapp.py", line 463, in do_activate self.mainwindow = mainwindow.MainWindow(self) File "C:/msys64/home/mauri/d-rats_venv/lib/python3.10/site-packages/d_rats/mainwindow.py", line 100, in init self.tabs["messages"] = MessagesTab(wtree, config, self._window) File "C:/msys64/home/mauri/d-rats_venv/lib/python3.10/site-packages/d_rats/ui/main_messages.py", line 103, in init self.folders.selectfolder(("Inbox")) File "C:/msys64/home/mauri/d-rats_venv/lib/python3.10/site-packages/d_rats/ui/message_folders.py", line 209, in select_folder self.emit("user-selected-folder", fqname) File "C:\msys64\home\mauri\d-rats_venv\bin\d-rats.py", line 93, in handle_exception MODULE_LOGGER.info("---- GUI Exception ----\n%s\n---- End ----\n",

` and config file the one attached

` [state] events_sort = 1 form_email_x = 1180 form_email_y = 500 show_all_filter = False connected_inet = True main_advanced = 200 filters = [] main_size_y = 587 main_size_x = 1008 status_msg = Online (D-RATS) qsts_enabled = True status_state = Online sidepane_visible = True main_maximized = 0 form_memo_x = 300 form_memo_y = 500

[tcp_in]

[user] name = Maurizio Andreotti altitude = 0 longitude = 9.428377 units = Metric callsign = IZ2LXI-W latitude = 45.800456

[settings] msg_smtp_port = 9025 qst_size_limit = 2048 ddt_block_outlimit = 4 encoding = yenc socket_pw = http_proxy = default_gps_comment = BD *56 mapurllandscape = http://tile.thunderforest.com/landscape/ keyformapurlbase = compression = True smtp_dogw = False ddt_block_size = 512 outports = [] pipelinexfers = True mapserver_active = True smtp_username = maurizio.iz2lxi@gmail.com sockflush = 0.5 sniff_packets = False maptype = cycle aprssymtab = x msg_flush = 60 aprssymbol = x keyformapurlcycle = ?apikey=5a1a4a79354244a38707d83969fd88a2 mapurlbase = https://tile.openstreetmap.de/ remote_admin_passwd = mapserver_port = 9500 msg_wl2k_mode = Network msg_forward = True map_tile_ttl = 720 ping_info = happy day! msg_smtp_server = False map_marker_bgcolor = yellow keyformapurllandscape = ?apikey=5a1a4a79354244a38707d83969fd88a2 inports = [] gpsenabled = False gpsportspeed = 4800 form_logo_dir = C:\Users\mauri\AppData\Roaming\D-RATS-EV\logos smtp_tls = True mapdir = C:\Users\mauri\AppData\Roaming\D-RATS-EV\maps force_delay = -2 warmup_timeout = 3 station_msg_ttl = 600 gpsport = smtp_port = 587.000000 smtp_server = smtp.gmail.com warmup_length = 8 smtp_password = Helena.1973 mapurlcycle = http://tile.thunderforest.com/cycle/ mapurloutdoors = http://a.tile.opentopomap.org/ keyformapurloutdoors = mapserver_ip = localhost delete_from = timestamp_positions = False msg_pop3_port = 9110 smtp_replyto = compatmode = False msg_pop3_server = False expire_stations = 60 ports = {'ports_14': 'False,net:drats.auburn.edu:9000,,True,False,USA Alabama Statewide ARES', 'ports_15': 'False,net:cfl.ratflector.net:9000,,True,False,USA Central Florida', 'ports_16': 'False,net:ae5he.ratflector.com:9000,,True,False,USA EL PASO', 'ports_17': 'False,net:wa7fw.dstargateway.org:9000,,True,False,USA Federal Way WA', 'ports_10': 'False,net:pldares.ratflector.com:9000,,True,False,PAULDIN', 'ports_11': 'False,net:sewx.ratflector.com:9000,,True,False,SE WX Net', 'ports_12': 'False,net:hs0zer.no-ip.com:9000,,True,False,THAILAND Bangkok', 'ports_13': 'False,net:alabama.ratflector.com:9000,,True,False,USA ALABAMA', 'ports_18': 'False,net:gaares.ratflector.com:9000,,True,False,USA GAARES', 'ports_19': 'False,net:drats.gaares.org:9000,,True,False,USA Georgia Statewide ARES', 'ports_2': 'False,net:dcs007.xreflector.net:9000,,True,False,EUROPE Netherlands', 'ports_3': 'False,/dev/ttyUSB0,9600,True,True,IC2820 ttyUSB0', 'ports_35': 'False,net:n1rcw.ddns.net:9000,,True,False,WX - n1rcw', 'ports_1': 'False,net:127.0.0.1:14550,,True,False,APRS (on Localhost)', 'ports_6': 'False,net:w5sf.ratflector.com:9000,,True,False,MEXICO', 'ports_7': 'False,net:localhost:9000,,False,False,My RAT flector (on localhost)', 'ports_4': 'False,COM1,38400,True,True,ICOM E-92D COM1', 'ports_5': 'False,COM2,9600,True,True,ICOM ID-51 COM2', 'ports_8': 'False,net:n1kxj.ddns.net:9000,,True,False,New Englad', 'ports_9': 'False,net:52.87.128.252:9000,,True,False,North Carolina ARES', 'ports_30': 'False,net:ae5he.ham-radio-op.net:9000,,True,False,USA TEXAS El Paso', 'ports_33': 'False,net:gwinnettares.ratflector.com:9000,,True,False,UTAH', 'ports_31': 'False,net:155.98.24.13:9000,,True,False,USA Utah Salt Lake County', 'ports_34': 'False,net:W5SF.ratflector.com:9000,,True,False,W5SF', 'ports_36': 'False,net:dcs007.ratflector.com:9000,,True,False,WX dcs007', 'ports_37': 'False,net:wa7dre.ratflector.com:9000,,True,False,XLX - wa7dre', 'ports_32': 'False,net:wa7dr.ratflector.com:9000,,True,False,USA WASHINGTON', 'ports_29': 'False,net:W5AW.ratflector.com:9000,,True,False,USA TEXAS (W5AW)', 'ports_28': 'False,net:ducknest.duckdns.org:9000,,True,False,USA Texas - Big Spring', 'ports_25': 'False,net:d-rats.wa7dre.org:9000,,True,False,USA Spokane Washington Digital Radio Enthusiasts', 'ports_24': 'False,net:k3pdr.dstargateway.org:9000,,True,False,USA Philadelphia Digital Radio Association (PDRA) K3PDR', 'ports_27': 'False,net:tn.ratflector.com:9000,,True,False,USA TENESSEE', 'ports_26': 'False,net:StTammany.ratflector.com:9000,,True,False,USA St. Tammany Parish', 'ports_21': 'False,net:w5mpz.org:9000,,True,False,USA NEW MEXICO Albuquerque', 'ports_20': 'False,net:gwinnettares.dyndns.org:9000,,True,False,USA Gwinnett Co ARES', 'ports_23': 'False,net:rat.gaampr.net:9000,,True,False,USA NW GA ARES', 'ports_22': 'False,net:nfl.ratflector.net:9000,,True,False,USA Northern Florida'} qst_owappid = ecd42c31b76e59e83de5cb8c16f7bd95 qst_owuri = https://api.openweathermap.org/data/2.5/

[sounds] files = chat = messages_enabled = False messages = files_enabled = False chat_enabled = False

[prefs] blink_event = False msg_wl2k_ssid = signon = Online (D-RATS) signoff = Going offline (D-RATS) eolstrip = True useutc = True download_dir = C:\Users\mauri\OneDrive\Desktop\ restore_stations = True msg_allow_pop3 = True blink_chat = True blink_messages = True blinkmsg = False msg_wl2k_server = server.winlink.org confirm_exit = False toolbar_button_size = Small debuglog = False noticere = IZ2LXI?i msg_allow_wl2k = True font = Arial 10 ignorere = [QST] [CQCQCQ] outgoingcolor = #DDDD44441111 scrollback = 1024 msg_include_reply = False brokencolor = #FFFFFFFF3333 incomingcolor = #00004444FFFF logresume = True language = Italiano callsigncolor = #FFDD99CC77CC msg_wl2k_port = 8772 noticecolor = #0000660011DD callsigns = [(True, 'US')] blink_files = True msg_wl2k_rmscall = allow_remote_files = True dosignon = True msg_wl2k_rmsport = dosignoff = True check_spelling = True chat_showstatus = True ignorecolor = #BB88BB88BB88 chat_timestamp = True logenabled = True msg_wl2k_password = 9LLTRJ

[ports] ports_0 = False,net:127.0.0.1:14550,,True,True,APRS (on Localhost) ports_1 = False,COM3,9600,False,False,com 3 ports_2 = False,COM6,9600,True,True,com 6 ports_3 = False,net:dcs007.xreflector.net:9000,,True,True,EUROPE Netherlands ports_4 = False,/dev/ttyUSB0,9600,True,True,IC2820 ttyUSB0 ports_5 = False,net:w5sf.ratflector.com:9000,,True,True,MEXICO ports_6 = False,net:localhost:9000,,False,True,My RAT flector (on localhost) ports_7 = False,net:n1kxj.ddns.net:9000,,True,True,New Englad ports_8 = False,net:52.87.128.252:9000,,True,True,North Carolina ARES ports_9 = False,net:pldares.ratflector.com:9000,,True,True,PAULDIN ports_10 = False,net:raspberrypi:9000,,True,True,raspberrypi ports_11 = False,net:ref.d-rats.com:9000,,True,True,RAT ports_12 = False,net:sewx.ratflector.com:9000,,True,True,SE WX Net ports_13 = False,net:hs0zer.no-ip.com:9000,,True,True,THAILAND Bangkok ports_14 = False,net:alabama.ratflector.com:9000,,True,True,USA ALABAMA ports_15 = False,net:drats.auburn.edu:9000,,True,True,USA Alabama Statewide ARES ports_16 = False,net:cfl.ratflector.net:9000,,True,True,USA Central Florida ports_17 = False,net:ae5he.ratflector.com:9000,,True,True,USA EL PASO ports_18 = False,net:wa7fw.dstargateway.org:9000,,True,True,USA Federal Way WA ports_19 = False,net:gaares.ratflector.com:9000,,True,True,USA GAARES ports_20 = False,net:drats.gaares.org:9000,,True,True,USA Georgia Statewide ARES ports_21 = False,net:gwinnettares.dyndns.org:9000,,True,True,USA Gwinnett Co ARES ports_22 = False,net:w5mpz.org:9000,,True,True,USA NEW MEXICO Albuquerque ports_23 = False,net:nfl.ratflector.net:9000,,True,True,USA Northern Florida ports_24 = False,net:rat.gaampr.net:9000,,True,True,USA NW GA ARES ports_25 = True,net:k3pdr.dstargateway.org:9000,,True,True,USA Philadelphia Digital Radio Association (PDRA) K3PDR ports_26 = False,net:d-rats.wa7dre.org:9000,,True,True,USA Spokane Washington Digital Radio Enthusiasts ports_27 = False,net:StTammany.ratflector.com:9000,,True,True,USA St. Tammany Parish Ratflector & Maildrop ports_28 = False,net:tn.ratflector.com:9000,,True,True,USA TENESSEE ports_29 = False,net:ducknest.duckdns.org:9000,,True,True,USA Texas - Big Spring ports_30 = False,net:W5AW.ratflector.com:9000,,True,True,USA TEXAS (W5AW) ports_31 = False,net:ae5he.ham-radio-op.net:9000,,True,True,USA TEXAS El Paso ports_32 = False,net:155.98.24.13:9000,,True,True,USA Utah Salt Lake County ports_33 = False,net:wa7dr.ratflector.com:9000,,True,True,USA WASHINGTON ports_34 = False,net:gwinnettares.ratflector.com:9000,,True,True,UTAH ports_35 = False,net:W5SF.ratflector.com:9000,,True,True,W5SF ports_36 = False,net:n1rcw.ddns.net:9000,,True,True,WX - n1rcw ports_37 = False,net:dcs007.ratflector.com:9000,,True,True,WX dcs007 ports_38 = False,net:wa7dre.ratflector.com:9000,,True,True,XLX - wa7dre

[incoming_email] incoming_email_0 = pop.gmail.com,maurizio.iz2lxi@gmail.com,Helena.1973,6,True,995,Form,True incoming_email_1 = pop.mail.yahoo.com,iz2lxi@yahoo.it,helena1973,5,True,995,Form,False

[email_access]

[quick] 20220228212748 = Ciao all

[tcp_out]

[buoys]

[qst_20220316195246] enabled = False freq = 60 d-rats .config.txt

content = Current/Lecco type = OpenWeather port = Current

`

wb8tyw commented 1 year ago

The issue here is that D-Rats is checking to see if a form sent to you in your inbox is a valid form, and the form failed the check.

C:/Users/mauri/AppData/Roaming/D-RATS-EV/messages/Inbox/form_06252022_090631.xml

It would help to have a copy of the first line of this file, if it does not contain any sensitive information so that this bug can be reproduced on demand. In this case, it looks like I just need to put a file with a similar name in the inbox that does contain valid XML.

The next thing is what should D-Rats do when this happens? As this is in the inbox, it is something that has apparently been sent. We do not know how this invalid xml file arrived, or if it got corrupted post reception.

We probably need to flag this file in the Inbox in some way to indicate that even though it claims to be an XML file, it is not an XML file. so the end user can deterine what they want to do with it.

maurizioandreotti commented 1 year ago

Xml form attached - it contains some sort of binary, I guess it arrived corrupted (creation date on filesystem is 25th of June 2022,... I don't recall what it was supposed to be).

Il giorno gio 6 apr 2023 alle ore 15:39 John E. Malmberg < @.***> ha scritto:

The issue here is that D-Rats is checking to see if a form sent to you in your inbox is a valid form, and the form failed the check.

C:/Users/mauri/AppData/Roaming/D-RATS-EV/messages/Inbox/form_06252022_090631.xml

It would help to have a copy of the first line of this file, if it does not contain any sensitive information so that this bug can be reproduced on demand. In this case, it looks like I just need to put a file with a similar name in the inbox that does contain valid XML.

The next thing is what should D-Rats do when this happens? As this is in the inbox, it is something that has apparently been sent. We do not know how this invalid xml file arrived, or if it got corrupted post reception.

We probably need to flag this file in the Inbox in some way to indicate that even though it claims to be an XML file, it is not an XML file. so the end user can deterine what they want to do with it.

— Reply to this email directly, view it on GitHub https://github.com/ham-radio-software/D-Rats/issues/175#issuecomment-1499080783, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB2W7OT4BL7XOU26J5BE44DW73BRHANCNFSM6AAAAAAWUZ6NQM . You are receiving this because you authored the thread.Message ID: @.***>

maurizioandreotti commented 1 year ago

renamed as Zip, got more understandable,... renamed again as xlsx file... it shows a table of data I did

I guess I used this file to do some upload/file transfer test,... but how it ended up being in that folder with xml extension, I dont really know

Il giorno gio 6 apr 2023 alle ore 19:30 Maurizio Andreotti < @.***> ha scritto:

Xml form attached - it contains some sort of binary, I guess it arrived corrupted (creation date on filesystem is 25th of June 2022,... I don't recall what it was supposed to be).

Il giorno gio 6 apr 2023 alle ore 15:39 John E. Malmberg < @.***> ha scritto:

The issue here is that D-Rats is checking to see if a form sent to you in your inbox is a valid form, and the form failed the check.

C:/Users/mauri/AppData/Roaming/D-RATS-EV/messages/Inbox/form_06252022_090631.xml

It would help to have a copy of the first line of this file, if it does not contain any sensitive information so that this bug can be reproduced on demand. In this case, it looks like I just need to put a file with a similar name in the inbox that does contain valid XML.

The next thing is what should D-Rats do when this happens? As this is in the inbox, it is something that has apparently been sent. We do not know how this invalid xml file arrived, or if it got corrupted post reception.

We probably need to flag this file in the Inbox in some way to indicate that even though it claims to be an XML file, it is not an XML file. so the end user can deterine what they want to do with it.

— Reply to this email directly, view it on GitHub https://github.com/ham-radio-software/D-Rats/issues/175#issuecomment-1499080783, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB2W7OT4BL7XOU26J5BE44DW73BRHANCNFSM6AAAAAAWUZ6NQM . You are receiving this because you authored the thread.Message ID: @.***>