Upload of short data_ fails repeatedly
From gr-satellites there was a 2 byte frame that caused the uploader to misbehave.
Quick solution would be to add except TypeError:
to catch this here
I got a comment from @kerel-fs
For a proper fix I would like to improve the detection of the file type. Currently it tries to open the file in "text mode" using current locale encoding. If this fails the code assumes this is a binary frame ("old" flowgraph->client transport type). If it does not fail, it assumes this is a json string with a "pdu" key ("new" flowgraph->client transport type).
\x34\x34
is a frame using the old transport type, but can be opened in text mode, even parsed as json (but of course shouldn't).
hexdump /tmp/.satnogs/data/data_3430053_2021-01-07T17-08-57_0
0000000 3434
satnogsclient.scheduler.tasks - INFO - Post data started
apscheduler.executors.default - ERROR - Job "post_data (trigger: interval[0:00:30], next run at: 2021-01-07 19:03:15 UTC)" raised an exception
Traceback (most recent call last):
File "/var/lib/satnogs/lib/python3.7/site-packages/apscheduler/executors/base.py", line 125, in run_job
retval = job.func(*job.args, **job.kwargs)
File "/var/lib/satnogs/lib/python3.7/site-packages/satnogsclient/scheduler/tasks.py", line 100, in post_data
observation = {'demoddata': (fil, base64.b64decode(data['pdu']))}
TypeError: 'int' object is not subscriptable
satnogsclient.scheduler.tasks - INFO - Post data started
apscheduler.executors.default - ERROR - Job "post_data (trigger: interval[0:00:30], next run at: 2021-01-07 19:03:45 UTC)" raised an exception
Traceback (most recent call last):
File "/var/lib/satnogs/lib/python3.7/site-packages/apscheduler/executors/base.py", line 125, in run_job
retval = job.func(*job.args, **job.kwargs)
File "/var/lib/satnogs/lib/python3.7/site-packages/satnogsclient/scheduler/tasks.py", line 100, in post_data
observation = {'demoddata': (fil, base64.b64decode(data['pdu']))}
TypeError: 'int' object is not subscriptable