Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NoneType error when finding aircrafts #24

Open
gncnpk opened this issue Feb 16, 2023 · 7 comments
Open

NoneType error when finding aircrafts #24

gncnpk opened this issue Feb 16, 2023 · 7 comments

Comments

@gncnpk
Copy link

gncnpk commented Feb 16, 2023

It seems ADSBCOT crashes when a aircraft is missing any one piece of information (id, lat, long, etc). My question is how should this be handled? Should it be logged and the program continues or if the piece of information isn't critical (lat, long I would consider the critical part), should it just not provide that information? My current workaround is having a try and except check in classes.py on line 255 and it just ignores any aircraft missing a certain piece of information.

@ampledata
Copy link
Collaborator

ampledata commented Feb 16, 2023 via email

@gncnpk
Copy link
Author

gncnpk commented Feb 16, 2023

@ampledata Sure can do! Once I get off work, I'll remove my try and except catch, and get you the trace back :)

@gncnpk
Copy link
Author

gncnpk commented Feb 16, 2023

ERROR:asyncio:Task exception was never retrieved
future: <Task finished name='Task-4' coro=<ADSBNetWorker.run() done, defined at /usr/local/lib/python3.9/dist-packages/adsbcot/classes.py:184> exception=AttributeError("'NoneType' object has no attribute 'replace'")>
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/adsbcot/classes.py", line 255, in run
    "flight": val.get("call", key).replace("_", ""),
AttributeError: 'NoneType' object has no attribute 'replace'
ERROR:asyncio:Fatal error on SSL transport
protocol: <asyncio.sslproto.SSLProtocol object at 0xb4583b20>
transport: <_SelectorSocketTransport closing fd=6>
Traceback (most recent call last):
  File "/usr/lib/python3.9/asyncio/selector_events.py", line 918, in write
    n = self._sock.send(data)
OSError: [Errno 9] Bad file descriptor

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.9/asyncio/sslproto.py", line 684, in _process_write_backlog
    self._transport.write(chunk)
  File "/usr/lib/python3.9/asyncio/selector_events.py", line 924, in write
    self._fatal_error(exc, 'Fatal write error on socket transport')
  File "/usr/lib/python3.9/asyncio/selector_events.py", line 719, in _fatal_error
    self._force_close(exc)
  File "/usr/lib/python3.9/asyncio/selector_events.py", line 731, in _force_close
    self._loop.call_soon(self._call_connection_lost, exc)
  File "/usr/lib/python3.9/asyncio/base_events.py", line 746, in call_soon
    self._check_closed()
  File "/usr/lib/python3.9/asyncio/base_events.py", line 510, in _check_closed
    raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed

@ampledata
Copy link
Collaborator

What ADS-B source are you using? (mind sharing your config.ini?)

@gncnpk
Copy link
Author

gncnpk commented Feb 17, 2023

Sure! I'm using dump1090-fa with a FlightAware Pro Stick Plus and here's my config.ini

[adsbcot]
PYTAK_TLS_CLIENT_CERT = /etc/my_client_cert.pem
PYTAK_TLS_CLIENT_KEY = /etc/my_client_cert.pem
PYTAK_TLS_DONT_VERIFY = true
COT_URL = tls://XX.XX.XX.XX:8089
DUMP1090_URL = tcp+beast://127.0.0.1:30005

@gncnpk
Copy link
Author

gncnpk commented Feb 17, 2023

So I saw your message in Discord and I'll probably be switching over to the JSON feed instead, but I still would like to help fix this potential bug or if it's not a bug, help others find the solution :)

@ampledata
Copy link
Collaborator

Hey @gncnpk, if you're running locally, I recommend switching to the new file:// based behavior, see: https://adsbcot.readthedocs.io/en/latest/config.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants