tkuester / taky

A simple python TAK server
MIT License
192 stars 42 forks source link

Unmarshalling error #77

Open sgofferj opened 2 years ago

sgofferj commented 2 years ago

I moved from docker 0.8.3 to latest to get in running on my OCS ARM instance but somehow, latest doesn't seem to like my data feed. I see a bunch of errors like this in the console:

INFO:COTServer:New ssl client from 80.221.163.68:34838
DEBUG:COTRouter:Anonymous Broadcast: <Event uid="ICAO-4aca13" etype="a-f-A-C-F" time="2022-09-26 20:14:18.437000">
DEBUG:RedisPersistence:Updating tracking for: <Event uid="ICAO-4aca13" etype="a-f-A-C-F" time="2022-09-26 20:14:18.437000"> (ttl: 30)
DEBUG:SocketTAKClient@80.221.163.68:34838:Opening logfile /data/logs/anonymous-80.221.163.68.cot
INFO:SocketTAKClient@80.221.163.68:34838:Socket disconnect: The operation did not complete (read) (_ssl.c:2622)

/data/logs/anonymous-80.221.163.68.cot contains a bunch of those:

<event version="2.0" type="a-n-A-C-F" uid="ICAO-48c2a0" time="2022-09-26T20:11:17
.406Z" start="2022-09-26T20:11:17.406Z" stale="2022-09-26T20:11:47.406Z" how="m-g
">
  <point hae="NaN" ce="999999" le="999999"/>
  <detail>
    <uid Droid="ICAO-48c2a0"/>
    <contact callsign="RYR22BH "/>
    <track course="unknown" speed="unknown"/>
    <remarks>Reg: SP-RZA Squawk: unknown Category: A3 #ADSB</remarks>
  </detail>
  <__taky_err>
    <!--Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/taky/cot/models/event.py", line 86
, in from_elm
    ret.point = Point.from_elm(child)
  File "/usr/local/lib/python3.9/dist-packages/taky/cot/models/point.py", line 38
, in from_elm
    lat=float(elm.get("lat")),
TypeError: float() argument must be a string or a number, not 'NoneType'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/taky/cot/client.py", line 270, in 
feed
    evt = models.Event.from_elm(elm)
  File "/usr/local/lib/python3.9/dist-packages/taky/cot/models/event.py", line 97
, in from_elm
    raise UnmarshalError(f"Issue parsing {child.tag}") from exc
taky.cot.models.errors.UnmarshalError: Issue parsing point
-->
  </__taky_err>
</event>
dbussert commented 2 years ago

The point posted is missing a lat/lon and the hae is NaN, so it's invalid CoT entirely

sgofferj commented 2 years ago

Fixed the CoT issue (I think). Still getting console log:

DEBUG:COTServer:Checking F0B5515CDE192670 against cert db
DEBUG:COTRouter:Sending persistence objects to <SocketTAKClient uid=None callsign=None addr=80.221.163.68:53910>
DEBUG:COTRouter:Anonymous Broadcast: <Event uid="ICAO-461fa9" etype="a-f-A-C-F" time="2022-09-28 08:14:26.391000">
DEBUG:RedisPersistence:Updating tracking for: <Event uid="ICAO-461fa9" etype="a-f-A-C-F" time="2022-09-28 08:14:26.391000"> (ttl: 30)
DEBUG:SocketTAKClient@80.221.163.68:53910:Opening logfile /data/logs/anonymous-80.221.163.68.cot
INFO:SocketTAKClient@80.221.163.68:53910:Socket disconnect: The operation did not complete (read) (_ssl.c:2622)

and cot log:

<event version="2.0" uid="ICAO-461fa9" type="a-f-A-C-F" how="m-g" time="2022-09-28T08:15:42.421Z" start="2022-09-28T08:15:42.421Z" stale="2022-09-28T08:16:12.421Z">
  <point lat="59.923810" lon="23.889865" hae="3909.0" ce="9.0" le="1.0"/>
  <detail>
    <uid Droid="ICAO-461fa9"/>
    <contact callsign="FIN7RX  "/>
    <track course="72.84" speed="146.4622068"/>
    <remarks>Reg: OH-LZT Squawk: 2574 Category: A3 #FIN #ADSB</remarks>
  </detail>
</event>

My ADSB feeder uses NodeRED atm. Connect node is IMHO set up correctly: Screenshot_20220928_112431

tkuester commented 1 year ago

This is somewhat related to #75 -- I believe sending out a COT event without a location detail is invalid, though many clients may interpret it just fine.

@sgofferj How is your project coming along now? Are you able to route packets ok from your workflow?

sgofferj commented 1 year ago

To be honest, I'm still on taky 0.8.3 because of the issues I had and there was no docker image for Arm. I put a re-check of the situation to my calendar for end of Feb / beginning of Mar... But I'm happy to check next weekend if you expect problems to be solved.